[jboss-cvs] JBossAS SVN: r95723 - in projects/metadata/common/trunk/src/main/java/org/jboss/metadata: javaee/spec and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 28 22:24:08 EDT 2009
Author: remy.maucherat at jboss.com
Date: 2009-10-28 22:24:07 -0400 (Wed, 28 Oct 2009)
New Revision: 95723
Modified:
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/ProcessorUtils.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java
Log:
- Add new util methods for description groups.
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/ProcessorUtils.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/ProcessorUtils.java 2009-10-29 02:14:13 UTC (rev 95722)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/ProcessorUtils.java 2009-10-29 02:24:07 UTC (rev 95723)
@@ -31,9 +31,15 @@
import java.util.Set;
import org.jboss.annotation.javaee.Descriptions;
+import org.jboss.annotation.javaee.DisplayNames;
+import org.jboss.annotation.javaee.Icons;
import org.jboss.metadata.javaee.spec.DescriptionGroupMetaData;
import org.jboss.metadata.javaee.spec.DescriptionImpl;
import org.jboss.metadata.javaee.spec.DescriptionsImpl;
+import org.jboss.metadata.javaee.spec.DisplayNameImpl;
+import org.jboss.metadata.javaee.spec.DisplayNamesImpl;
+import org.jboss.metadata.javaee.spec.IconImpl;
+import org.jboss.metadata.javaee.spec.IconsImpl;
import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
/**
@@ -105,6 +111,34 @@
}
return descriptions;
}
+
+ public static DisplayNames getDisplayName(String displayName)
+ {
+ DisplayNamesImpl displayNames = null;
+ if(displayName.length() > 0)
+ {
+ DisplayNameImpl dn = new DisplayNameImpl();
+ dn.setDisplayName(displayName);
+ displayNames = new DisplayNamesImpl();
+ displayNames.add(dn);
+ }
+ return displayNames;
+ }
+
+ public static Icons getIcons(String smallIcon, String largeIcon)
+ {
+ IconsImpl icons = null;
+ if(smallIcon.length() > 0 || largeIcon.length() > 0)
+ {
+ IconImpl i = new IconImpl();
+ i.setSmallIcon(smallIcon);
+ i.setLargeIcon(largeIcon);
+ icons = new IconsImpl();
+ icons.add(i);
+ }
+ return icons;
+ }
+
public static DescriptionGroupMetaData getDescriptionGroup(String description)
{
DescriptionGroupMetaData dg = null;
@@ -117,6 +151,26 @@
return dg;
}
+ public static DescriptionGroupMetaData getDescriptionGroup(String description, String displayName,
+ String smallIcon, String largeIcon)
+ {
+ DescriptionGroupMetaData dg = null;
+ if(description.length() > 0 || displayName.length() > 0 || smallIcon.length() > 0 || largeIcon.length() > 0)
+ {
+ dg = new DescriptionGroupMetaData();
+ Descriptions descriptions = getDescription(description);
+ if (descriptions != null)
+ dg.setDescriptions(descriptions);
+ DisplayNames displayNames = getDisplayName(displayName);
+ if (displayNames != null)
+ dg.setDisplayNames(displayNames);
+ Icons icons = getIcons(smallIcon, largeIcon);
+ if (icons != null)
+ dg.setIcons(icons);
+ }
+ return dg;
+ }
+
public static Collection<Class<? extends Annotation>> createAnnotationSet(Class<? extends Annotation> annotation)
{
Set<Class<? extends Annotation>> set = new HashSet<Class<? extends Annotation>>(1);
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java 2009-10-29 02:14:13 UTC (rev 95722)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java 2009-10-29 02:24:07 UTC (rev 95723)
@@ -45,7 +45,7 @@
private static final long serialVersionUID = 1;
public static final int DEFAULT_PORT_NUMBER = -1;
- public static final int DEFAULT_LOGIN_TIMEOUT = -1;
+ public static final int DEFAULT_LOGIN_TIMEOUT = 0;
public static final boolean DEFAULT_TRANSACTIONAL = true;
public static final int DEFAULT_INITIAL_POOL_SIZE = -1;
public static final int DEFAULT_MAX_POOL_SIZE = -1;
More information about the jboss-cvs-commits
mailing list