[jboss-svn-commits] JBoss Common SVN: r2448 - in jbossxb-builder/trunk/src/test: java/org/jboss/javaee and 13 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 18 09:38:53 EDT 2007
Author: alex.loubyansky at jboss.com
Date: 2007-07-18 09:38:52 -0400 (Wed, 18 Jul 2007)
New Revision: 2448
Added:
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Description.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Descriptions.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayName.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayNames.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icon.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icons.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertiesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertyMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/IgnoreDependencyMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/AbstractEJBReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionGroupMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionsImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNameImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNamesImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceType.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EmptyMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/Environment.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntriesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntryMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentRefsGroupMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconsImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/JavaEEMetaDataConstants.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbackMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbacksMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationUsageType.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextType.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertiesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertyMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceAuthorityType.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionTargetMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceSharingScopeType.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/RunAsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRolesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainsMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlersMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferencesMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaDataWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImpl.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroup.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroupWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptions.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionsWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/JavaEEMetaDataUtil.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/LanguageMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaDataWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedAnnotationMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithDescriptions.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMappedMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedAnnotationMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroup.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroupWithOverride.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptions.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashMap.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSet.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSetWithId.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/OverrideMetaData.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptionGroup.java
jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptions.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/AbstractJavaEEEverythingTest.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/JavaEETestSuite.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionGroupUnitTestCase.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionUnitTestCase.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DisplayNameUnitTestCase.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/IconUnitTestCase.java
jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/JavaEEMetaDataTestSuite.java
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDescriptionDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDisplayNameDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testIconDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testNonDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testNonDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testDefaultLanguage.xml
jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testNonDefaultLanguage.xml
Log:
temporarily add javaee metadata prototype as tests to the jbossxb-builder testsuite
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Description.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Description.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Description.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Description.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Description
+{
+ /** The default language */
+ String DEFAULT_LANGUAGE = "en";
+
+ /** The descriptions */
+ String value() default "";
+
+ /** The language */
+ String language() default DEFAULT_LANGUAGE;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Descriptions.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Descriptions.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Descriptions.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Descriptions.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Descriptions
+{
+ /** Descriptions */
+ Description[] value();
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayName.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayName.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayName.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * DisplayName.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface DisplayName
+{
+ /** The display name */
+ String value() default "";
+
+ /** The language */
+ String language() default Description.DEFAULT_LANGUAGE;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayNames.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayNames.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/DisplayNames.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * DisplayNames.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface DisplayNames
+{
+ /** Display names */
+ DisplayName[] value();
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icon.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icon.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icon.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Description.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Icon
+{
+ /** The small icon */
+ String smallIcon() default "";
+
+ /** The large icon */
+ String largeIcon() default "";
+
+ /** The language */
+ String language() default Description.DEFAULT_LANGUAGE;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icons.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icons.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/annotation/Icons.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Icons.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Icons
+{
+ /** Icons */
+ Icon[] value();
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,140 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import org.jboss.javaee.metadata.spec.ResourceInjectionTargetMetaData;
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptions;
+
+/**
+ * AnnotationMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="annotationType")
+public class AnnotationMetaData extends NamedMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8547813151720473321L;
+
+ /** The impl class */
+ private String annotationImplementationClass;
+
+ /** The resource injection target */
+ private ResourceInjectionTargetMetaData injectionTarget;
+
+ /** The annotation properties */
+ private AnnotationPropertiesMetaData properties;
+
+ /**
+ * Get the annotationClass.
+ *
+ * @return the annotationClass.
+ */
+ public String getAnnotationClass()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the annotationClass.
+ *
+ * @param annotationClass the annotationClass.
+ * @throws IllegalArgumentException for a null annotationClass
+ */
+ public void setAnnotationClass(String annotationClass)
+ {
+ super.setName(annotationClass);
+ }
+
+ /**
+ * Get the annotationImplementationClass.
+ *
+ * @return the annotationImplementationClass.
+ */
+ public String getAnnotationImplementationClass()
+ {
+ return annotationImplementationClass;
+ }
+
+ /**
+ * Set the annotationImplementationClass.
+ *
+ * @param annotationImplementationClass the annotationImplementationClass.
+ * @throws IllegalArgumentException for a null annotationImplementationClass
+ */
+ public void setAnnotationImplementationClass(String annotationImplementationClass)
+ {
+ if (annotationImplementationClass == null)
+ throw new IllegalArgumentException("Null annotationImplementationClass");
+ this.annotationImplementationClass = annotationImplementationClass;
+ }
+
+ /**
+ * Get the injectionTarget.
+ *
+ * @return the injectionTarget.
+ */
+ public ResourceInjectionTargetMetaData getInjectionTarget()
+ {
+ return injectionTarget;
+ }
+
+ /**
+ * Set the injectionTarget.
+ *
+ * @param injectionTarget the injectionTarget.
+ * @throws IllegalArgumentException for a null injectionTarget
+ */
+ public void setInjectionTarget(ResourceInjectionTargetMetaData injectionTarget)
+ {
+ if (injectionTarget == null)
+ throw new IllegalArgumentException("Null injectionTarget");
+ this.injectionTarget = injectionTarget;
+ }
+
+ /**
+ * Get the properties.
+ *
+ * @return the properties.
+ */
+ public AnnotationPropertiesMetaData getProperties()
+ {
+ return properties;
+ }
+
+ /**
+ * Set the properties.
+ *
+ * @param properties the properties.
+ * @throws IllegalArgumentException for a null properties
+ */
+ @XmlElement(name="property")
+ public void setProperties(AnnotationPropertiesMetaData properties)
+ {
+ if (properties == null)
+ throw new IllegalArgumentException("Null properties");
+ this.properties = properties;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertiesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertiesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertiesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * AnnotationPropertiessMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationPropertiesMetaData extends AbstractMappedMetaData<AnnotationPropertyMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4702786005600598202L;
+
+ /**
+ * Create a new AnnotationPropertiesMetaData.
+ */
+ public AnnotationPropertiesMetaData()
+ {
+ super("property name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertyMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertyMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationPropertyMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,85 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import javax.xml.bind.annotation.XmlType;
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptions;
+
+/**
+ * AnnotationPropertyMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="annotation-propertyType")
+public class AnnotationPropertyMetaData extends NamedMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8547813151720473321L;
+
+ /** The property value */
+ private String propertyValue;
+
+ /**
+ * Get the propertyName.
+ *
+ * @return the propertyName.
+ */
+ public String getPropertyName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the propertyName.
+ *
+ * @param propertyName the propertyName.
+ * @throws IllegalArgumentException for a null propertyName
+ */
+ public void setPropertyName(String propertyName)
+ {
+ setName(propertyName);
+ }
+
+ /**
+ * Get the propertyValue.
+ *
+ * @return the propertyValue.
+ */
+ public String getPropertyValue()
+ {
+ return propertyValue;
+ }
+
+ /**
+ * Set the propertyValue.
+ *
+ * @param propertyValue the propertyValue.
+ * @throws IllegalArgumentException for a null propertyValue
+ */
+ public void setPropertyValue(String propertyValue)
+ {
+ if (propertyValue == null)
+ throw new IllegalArgumentException("Null propertyValue");
+ this.propertyValue = propertyValue;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/AnnotationsMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * AnnotationsMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationsMetaData extends AbstractMappedMetaData<AnnotationMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4702786005600598202L;
+
+ /**
+ * Create a new AnnotationsMetaData.
+ */
+ public AnnotationsMetaData()
+ {
+ super("annotation class");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/IgnoreDependencyMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/IgnoreDependencyMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/IgnoreDependencyMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.spec.ResourceInjectionTargetMetaData;
+import org.jboss.javaee.metadata.support.IdMetaDataImplWithDescriptions;
+import org.jboss.javaee.metadata.support.NonNullLinkedHashSet;
+
+/**
+ * IgnoreDependencyMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="ignore-dependencyType")
+public class IgnoreDependencyMetaData extends IdMetaDataImplWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 68493962316154817L;
+
+ /** The injection targets */
+ private Set<ResourceInjectionTargetMetaData> injectionTargets;
+
+ /**
+ * Get the injectionTargets.
+ *
+ * @return the injectionTargets.
+ */
+ public Set<ResourceInjectionTargetMetaData> getInjectionTargets()
+ {
+ return injectionTargets;
+ }
+
+ /**
+ * Set the injectionTargets.
+ *
+ * @param injectionTargets the injectionTargets.
+ * @throws IllegalArgumentException for a null injectionTargets
+ */
+ @XmlElement(name="injection-target", type=NonNullLinkedHashSet.class)
+ public void setInjectionTargets(Set<ResourceInjectionTargetMetaData> injectionTargets)
+ {
+ if (injectionTargets == null)
+ throw new IllegalArgumentException("Null injectionTargets");
+ this.injectionTargets = injectionTargets;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * JndiRefMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="jndi-refType")
+public class JndiRefMetaData extends ResourceInjectionMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6572104852686049731L;
+
+ /**
+ * Get the jndiRefName.
+ *
+ * @return the jndiRefName.
+ */
+ public String getJndiRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the jndiRefName.
+ *
+ * @param jndiRefName the jndiRefName.
+ * @throws IllegalArgumentException for a null jndiRefName
+ */
+ public void setJndiRefName(String jndiRefName)
+ {
+ setName(jndiRefName);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/jboss/JndiRefsMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.jboss;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * JndiRefsMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JndiRefsMetaData extends AbstractMappedMetaData<JndiRefMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7447964711034672079L;
+
+ /**
+ * Create a new JndiRefsMetaData.
+ */
+ public JndiRefsMetaData()
+ {
+ super("jndi ref name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/AbstractEJBReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/AbstractEJBReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/AbstractEJBReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,152 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * AbstractEJBReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractEJBReferenceMetaData extends ResourceInjectionMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6067128692691909155L;
+
+ /** The type */
+ private EJBReferenceType type;
+
+ /** The link */
+ private String link;
+
+ /**
+ * Create a new EJBReferenceMetaData.
+ */
+ public AbstractEJBReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the ejbRefName.
+ *
+ * @return the ejbRefName.
+ */
+ public String getEjbRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the ejbRefName.
+ *
+ * @param ejbRefName the ejbRefName.
+ * @throws IllegalArgumentException for a null ejbRefName
+ */
+ public void setEjbRefName(String ejbRefName)
+ {
+ setName(ejbRefName);
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public EJBReferenceType getEjbRefType()
+ {
+ return type;
+ }
+
+ /**
+ * Set the type.
+ *
+ * @param type the type.
+ * @throws IllegalArgumentException for a null type
+ */
+ @XmlElement(name="ejb-ref-type")
+ public void setEjbRefType(EJBReferenceType type)
+ {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ this.type = type;
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ if (type == null)
+ throw new IllegalStateException("Type has not been set: " + this);
+ return type.name();
+ }
+
+ /**
+ * Get the link.
+ *
+ * @return the link.
+ */
+ public String getLink()
+ {
+ return link;
+ }
+
+ /**
+ * Set the link.
+ *
+ * @param link the link.
+ * @throws IllegalArgumentException for a null link
+ */
+ @XmlElement(name="ejb-link")
+ public void setLink(String link)
+ {
+ if (link == null)
+ throw new IllegalArgumentException("Null link");
+ this.link = link;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(AbstractEJBReferenceMetaData merged, AbstractEJBReferenceMetaData original)
+ {
+ super.merge(merged, original);
+ if (type != null)
+ merged.setEjbRefType(type);
+ else if (original.type != null)
+ merged.setEjbRefType(original.type);
+ if (link != null)
+ merged.setLink(link);
+ else if (original.link != null)
+ merged.setLink(original.link);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionGroupMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionGroupMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionGroupMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,135 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.annotation.DisplayNames;
+import org.jboss.javaee.annotation.Icons;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+
+/**
+ * DescriptionGroupMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@JBossXmlGroup(name="descriptionGroup")
+ at JBossXmlModelGroup(name="descriptionGroup")
+public class DescriptionGroupMetaData implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1337095770028220349L;
+
+ /** The descriptions */
+ private Descriptions descriptions;
+
+ /** The display names */
+ private DisplayNames displayNames;
+
+ /** The icons */
+ private Icons icons;
+
+ /**
+ * Create a new DescriptionGroupMetaData.
+ */
+ public DescriptionGroupMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the descriptions.
+ *
+ * @return the descriptions.
+ */
+ public Descriptions getDescriptions()
+ {
+ return descriptions;
+ }
+
+ /**
+ * Set the descriptions.
+ *
+ * @param descriptions the descriptions.
+ * @throws IllegalArgumentException for a null descriptions
+ */
+ @XmlElement(name="description", type=DescriptionsImpl.class)
+ //@XmlElement(name="description", type=DescriptionImpl.class)
+ public void setDescriptions(Descriptions descriptions)
+ {
+ if (descriptions == null)
+ throw new IllegalArgumentException("Null descriptions");
+ this.descriptions = descriptions;
+ }
+
+ /**
+ * Get the displayNames.
+ *
+ * @return the displayNames.
+ */
+ public DisplayNames getDisplayNames()
+ {
+ return displayNames;
+ }
+
+ /**
+ * Set the displayNames.
+ *
+ * @param displayNames the displayNames.
+ * @throws IllegalArgumentException for a null displayNames
+ */
+ @XmlElement(name="display-name", type=DisplayNamesImpl.class)
+ public void setDisplayNames(DisplayNames displayNames)
+ {
+ if (displayNames == null)
+ throw new IllegalArgumentException("Null displayNames");
+ this.displayNames = displayNames;
+ }
+
+ /**
+ * Get the icons.
+ *
+ * @return the icons.
+ */
+ public Icons getIcons()
+ {
+ return icons;
+ }
+
+ /**
+ * Set the icons.
+ *
+ * @param icons the icons.
+ * @throws IllegalArgumentException for a null icons
+ */
+ @XmlElement(name="icon", type=IconsImpl.class)
+ public void setIcons(Icons icons)
+ {
+ if (icons == null)
+ throw new IllegalArgumentException("Null icons");
+ this.icons = icons;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.metadata.support.LanguageMetaData;
+
+/**
+ * DescriptionImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="descriptionType")
+public class DescriptionImpl extends LanguageMetaData implements Description
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7060589158592181267L;
+
+ /** The description */
+ private String description = "";
+
+ /**
+ * Create a new DescriptionImpl.
+ */
+ public DescriptionImpl()
+ {
+ super(Description.class);
+ }
+
+ public String value()
+ {
+ return getDescription();
+ }
+
+ /**
+ * Get the description.
+ *
+ * @return the description.
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Set the description.
+ *
+ * @param description the description.
+ * @throws IllegalArgumentException for a null description
+ */
+ @XmlValue
+ public void setDescription(String description)
+ {
+ if (description == null)
+ throw new IllegalArgumentException("Null description");
+ this.description = description;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionsImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionsImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DescriptionsImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.metadata.support.MappedAnnotationMetaData;
+
+/**
+ * DescriptionsImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DescriptionsImpl extends MappedAnnotationMetaData<DescriptionImpl> implements Descriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6123936359846681661L;
+
+ /**
+ * Create a new DescriptinsImpl.
+ */
+ public DescriptionsImpl()
+ {
+ super(Descriptions.class);
+ }
+
+ public Description[] value()
+ {
+ Description[] result = new Description[size()];
+ return toArray(result);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNameImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNameImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNameImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import org.jboss.javaee.annotation.DisplayName;
+import org.jboss.javaee.metadata.support.LanguageMetaData;
+
+/**
+ * DisplayNameImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="display-nameType")
+public class DisplayNameImpl extends LanguageMetaData implements DisplayName
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8863089892578047773L;
+
+ /** The display name */
+ private String displayName = "";
+
+ /**
+ * Create a new DisplayNameImpl.
+ */
+ public DisplayNameImpl()
+ {
+ super(DisplayName.class);
+ }
+
+ public String value()
+ {
+ return getDisplayName();
+ }
+
+ /**
+ * Get the displayName.
+ *
+ * @return the displayName.
+ */
+ public String getDisplayName()
+ {
+ return displayName;
+ }
+
+ /**
+ * Set the displayName.
+ *
+ * @param displayName the displayName.
+ * @throws IllegalArgumentException for a null displayName
+ */
+ @XmlValue
+ public void setDisplayName(String displayName)
+ {
+ if (displayName == null)
+ throw new IllegalArgumentException("Null displayName");
+ this.displayName = displayName;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNamesImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNamesImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/DisplayNamesImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.annotation.DisplayName;
+import org.jboss.javaee.annotation.DisplayNames;
+import org.jboss.javaee.metadata.support.MappedAnnotationMetaData;
+
+/**
+ * DisplayNamesImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DisplayNamesImpl extends MappedAnnotationMetaData<DisplayNameImpl> implements DisplayNames
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -9034955836162270653L;
+
+ /**
+ * Create a new DisplayNamesImpl.
+ */
+ public DisplayNamesImpl()
+ {
+ super(DisplayNames.class);
+ }
+
+ public DisplayName[] value()
+ {
+ DisplayName[] result = new DisplayName[size()];
+ return toArray(result);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,125 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+
+/**
+ * EJBLocalReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="ejb-local-refType")
+public class EJBLocalReferenceMetaData extends AbstractEJBReferenceMetaData implements MergeableMappedMetaData<EJBLocalReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5810710557505041609L;
+
+ /** The home type */
+ private String localHome;
+
+ /** The remote type */
+ private String local;
+
+ /**
+ * Create a new EJBLocalReferenceMetaData.
+ */
+ public EJBLocalReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the localHome.
+ *
+ * @return the localHome.
+ */
+ public String getLocalHome()
+ {
+ return localHome;
+ }
+
+ /**
+ * Set the localHome.
+ *
+ * @param localHome the localHome.
+ * @throws IllegalArgumentException for a null localHome
+ */
+ public void setLocalHome(String localHome)
+ {
+ if (localHome == null)
+ throw new IllegalArgumentException("Null localHome");
+ this.localHome = localHome;
+ }
+
+ /**
+ * Get the local.
+ *
+ * @return the local.
+ */
+ public String getLocal()
+ {
+ return local;
+ }
+
+ /**
+ * Set the local.
+ *
+ * @param local the local.
+ * @throws IllegalArgumentException for a null local
+ */
+ public void setLocal(String local)
+ {
+ if (local == null)
+ throw new IllegalArgumentException("Null local");
+ this.local = local;
+ }
+
+ public EJBLocalReferenceMetaData merge(EJBLocalReferenceMetaData original)
+ {
+ EJBLocalReferenceMetaData merged = new EJBLocalReferenceMetaData();
+ merge(merged, original);
+ return merged;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(EJBLocalReferenceMetaData merged, EJBLocalReferenceMetaData original)
+ {
+ super.merge(merged, original);
+ if (localHome != null)
+ merged.setLocalHome(localHome);
+ else if (original.localHome != null)
+ merged.setLocalHome(original.localHome);
+ if (local != null)
+ merged.setLocal(local);
+ else if (original.local != null)
+ merged.setLocal(original.local);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBLocalReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+import org.jboss.javaee.metadata.support.JavaEEMetaDataUtil;
+
+/**
+ * EJBLocalReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EJBLocalReferencesMetaData extends AbstractMappedMetaData<EJBLocalReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7264371854666919529L;
+
+ /**
+ * Merge ejb local references
+ *
+ * @param override the override references
+ * @param overriden the overriden references
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged referencees
+ */
+ public static EJBLocalReferencesMetaData merge(EJBLocalReferencesMetaData override, EJBLocalReferencesMetaData overriden, String overridenFile, String overrideFile)
+ {
+ if (override == null && overriden == null)
+ return null;
+
+ if (override == null)
+ return overriden;
+
+ EJBLocalReferencesMetaData merged = new EJBLocalReferencesMetaData();
+ return JavaEEMetaDataUtil.merge(merged, overriden, override, "ejb-local-ref", overridenFile, overrideFile, true);
+ }
+
+ /**
+ * Create a new EJBLocalReferencesMetaData.
+ */
+ public EJBLocalReferencesMetaData()
+ {
+ super("ejb local ref name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,159 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+
+/**
+ * EJBReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="ejb-refType")
+public class EJBReferenceMetaData extends AbstractEJBReferenceMetaData implements MergeableMappedMetaData<EJBReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3828756360112709340L;
+
+ /** The home type */
+ private String home;
+
+ /** The remote type */
+ private String remote;
+
+ /** The invoker bindings */
+ private Map<String, String> invokerBindings;
+
+ /**
+ * Create a new EJBReferenceMetaData.
+ */
+ public EJBReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the home.
+ *
+ * @return the home.
+ */
+ public String getHome()
+ {
+ return home;
+ }
+
+ /**
+ * Set the home.
+ *
+ * @param home the home.
+ * @throws IllegalArgumentException for a null home
+ */
+ public void setHome(String home)
+ {
+ if (home == null)
+ throw new IllegalArgumentException("Null home");
+ this.home = home;
+ }
+
+ /**
+ * Get the remote.
+ *
+ * @return the remote.
+ */
+ public String getRemote()
+ {
+ return remote;
+ }
+
+ /**
+ * Set the remote.
+ *
+ * @param remote the remote.
+ * @throws IllegalArgumentException for a null remote
+ */
+ public void setRemote(String remote)
+ {
+ if (remote == null)
+ throw new IllegalArgumentException("Null remote");
+ this.remote = remote;
+ }
+
+ /**
+ * Get an invoker proxy binding name
+ *
+ * @param invokerProxyBindingName
+ * @return the jndi name override
+ */
+ @Deprecated // This is in the wrong place
+ public String getInvokerBinding(String invokerProxyBindingName)
+ {
+ if (invokerBindings == null)
+ return null;
+ return invokerBindings.get(invokerProxyBindingName);
+ }
+
+ /**
+ * Add an invoker binding
+ *
+ * @param invokerProxyBindingName the invoker proxy binding name
+ * @param jndiName the jndi name
+ */
+ @Deprecated // This is in the wrong place
+ public void addInvokerBinding(String invokerProxyBindingName, String jndiName)
+ {
+ if (invokerBindings == null)
+ invokerBindings = new HashMap<String, String>();
+ invokerBindings.put(invokerProxyBindingName, jndiName);
+ }
+
+ public EJBReferenceMetaData merge(EJBReferenceMetaData original)
+ {
+ EJBReferenceMetaData merged = new EJBReferenceMetaData();
+ merge(merged, original);
+ return merged;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(EJBReferenceMetaData merged, EJBReferenceMetaData original)
+ {
+ super.merge(merged, original);
+ if (home != null)
+ merged.setHome(home);
+ else if (original.home != null)
+ merged.setHome(original.home);
+ if (remote != null)
+ merged.setRemote(remote);
+ else if (original.remote != null)
+ merged.setRemote(original.remote);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceType.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceType.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferenceType.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * EjbReferenceType.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="ejb-ref-typeType")
+public enum EJBReferenceType
+{
+ /** Session */
+ Session,
+
+ /** Entity */
+ Entity,
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EJBReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+import org.jboss.javaee.metadata.support.JavaEEMetaDataUtil;
+
+/**
+ * EJBReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EJBReferencesMetaData extends AbstractMappedMetaData<EJBReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 605087131047162516L;
+
+ /**
+ * Merge ejb references
+ *
+ * @param override the override references
+ * @param overriden the overriden references
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged referencees
+ */
+ public static EJBReferencesMetaData merge(EJBReferencesMetaData override, EJBReferencesMetaData overriden, String overridenFile, String overrideFile)
+ {
+ if (override == null && overriden == null)
+ return null;
+
+ if (override == null)
+ return overriden;
+
+ EJBReferencesMetaData merged = new EJBReferencesMetaData();
+ return JavaEEMetaDataUtil.merge(merged, overriden, override, "ejb-ref", overridenFile, overrideFile, true);
+ }
+
+ /**
+ * Create a new EJBReferencesMetaData.
+ */
+ public EJBReferencesMetaData()
+ {
+ super("ejb ref name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EmptyMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EmptyMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EmptyMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.IdMetaDataImpl;
+
+/**
+ * EmptyMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="emptyType")
+public class EmptyMetaData extends IdMetaDataImpl
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 3489739218069240805L;
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/Environment.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/Environment.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/Environment.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.javaee.metadata.spec;
+
+/**
+ * Environment.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface Environment
+{
+ /**
+ * Get the environmentEntries.
+ *
+ * @return the environmentEntries.
+ */
+ EnvironmentEntriesMetaData getEnvironmentEntries();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ EnvironmentEntryMetaData getEnvironmentEntryByName(String name);
+
+ /**
+ * Get the ejbLocalReferences.
+ *
+ * @return the ejbLocalReferences.
+ */
+ EJBLocalReferencesMetaData getEjbLocalReferences();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name);
+
+ /**
+ * Get the ejbReferences.
+ *
+ * @return the ejbReferences.
+ */
+ EJBReferencesMetaData getEjbReferences();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ EJBReferenceMetaData getEjbReferenceByName(String name);
+
+ /**
+ * Get the resourceReferences.
+ *
+ * @return the resourceReferences.
+ */
+ ResourceReferencesMetaData getResourceReferences();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ ResourceReferenceMetaData getResourceReferenceByName(String name);
+
+ /**
+ * Get the resourceEnvironmentReferences.
+ *
+ * @return the resourceEnvironmentReferences.
+ */
+ ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name);
+
+ /**
+ * Get the messageDestinationReferences.
+ *
+ * @return the messageDestinationReferences.
+ */
+ MessageDestinationReferencesMetaData getMessageDestinationReferences();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name);
+
+ /**
+ * Get the postConstructs.
+ *
+ * @return the postConstructs.
+ */
+ LifecycleCallbacksMetaData getPostConstructs();
+
+ /**
+ * Get the preDestroys.
+ *
+ * @return the preDestroys.
+ */
+ LifecycleCallbacksMetaData getPreDestroys();
+
+ /**
+ * Get the persistenceContextRefs.
+ *
+ * @return the persistenceContextRefs.
+ */
+ PersistenceContextReferencesMetaData getPersistenceContextRefs();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name);
+
+ /**
+ * Get the persistenceUnitRefs.
+ *
+ * @return the persistenceUnitRefs.
+ */
+ PersistenceUnitReferencesMetaData getPersistenceUnitRefs();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name);
+
+ /**
+ * Get the serviceReferences.
+ *
+ * @return the serviceReferences.
+ */
+ ServiceReferencesMetaData getServiceReferences();
+
+ /**
+ * Get by name
+ *
+ * @param name the name
+ * @return the result or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ ServiceReferenceMetaData getServiceReferenceByName(String name);
+}
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntriesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntriesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntriesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * EnvironmentEntriesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class EnvironmentEntriesMetaData extends AbstractMappedMetaData<EnvironmentEntryMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7573363440492577599L;
+
+ /**
+ * Create a new EnvironmentEntriesMetaData.
+ */
+ public EnvironmentEntriesMetaData()
+ {
+ super("env entry name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntryMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntryMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentEntryMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,124 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * EnvironmentEntryMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="env-entryType")
+public class EnvironmentEntryMetaData extends ResourceInjectionMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -4919146521508624575L;
+
+ /** The type */
+ private String type;
+
+ /** The value */
+ private String value;
+
+ /**
+ * Create a new EnvironmentEntryMetaData.
+ */
+ public EnvironmentEntryMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the envEntryName.
+ *
+ * @return the envEntryName.
+ */
+ public String getEnvEntryName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the envEntryName.
+ *
+ * @param envEntryName the envEntryName.
+ * @throws IllegalArgumentException for a null envEntryName
+ */
+ public void setEnvEntryName(String envEntryName)
+ {
+ setName(envEntryName);
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * Set the type.
+ *
+ * @param type the type.
+ * @throws IllegalArgumentException for a null type
+ */
+ @XmlElement(name="env-entry-type")
+ public void setType(String type)
+ {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ this.type = type;
+ }
+
+ /**
+ * Get the value.
+ *
+ * @return the value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Set the value.
+ *
+ * @param value the value.
+ * @throws IllegalArgumentException for a null value
+ */
+ @XmlElement(name="env-entry-value")
+ //@SchemaValue(false)
+ public void setValue(String value)
+ {
+ if (value == null)
+ throw new IllegalArgumentException("Null value");
+ this.value = value;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentRefsGroupMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentRefsGroupMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/EnvironmentRefsGroupMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,393 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+//import org.jboss.xb.binding.annotations.SchemaGroup;
+
+/**
+ * EnvironmentRefsGroupMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaGroup(name="jndiEnvironmentRefsGroup")
+public class EnvironmentRefsGroupMetaData implements Serializable, Environment
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1337095770028220349L;
+
+ /** The environment entries */
+ private EnvironmentEntriesMetaData environmentEntries;
+
+ /** The ejb references */
+ private EJBReferencesMetaData ejbReferences;
+
+ /** The ejb local references */
+ private EJBLocalReferencesMetaData ejbLocalReferences;
+
+ /** The service references */
+ private ServiceReferencesMetaData serviceReferences;
+
+ /** The resource references */
+ private ResourceReferencesMetaData resourceReferences;
+
+ /** The resource environment references */
+ private ResourceEnvironmentReferencesMetaData resourceEnvironmentReferences;
+
+ /** The message destination references */
+ private MessageDestinationReferencesMetaData messageDestinationReferences;
+
+ /** The persistence context reference */
+ private PersistenceContextReferencesMetaData persistenceContextRefs;
+
+ /** The persistence unit reference */
+ private PersistenceUnitReferencesMetaData persistenceUnitRefs;
+
+ /** The post construct methods */
+ private LifecycleCallbacksMetaData postConstructs;
+
+ /** The pre destroy methods */
+ private LifecycleCallbacksMetaData preDestroys;
+
+ /**
+ * Create a new EnvironmentRefsGroupMetaData.
+ */
+ public EnvironmentRefsGroupMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the environmentEntries.
+ *
+ * @return the environmentEntries.
+ */
+ public EnvironmentEntriesMetaData getEnvironmentEntries()
+ {
+ return environmentEntries;
+ }
+
+ /**
+ * Set the environmentEntries.
+ *
+ * @param environmentEntries the environmentEntries.
+ * @throws IllegalArgumentException for a null environmentEntries
+ */
+ @XmlElement(name="env-entry")
+ public void setEnvironmentEntries(EnvironmentEntriesMetaData environmentEntries)
+ {
+ if (environmentEntries == null)
+ throw new IllegalArgumentException("Null environmentEntries");
+ this.environmentEntries = environmentEntries;
+ }
+
+ /**
+ * Get the ejbLocalReferences.
+ *
+ * @return the ejbLocalReferences.
+ */
+ public EJBLocalReferencesMetaData getEjbLocalReferences()
+ {
+ return ejbLocalReferences;
+ }
+
+ /**
+ * Set the ejbLocalReferences.
+ *
+ * @param ejbLocalReferences the ejbLocalReferences.
+ * @throws IllegalArgumentException for a null ejbLocalReferences
+ */
+ @XmlElement(name="ejb-local-ref")
+ public void setEjbLocalReferences(EJBLocalReferencesMetaData ejbLocalReferences)
+ {
+ if (ejbLocalReferences == null)
+ throw new IllegalArgumentException("Null ejbLocalReferences");
+ this.ejbLocalReferences = ejbLocalReferences;
+ }
+
+ /**
+ * Get the ejbReferences.
+ *
+ * @return the ejbReferences.
+ */
+ public EJBReferencesMetaData getEjbReferences()
+ {
+ return ejbReferences;
+ }
+
+ /**
+ * Set the ejbReferences.
+ *
+ * @param ejbReferences the ejbReferences.
+ * @throws IllegalArgumentException for a null ejbReferences
+ */
+ @XmlElement(name="ejb-ref")
+ public void setEjbReferences(EJBReferencesMetaData ejbReferences)
+ {
+ if (ejbReferences == null)
+ throw new IllegalArgumentException("Null ejbReferences");
+ this.ejbReferences = ejbReferences;
+ }
+
+ /**
+ * Get the resourceReferences.
+ *
+ * @return the resourceReferences.
+ */
+ public ResourceReferencesMetaData getResourceReferences()
+ {
+ return resourceReferences;
+ }
+
+ /**
+ * Set the resourceReferences.
+ *
+ * @param resourceReferences the resourceReferences.
+ * @throws IllegalArgumentException for a null resourceReferences
+ */
+ @XmlElement(name="resource-ref")
+ public void setResourceReferences(ResourceReferencesMetaData resourceReferences)
+ {
+ if (resourceReferences == null)
+ throw new IllegalArgumentException("Null resourceReferences");
+ this.resourceReferences = resourceReferences;
+ }
+
+ /**
+ * Get the resourceEnvironmentReferences.
+ *
+ * @return the resourceEnvironmentReferences.
+ */
+ public ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences()
+ {
+ return resourceEnvironmentReferences;
+ }
+
+ /**
+ * Set the resourceEnvironmentReferences.
+ *
+ * @param resourceEnvironmentReferences the resourceEnvironmentReferences.
+ * @throws IllegalArgumentException for a null resourceEnvironmentReferences
+ */
+ @XmlElement(name="resource-env-ref")
+ public void setResourceEnvironmentReferences(ResourceEnvironmentReferencesMetaData resourceEnvironmentReferences)
+ {
+ if (resourceEnvironmentReferences == null)
+ throw new IllegalArgumentException("Null resourceEnvironmentReferences");
+ this.resourceEnvironmentReferences = resourceEnvironmentReferences;
+ }
+
+ /**
+ * Get the messageDestinationReferences.
+ *
+ * @return the messageDestinationReferences.
+ */
+ public MessageDestinationReferencesMetaData getMessageDestinationReferences()
+ {
+ return messageDestinationReferences;
+ }
+
+ /**
+ * Set the messageDestinationReferences.
+ *
+ * @param messageDestinationReferences the messageDestinationReferences.
+ * @throws IllegalArgumentException for a null messageDestinationReferences
+ */
+ @XmlElement(name="message-destination-ref")
+ public void setMessageDestinationReferences(MessageDestinationReferencesMetaData messageDestinationReferences)
+ {
+ if (messageDestinationReferences == null)
+ throw new IllegalArgumentException("Null messageDestinationReferences");
+ this.messageDestinationReferences = messageDestinationReferences;
+ }
+
+ /**
+ * Get the postConstructs.
+ *
+ * @return the postConstructs.
+ */
+ public LifecycleCallbacksMetaData getPostConstructs()
+ {
+ return postConstructs;
+ }
+
+ /**
+ * Set the postConstructs.
+ *
+ * @param postConstructs the postConstructs.
+ * @throws IllegalArgumentException for a null postConstructs
+ */
+ //@SchemaProperty(name="post-construct", noInterceptor=true)
+ @XmlElement(name="post-construct")
+ public void setPostConstructs(LifecycleCallbacksMetaData postConstructs)
+ {
+ if (postConstructs == null)
+ throw new IllegalArgumentException("Null postConstructs");
+ this.postConstructs = postConstructs;
+ }
+
+ /**
+ * Get the preDestroys.
+ *
+ * @return the preDestroys.
+ */
+ public LifecycleCallbacksMetaData getPreDestroys()
+ {
+ return preDestroys;
+ }
+
+ /**
+ * Set the preDestroys.
+ *
+ * @param preDestroys the preDestroys.
+ * @throws IllegalArgumentException for a null preDestroys
+ */
+ //@SchemaProperty(name="pre-destroy", noInterceptor=true)
+ @XmlElement(name="pre-destroy")
+ public void setPreDestroys(LifecycleCallbacksMetaData preDestroys)
+ {
+ if (preDestroys == null)
+ throw new IllegalArgumentException("Null preDestroys");
+ this.preDestroys = preDestroys;
+ }
+
+ /**
+ * Get the persistenceContextRefs.
+ *
+ * @return the persistenceContextRefs.
+ */
+ public PersistenceContextReferencesMetaData getPersistenceContextRefs()
+ {
+ return persistenceContextRefs;
+ }
+
+ /**
+ * Set the persistenceContextRefs.
+ *
+ * @param persistenceContextRefs the persistenceContextRefs.
+ * @throws IllegalArgumentException for a null persistenceContextRefs
+ */
+ @XmlElement(name="persistence-context-ref")
+ public void setPersistenceContextRefs(PersistenceContextReferencesMetaData persistenceContextRefs)
+ {
+ if (persistenceContextRefs == null)
+ throw new IllegalArgumentException("Null persistenceContextRefs");
+ this.persistenceContextRefs = persistenceContextRefs;
+ }
+
+ /**
+ * Get the persistenceUnitRefs.
+ *
+ * @return the persistenceUnitRefs.
+ */
+ public PersistenceUnitReferencesMetaData getPersistenceUnitRefs()
+ {
+ return persistenceUnitRefs;
+ }
+
+ /**
+ * Set the persistenceUnitRefs.
+ *
+ * @param persistenceUnitRefs the persistenceUnitRefs.
+ * @throws IllegalArgumentException for a null persistenceUnitRefs
+ */
+ @XmlElement(name="persistence-unit-ref")
+ public void setPersistenceUnitRefs(PersistenceUnitReferencesMetaData persistenceUnitRefs)
+ {
+ if (persistenceUnitRefs == null)
+ throw new IllegalArgumentException("Null persistenceUnitRefs");
+ this.persistenceUnitRefs = persistenceUnitRefs;
+ }
+
+ /**
+ * Get the serviceReferences.
+ *
+ * @return the serviceReferences.
+ */
+ public ServiceReferencesMetaData getServiceReferences()
+ {
+ return serviceReferences;
+ }
+
+ /**
+ * Set the serviceReferences.
+ *
+ * @param serviceReferences the serviceReferences.
+ * @throws IllegalArgumentException for a null serviceReferences
+ */
+ public void setServiceReferences(ServiceReferencesMetaData serviceReferences)
+ {
+ if (serviceReferences == null)
+ throw new IllegalArgumentException("Null serviceReferences");
+ this.serviceReferences = serviceReferences;
+ }
+
+ public EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, ejbLocalReferences);
+ }
+
+ public EJBReferenceMetaData getEjbReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, ejbReferences);
+ }
+
+ public EnvironmentEntryMetaData getEnvironmentEntryByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, environmentEntries);
+ }
+
+ public MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, messageDestinationReferences);
+ }
+
+ public PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, persistenceContextRefs);
+ }
+
+ public PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, persistenceUnitRefs);
+ }
+
+ public ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, resourceEnvironmentReferences);
+ }
+
+ public ResourceReferenceMetaData getResourceReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, resourceReferences);
+ }
+
+ public ServiceReferenceMetaData getServiceReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, serviceReferences);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,110 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.annotation.Icon;
+import org.jboss.javaee.metadata.support.LanguageMetaData;
+
+/**
+ * IconImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="iconType")
+public class IconImpl extends LanguageMetaData implements Icon
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8544489136833248714L;
+
+ /** The small icon */
+ private String smallIcon = "";
+
+ /** The large icon */
+ private String largeIcon = "";
+
+ /**
+ * Create a new IconImpl.
+ */
+ public IconImpl()
+ {
+ super(Icon.class);
+ }
+
+ public String largeIcon()
+ {
+ return getLargeIcon();
+ }
+
+ public String smallIcon()
+ {
+ return getSmallIcon();
+ }
+
+ /**
+ * Get the largeIcon.
+ *
+ * @return the largeIcon.
+ */
+ public String getLargeIcon()
+ {
+ return largeIcon;
+ }
+
+ /**
+ * Set the largeIcon.
+ *
+ * @param largeIcon the largeIcon.
+ * @throws IllegalArgumentException for a null largeIcon
+ */
+ public void setLargeIcon(String largeIcon)
+ {
+ if (largeIcon == null)
+ throw new IllegalArgumentException("Null largeIcon");
+ this.largeIcon = largeIcon;
+ }
+
+ /**
+ * Get the smallIcon.
+ *
+ * @return the smallIcon.
+ */
+ public String getSmallIcon()
+ {
+ return smallIcon;
+ }
+
+ /**
+ * Set the smallIcon.
+ *
+ * @param smallIcon the smallIcon.
+ * @throws IllegalArgumentException for a null smallIcon
+ */
+ public void setSmallIcon(String smallIcon)
+ {
+ if (smallIcon == null)
+ throw new IllegalArgumentException("Null smallIcon");
+ this.smallIcon = smallIcon;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconsImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconsImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/IconsImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.annotation.Icon;
+import org.jboss.javaee.annotation.Icons;
+import org.jboss.javaee.metadata.support.MappedAnnotationMetaData;
+
+/**
+ * IconsImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IconsImpl extends MappedAnnotationMetaData<IconImpl> implements Icons
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8468719625804849630L;
+
+ /**
+ * Create a new IconsImpl.
+ */
+ public IconsImpl()
+ {
+ super(Icons.class);
+ }
+
+ public Icon[] value()
+ {
+ Icon[] result = new Icon[size()];
+ return toArray(result);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/JavaEEMetaDataConstants.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/JavaEEMetaDataConstants.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/JavaEEMetaDataConstants.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+/**
+ * Constants.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JavaEEMetaDataConstants
+{
+ /** The javaee namespace */
+ String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee";
+
+ /** The j2ee namespace */
+ String J2EE_NS = "http://java.sun.com/xml/ns/j2ee";
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbackMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbackMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbackMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * LifecycleCallbackMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="lifecycle-callbackType", mandatory=false)
+ at XmlType(name="lifecycle-callbackType")
+public class LifecycleCallbackMetaData implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6453746684927606565L;
+
+ /** The class */
+ private String className;
+
+ /** The method name */
+ private String methodName;
+
+ /**
+ * Create a new LifecycleCallbackMetaData.
+ */
+ public LifecycleCallbackMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the className.
+ *
+ * @return the className.
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Set the className.
+ *
+ * @param className the className.
+ * @throws IllegalArgumentException for a null className
+ */
+ @XmlElement(name="lifecycle-callback-class")
+ public void setClassName(String className)
+ {
+ if (className == null)
+ throw new IllegalArgumentException("Null className");
+ this.className = className;
+ }
+
+ /**
+ * Get the methodName.
+ *
+ * @return the methodName.
+ */
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+ /**
+ * Set the methodName.
+ *
+ * @param methodName the methodName.
+ * @throws IllegalArgumentException for a null methodName
+ */
+ @XmlElement(name="lifecycle-callback-method")
+ public void setMethodName(String methodName)
+ {
+ if (methodName == null)
+ throw new IllegalArgumentException("Null methodName");
+ this.methodName = methodName;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbacksMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbacksMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/LifecycleCallbacksMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.NonNullLinkedHashSet;
+
+/**
+ * LifecycleCallbacksMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class LifecycleCallbacksMetaData extends NonNullLinkedHashSet<LifecycleCallbackMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3843612778667898679L;
+
+ /**
+ * Create a new LifecycleCallbacksMetaData.
+ */
+ public LifecycleCallbacksMetaData()
+ {
+ // For serialization
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,143 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptionGroup;
+
+/**
+ * MessageDestinationMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="message-destinationType")
+public class MessageDestinationMetaData extends NamedMetaDataWithDescriptionGroup implements MergeableMappedMetaData<MessageDestinationMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 2129990191983873784L;
+
+ /** The mapped name */
+ private String mappedName;
+
+ /**
+ * Create a new MessageDestinationMetaData.
+ */
+ public MessageDestinationMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the messageDestinationName.
+ *
+ * @return the messageDestinationName.
+ */
+ public String getMessageDestinationName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the messageDestinationName.
+ *
+ * @param messageDestinationName the messageDestinationName.
+ * @throws IllegalArgumentException for a null messageDestinationName
+ */
+ public void setMessageDestinationName(String messageDestinationName)
+ {
+ setName(messageDestinationName);
+ }
+
+ /**
+ * Get the mappedName.
+ *
+ * @return the mappedName.
+ */
+ public String getMappedName()
+ {
+ return mappedName;
+ }
+
+ /**
+ * Set the mappedName.
+ *
+ * @param mappedName the mappedName.
+ * @throws IllegalArgumentException for a null mappedName
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setMappedName(String mappedName)
+ {
+ if (mappedName == null)
+ throw new IllegalArgumentException("Null mappedName");
+ this.mappedName = mappedName;
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getMappedName();
+ }
+
+ /**
+ * Set the jndiName.
+ *
+ * @param jndiName the jndiName.
+ * @throws IllegalArgumentException for a null jndiName
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setJndiName(String jndiName)
+ {
+ setMappedName(jndiName);
+ }
+
+ public MessageDestinationMetaData merge(MessageDestinationMetaData original)
+ {
+ MessageDestinationMetaData merged = new MessageDestinationMetaData();
+ merge(merged, original);
+ return merged;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(MessageDestinationMetaData merged, MessageDestinationMetaData original)
+ {
+ super.merge(merged, original);
+ if (mappedName != null)
+ merged.setMappedName(mappedName);
+ else if (original.mappedName != null)
+ merged.setMappedName(original.mappedName);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,181 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * MessageDestinationReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="message-destination-refType")
+public class MessageDestinationReferenceMetaData extends ResourceInjectionMetaDataWithDescriptions implements MergeableMappedMetaData<MessageDestinationReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 2129990191983873784L;
+
+ /** The type */
+ private String type;
+
+ /** The usage */
+ private MessageDestinationUsageType usage;
+
+ /** The link */
+ private String link;
+
+ /**
+ * Create a new MessageDestinationReferenceMetaData.
+ */
+ public MessageDestinationReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the messageDestinationRefName.
+ *
+ * @return the messageDestinationRefName.
+ */
+ public String getMessageDestinationRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the messageDestinationRefName.
+ *
+ * @param messageDestinationRefName the messageDestinationRefName.
+ * @throws IllegalArgumentException for a null messageDestinationRefName
+ */
+ public void setMessageDestinationRefName(String messageDestinationRefName)
+ {
+ setName(messageDestinationRefName);
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * Set the type.
+ *
+ * @param type the type.
+ * @throws IllegalArgumentException for a null type
+ */
+ @XmlElement(name="message-destination-type")
+ public void setType(String type)
+ {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ this.type = type;
+ }
+
+ /**
+ * Get the usage.
+ *
+ * @return the usage.
+ */
+ public MessageDestinationUsageType getMessageDestinationUsage()
+ {
+ return usage;
+ }
+
+ /**
+ * Set the usage.
+ *
+ * @param usage the usage.
+ * @throws IllegalArgumentException for a null usage
+ */
+ @XmlElement(name="message-destination-usage")
+ public void setMessageDestinationUsage(MessageDestinationUsageType usage)
+ {
+ if (usage == null)
+ throw new IllegalArgumentException("Null usage");
+ this.usage = usage;
+ }
+
+ /**
+ * Get the link.
+ *
+ * @return the link.
+ */
+ public String getLink()
+ {
+ return link;
+ }
+
+ /**
+ * Set the link.
+ *
+ * @param link the link.
+ * @throws IllegalArgumentException for a null link
+ */
+ @XmlElement(name="message-destination-link")
+ public void setLink(String link)
+ {
+ if (link == null)
+ throw new IllegalArgumentException("Null link");
+ this.link = link;
+ }
+
+ public MessageDestinationReferenceMetaData merge(MessageDestinationReferenceMetaData original)
+ {
+ MessageDestinationReferenceMetaData merged = new MessageDestinationReferenceMetaData();
+ merge(merged, original);
+ return merged;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(MessageDestinationReferenceMetaData merged, MessageDestinationReferenceMetaData original)
+ {
+ super.merge(merged, original);
+ if (type != null)
+ merged.setType(type);
+ else if (original.type != null)
+ merged.setType(original.type);
+ if (usage != null)
+ merged.setMessageDestinationUsage(usage);
+ else if (original.usage != null)
+ merged.setMessageDestinationUsage(original.usage);
+ if (link != null)
+ merged.setLink(link);
+ else if (original.link != null)
+ merged.setLink(original.link);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+import org.jboss.javaee.metadata.support.JavaEEMetaDataUtil;
+
+/**
+ * MessageDestinationReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class MessageDestinationReferencesMetaData extends AbstractMappedMetaData<MessageDestinationReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5571423286458126147L;
+
+ /**
+ * Merge message destination references
+ *
+ * @param override the override references
+ * @param overriden the overriden references
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged referencees
+ */
+ public static MessageDestinationReferencesMetaData merge(MessageDestinationReferencesMetaData override, MessageDestinationReferencesMetaData overriden, String overridenFile, String overrideFile)
+ {
+ if (override == null && overriden == null)
+ return null;
+
+ if (override == null)
+ return overriden;
+
+ MessageDestinationReferencesMetaData merged = new MessageDestinationReferencesMetaData();
+ return JavaEEMetaDataUtil.merge(merged, overriden, override, "message-destination-ref", overridenFile, overrideFile, true);
+ }
+
+ /**
+ * Create a new MessageDestinationReferencesMetaData.
+ */
+ public MessageDestinationReferencesMetaData()
+ {
+ super("message destination ref name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationUsageType.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationUsageType.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationUsageType.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * MessageDestinationUsageType.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="message-destination-usageType")
+public enum MessageDestinationUsageType
+{
+ /** Consumes */
+ Consumes,
+
+ /** Produces */
+ Produces,
+
+ /** Consumes and Produces */
+ ConsumesProduces,
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/MessageDestinationsMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * MessageDestinationsMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class MessageDestinationsMetaData extends AbstractMappedMetaData<MessageDestinationMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -6198704374773701253L;
+
+ /**
+ * Create a new MessageDestinationsMetaData.
+ */
+ public MessageDestinationsMetaData()
+ {
+ super("message destination name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,149 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * PersistenceContextReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="persistence-context-refType", mandatory=false)
+ at XmlType(name="persistence-context-refType")
+public class PersistenceContextReferenceMetaData extends ResourceInjectionMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 994249685587171979L;
+
+ /** The persistence unit name */
+ private String persistenceUnitName;
+
+ /** The persistence context type */
+ private PersistenceContextType persistenceContextType;
+
+ /** The properties */
+ private PropertiesMetaData properties;
+
+ /**
+ * Create a new PersistenceUnitReferenceMetaData.
+ */
+ public PersistenceContextReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the persistenceContextRefName.
+ *
+ * @return the persistenceContextRefName.
+ */
+ public String getPersistenceContextRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the persistenceContextRefName.
+ *
+ * @param persistenceContextRefName the persistenceContextRefName.
+ * @throws IllegalArgumentException for a null persistenceUnitRefName
+ */
+ public void setPersistenceContextRefName(String persistenceContextRefName)
+ {
+ setName(persistenceContextRefName);
+ }
+
+ /**
+ * Get the persistenceUnitName.
+ *
+ * @return the persistenceUnitName.
+ */
+ public String getPersistenceUnitName()
+ {
+ return persistenceUnitName;
+ }
+
+ /**
+ * Set the persistenceUnitName.
+ *
+ * @param persistenceUnitName the persistenceUnitName.
+ * @throws IllegalArgumentException for a null persistenceUnitName
+ */
+ public void setPersistenceUnitName(String persistenceUnitName)
+ {
+ if (persistenceUnitName == null)
+ throw new IllegalArgumentException("Null persistenceUnitName");
+ this.persistenceUnitName = persistenceUnitName;
+ }
+
+ /**
+ * Get the persistenceContextType.
+ *
+ * @return the persistenceContextType.
+ */
+ public PersistenceContextType getPersistenceContextType()
+ {
+ return persistenceContextType;
+ }
+
+ /**
+ * Set the persistenceContextType.
+ *
+ * @param persistenceContextType the persistenceContextType.
+ * @throws IllegalArgumentException for a null persistenceContextType
+ */
+ public void setPersistenceContextType(PersistenceContextType persistenceContextType)
+ {
+ if (persistenceContextType == null)
+ throw new IllegalArgumentException("Null persistenceContextType");
+ this.persistenceContextType = persistenceContextType;
+ }
+
+ /**
+ * Get the properties.
+ *
+ * @return the properties.
+ */
+ public PropertiesMetaData getProperties()
+ {
+ return properties;
+ }
+
+ /**
+ * Set the properties.
+ *
+ * @param properties the properties.
+ * @throws IllegalArgumentException for a null properties
+ */
+ @XmlElement(name="persistence-property")
+ public void setProperties(PropertiesMetaData properties)
+ {
+ if (properties == null)
+ throw new IllegalArgumentException("Null properties");
+ this.properties = properties;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * PersistenceContextReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class PersistenceContextReferencesMetaData extends AbstractMappedMetaData<PersistenceContextReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 75353633724235761L;
+
+ /**
+ * Create a new PersistenceContextReferencesMetaData.
+ */
+ public PersistenceContextReferencesMetaData()
+ {
+ super("persistence-context-ref-name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextType.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextType.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceContextType.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * PersistenceContextType.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="persistence-context-typeType", mandatory=false)
+ at XmlType(name="persistence-context-typeType")
+public enum PersistenceContextType
+{
+ /** Transaction */
+ Transaction,
+
+ /** Extended */
+ Extended,
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * PersistenceUnitReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="persistence-unit-refType", mandatory=false)
+ at XmlType(name="persistence-unit-refType")
+public class PersistenceUnitReferenceMetaData extends ResourceInjectionMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1900675456507941940L;
+
+ /** The persistence unit name */
+ private String persistenceUnitName;
+
+ /**
+ * Create a new PersistenceUnitReferenceMetaData.
+ */
+ public PersistenceUnitReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the persistenceUnitRefName.
+ *
+ * @return the persistenceUnitRefName.
+ */
+ public String getPersistenceUnitRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the persistenceUnitRefName.
+ *
+ * @param persistenceUnitRefName the persistenceUnitRefName.
+ * @throws IllegalArgumentException for a null peristenceUnitRefName
+ */
+ public void setPersistenceUnitRefName(String persistenceUnitRefName)
+ {
+ setName(persistenceUnitRefName);
+ }
+
+ /**
+ * Get the persistenceUnitName.
+ *
+ * @return the persistenceUnitName.
+ */
+ public String getPersistenceUnitName()
+ {
+ return persistenceUnitName;
+ }
+
+ /**
+ * Set the persistenceUnitName.
+ *
+ * @param persistenceUnitName the persistenceUnitName.
+ * @throws IllegalArgumentException for a null persistenceUnitName
+ */
+ public void setPersistenceUnitName(String persistenceUnitName)
+ {
+ if (persistenceUnitName == null)
+ throw new IllegalArgumentException("Null persistenceUnitName");
+ this.persistenceUnitName = persistenceUnitName;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PersistenceUnitReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * PersistenceUnitReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class PersistenceUnitReferencesMetaData extends AbstractMappedMetaData<PersistenceUnitReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5762149182578142090L;
+
+ /**
+ * Create a new PersistenceUnitReferencesMetaData.
+ */
+ public PersistenceUnitReferencesMetaData()
+ {
+ super("persistence-unit-ref-name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertiesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertiesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertiesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * PropertiesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertiesMetaData extends AbstractMappedMetaData<PropertyMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -1618585082266053135L;
+
+ /**
+ * Create a new PropertiesMetaData.
+ */
+ public PropertiesMetaData()
+ {
+ super("property name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertyMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertyMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/PropertyMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.NamedMetaData;
+
+/**
+ * PropertyMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="propertyType", mandatory=false)
+ at XmlType(name="propertyType")
+public class PropertyMetaData extends NamedMetaData
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5215106879053864009L;
+ /** The value */
+ private String value;
+
+ /**
+ * Create a new PropertyMetaData.
+ */
+ public PropertyMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the value.
+ *
+ * @return the value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Set the value.
+ *
+ * @param value the value.
+ * @throws IllegalArgumentException for a null value
+ */
+ public void setValue(String value)
+ {
+ if (value == null)
+ throw new IllegalArgumentException("Null value");
+ this.value = value;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceAuthorityType.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceAuthorityType.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceAuthorityType.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * ResourceAuthorityType.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="res-authType")
+public enum ResourceAuthorityType
+{
+ /** Application */
+ Application,
+
+ /** Servlet */
+ SERVLET,
+
+ /** Container */
+ Container,
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,119 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * ResourceEnvironmentReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="resource-env-refType")
+public class ResourceEnvironmentReferenceMetaData extends ResourceInjectionMetaDataWithDescriptions implements MergeableMappedMetaData<ResourceEnvironmentReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3906197284118629544L;
+
+ /** The type */
+ private String type;
+
+ /**
+ * Create a new ResourceEnvironmentReferenceMetaData.
+ */
+ public ResourceEnvironmentReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the resourceEnvRefName.
+ *
+ * @return the resourceEnvRefName.
+ */
+ public String getResourceEnvRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the resourceEnvRefName.
+ *
+ * @param resourceEnvRefName the resourceEnvRefName.
+ * @throws IllegalArgumentException for a null resourceEnvRefName
+ */
+ public void setResourceEnvRefName(String resourceEnvRefName)
+ {
+ setName(resourceEnvRefName);
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * Set the type.
+ *
+ * @param type the type.
+ * @throws IllegalArgumentException for a null type
+ */
+ @XmlElement(name="resource-env-ref-type")
+ public void setType(String type)
+ {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ this.type = type;
+ }
+
+ public ResourceEnvironmentReferenceMetaData merge(ResourceEnvironmentReferenceMetaData original)
+ {
+ ResourceEnvironmentReferenceMetaData merged = new ResourceEnvironmentReferenceMetaData();
+ merge(merged, original);
+ return merged;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(ResourceEnvironmentReferenceMetaData merged, ResourceEnvironmentReferenceMetaData original)
+ {
+ super.merge(merged, original);
+ if (type != null)
+ merged.setType(type);
+ else if (original.type != null)
+ merged.setType(original.type);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceEnvironmentReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+import org.jboss.javaee.metadata.support.JavaEEMetaDataUtil;
+
+/**
+ * ResourceEnvironmentReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResourceEnvironmentReferencesMetaData extends AbstractMappedMetaData<ResourceEnvironmentReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -1586023682859221620L;
+
+ /**
+ * Merge resource environment references
+ *
+ * @param override the override references
+ * @param overriden the overriden references
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged referencees
+ */
+ public static ResourceEnvironmentReferencesMetaData merge(ResourceEnvironmentReferencesMetaData override, ResourceEnvironmentReferencesMetaData overriden, String overridenFile, String overrideFile)
+ {
+ if (override == null && overriden == null)
+ return null;
+
+ if (override == null)
+ return overriden;
+
+ ResourceEnvironmentReferencesMetaData merged = new ResourceEnvironmentReferencesMetaData();
+ return JavaEEMetaDataUtil.merge(merged, overriden, override, "resource-env-ref", overridenFile, overrideFile, true);
+ }
+
+ /**
+ * Create a new ResourceEnvironmentReferencesMetaData.
+ */
+ public ResourceEnvironmentReferencesMetaData()
+ {
+ super("resource env ref name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,194 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.metadata.spec.ResourceInjectionTargetMetaData;
+import org.jboss.javaee.metadata.support.NamedMetaData;
+import org.jboss.javaee.metadata.support.NonNullLinkedHashSet;
+
+/**
+ * ResourceInjectionMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class ResourceInjectionMetaData extends NamedMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6333738851813890701L;
+
+ /** The mapped name */
+ private String mappedName;
+
+ /** The injection targets */
+ private Set<ResourceInjectionTargetMetaData> injectionTargets;
+
+ /** The ignore dependency */
+ private EmptyMetaData ignoreDependency;
+
+ /**
+ * Create a new ResourceInjectionMetaData.
+ */
+ public ResourceInjectionMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getMappedName();
+ }
+
+ /**
+ * Set the jndiName.
+ *
+ * @param jndiName the jndiName.
+ * @throws IllegalArgumentException for a null jndiName
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setJndiName(String jndiName)
+ {
+ setMappedName(jndiName);
+ }
+
+ /**
+ * Get the mappedName.
+ *
+ * @return the mappedName.
+ */
+ public String getMappedName()
+ {
+ return mappedName;
+ }
+
+ /**
+ * Set the mappedName.
+ *
+ * @param mappedName the mappedName.
+ * @throws IllegalArgumentException for a null mappedName
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setMappedName(String mappedName)
+ {
+ if (mappedName == null)
+ throw new IllegalArgumentException("Null mappedName");
+ this.mappedName = mappedName;
+ }
+
+ /**
+ * Get the injectionTargets.
+ *
+ * @return the injectionTargets.
+ */
+ public Set<ResourceInjectionTargetMetaData> getInjectionTargets()
+ {
+ return injectionTargets;
+ }
+
+ /**
+ * Set the injectionTargets.
+ *
+ * @param injectionTargets the injectionTargets.
+ * @throws IllegalArgumentException for a null injectionTargets
+ */
+ //@SchemaProperty(name="injection-target", impl=NonNullLinkedHashSet.class, mandatory=false)
+ @XmlElement(name="injection-target", type=NonNullLinkedHashSet.class, required=false)
+ public void setInjectionTargets(Set<ResourceInjectionTargetMetaData> injectionTargets)
+ {
+ if (injectionTargets == null)
+ throw new IllegalArgumentException("Null injectionTargets");
+ this.injectionTargets = injectionTargets;
+ }
+
+ /**
+ * Get the ignoreDependency.
+ *
+ * @return the ignoreDependency.
+ */
+ public EmptyMetaData getIgnoreDependency()
+ {
+ return ignoreDependency;
+ }
+
+ /**
+ * Set the ignoreDependency.
+ *
+ * @param ignoreDependency the ignoreDependency.
+ * @throws IllegalArgumentException for a null ignoreDependency
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setIgnoreDependency(EmptyMetaData ignoreDependency)
+ {
+ if (ignoreDependency == null)
+ throw new IllegalArgumentException("Null ignoreDependency");
+ this.ignoreDependency = ignoreDependency;
+ }
+
+ /**
+ * Get whether the dependency is ignored
+ *
+ * @return true when the dependency is ignored
+ */
+ public boolean isDependencyIgnored()
+ {
+ return ignoreDependency != null;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ * @throws IllegalArgumentException for a null merged or original
+ * @throws IllegalStateException if neither have a name
+ */
+ public void merge(ResourceInjectionMetaData merged, ResourceInjectionMetaData original)
+ {
+ super.merge(merged, original);
+ if (mappedName != null)
+ merged.setMappedName(mappedName);
+ else if (original.mappedName != null)
+ merged.setMappedName(original.mappedName);
+ if (ignoreDependency != null)
+ merged.setIgnoreDependency(ignoreDependency);
+ else if (original.ignoreDependency != null)
+ merged.setIgnoreDependency(original.ignoreDependency);
+
+ // TODO proper merge
+ if (injectionTargets != null)
+ merged.setInjectionTargets(injectionTargets);
+ else if (original.injectionTargets != null)
+ merged.setInjectionTargets(original.injectionTargets);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionTargetMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionTargetMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceInjectionTargetMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,101 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * ResourceInjectionTargetMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="injection-targetType", mandatory=false)
+ at XmlType(name="injection-targetType")
+public class ResourceInjectionTargetMetaData implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8675008295610478284L;
+
+ /** The injection target class */
+ private String injectionTargetClass;
+
+ /** The injection target name */
+ private String injectionTargetName;
+
+ /**
+ * Create a new ResourceInjectionTargetMetaData.
+ */
+ public ResourceInjectionTargetMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the injectionTargetClass.
+ *
+ * @return the injectionTargetClass.
+ */
+ public String getInjectionTargetClass()
+ {
+ return injectionTargetClass;
+ }
+
+ /**
+ * Set the injectionTargetClass.
+ *
+ * @param injectionTargetClass the injectionTargetClass.
+ * @throws IllegalArgumentException for a null injectionTargetClass
+ */
+ public void setInjectionTargetClass(String injectionTargetClass)
+ {
+ if (injectionTargetClass == null)
+ throw new IllegalArgumentException("Null injectionTargetClass");
+ this.injectionTargetClass = injectionTargetClass;
+ }
+
+ /**
+ * Get the injectionTargetName.
+ *
+ * @return the injectionTargetName.
+ */
+ public String getInjectionTargetName()
+ {
+ return injectionTargetName;
+ }
+
+ /**
+ * Set the injectionTargetName.
+ *
+ * @param injectionTargetName the injectionTargetName.
+ * @throws IllegalArgumentException for a null injectionTargetName
+ */
+ public void setInjectionTargetName(String injectionTargetName)
+ {
+ if (injectionTargetName == null)
+ throw new IllegalArgumentException("Null injectionTargetName");
+ this.injectionTargetName = injectionTargetName;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,263 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptions;
+
+/**
+ * ResourceReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="resource-refType")
+public class ResourceReferenceMetaData extends ResourceInjectionMetaDataWithDescriptions implements MergeableMappedMetaData<ResourceReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1900675456507941940L;
+
+ /** The type */
+ private String type;
+
+ /** The authority */
+ private ResourceAuthorityType authority;
+
+ /** The sharing scope */
+ private ResourceSharingScopeType sharingScope;
+
+ /** The resource name */
+ private String resourceName;
+
+ /** The resource url */
+ private String resUrl;
+
+ /**
+ * Create a new ResourceReferenceMetaData.
+ */
+ public ResourceReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the resourceRefName.
+ *
+ * @return the resourceRefName.
+ */
+ public String getResourceRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the resourceRefName.
+ *
+ * @param resourceRefName the resourceRefName.
+ * @throws IllegalArgumentException for a null resourceRefName
+ */
+ @XmlElement(name="res-ref-name")
+ public void setResourceRefName(String resourceRefName)
+ {
+ setName(resourceRefName);
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * Set the type.
+ *
+ * @param type the type.
+ * @throws IllegalArgumentException for a null type
+ */
+ @XmlElement(name="res-type")
+ public void setType(String type)
+ {
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+ this.type = type;
+ }
+
+ /**
+ * Get the authority.
+ *
+ * @return the authority.
+ */
+ public ResourceAuthorityType getResAuth()
+ {
+ return authority;
+ }
+
+ /**
+ * Set the authority.
+ *
+ * @param authority the authority.
+ * @throws IllegalArgumentException for a null authority
+ */
+ public void setResAuth(ResourceAuthorityType authority)
+ {
+ if (authority == null)
+ throw new IllegalArgumentException("Null authority");
+ this.authority = authority;
+ }
+
+ /**
+ * Get the containerAuth.
+ *
+ * @return the containerAuth.
+ */
+ public boolean isContainerAuth()
+ {
+ if (authority == null)
+ return false;
+ else
+ return authority == ResourceAuthorityType.Container;
+ }
+
+ /**
+ * Get the sharingScope.
+ *
+ * @return the sharingScope.
+ */
+ public ResourceSharingScopeType getResSharingScope()
+ {
+ return sharingScope;
+ }
+
+ /**
+ * Set the sharingScope.
+ *
+ * @param sharingScope the sharingScope.
+ * @throws IllegalArgumentException for a null sharingScope
+ */
+ @XmlElement(name="res-sharing-scope")
+ public void setResSharingScope(ResourceSharingScopeType sharingScope)
+ {
+ if (sharingScope == null)
+ throw new IllegalArgumentException("Null sharingScope");
+ this.sharingScope = sharingScope;
+ }
+
+ /**
+ * Get the isShareable.
+ *
+ * @return the isShareable.
+ */
+ public boolean isShareable()
+ {
+ if (sharingScope == null)
+ return true;
+ else
+ return sharingScope == ResourceSharingScopeType.Shareable;
+ }
+
+ public ResourceReferenceMetaData merge(ResourceReferenceMetaData original)
+ {
+ ResourceReferenceMetaData merged = new ResourceReferenceMetaData();
+ merge(merged, original);
+ return merged;
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ */
+ public void merge(ResourceReferenceMetaData merged, ResourceReferenceMetaData original)
+ {
+ super.merge(merged, original);
+ if (type != null)
+ merged.setType(type);
+ else if (original.type != null)
+ merged.setType(original.type);
+ if (authority != null)
+ merged.setResAuth(authority);
+ else if (original.authority != null)
+ merged.setResAuth(original.authority);
+ if (sharingScope != null)
+ merged.setResSharingScope(sharingScope);
+ else if (original.sharingScope != null)
+ merged.setResSharingScope(original.sharingScope);
+ }
+
+ /**
+ * Get the resourceName.
+ *
+ * @return the resourceName.
+ */
+ public String getResourceName()
+ {
+ return resourceName;
+ }
+
+ /**
+ * Set the resourceName.
+ *
+ * @param resourceName the resourceName.
+ * @throws IllegalArgumentException for a null resourceName
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setResourceName(String resourceName)
+ {
+ if (resourceName == null)
+ throw new IllegalArgumentException("Null resourceName");
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Get the resUrl.
+ *
+ * @return the resUrl.
+ */
+ public String getResUrl()
+ {
+ return resUrl;
+ }
+
+ /**
+ * Set the resUrl.
+ *
+ * @param resUrl the resUrl.
+ * @throws IllegalArgumentException for a null resUrl
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setResUrl(String resUrl)
+ {
+ if (resUrl == null)
+ throw new IllegalArgumentException("Null resUrl");
+ this.resUrl = resUrl;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+import org.jboss.javaee.metadata.support.JavaEEMetaDataUtil;
+
+/**
+ * ResourceReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ResourceReferencesMetaData extends AbstractMappedMetaData<ResourceReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -6067974868675929921L;
+
+ /**
+ * Merge resource references
+ *
+ * @param override the override references
+ * @param overriden the overriden references
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged referencees
+ */
+ public static ResourceReferencesMetaData merge(ResourceReferencesMetaData override, ResourceReferencesMetaData overriden, String overridenFile, String overrideFile)
+ {
+ if (override == null && overriden == null)
+ return null;
+
+ if (override == null)
+ return overriden;
+
+ ResourceReferencesMetaData merged = new ResourceReferencesMetaData();
+ return JavaEEMetaDataUtil.merge(merged, overriden, override, "resource-ref", overridenFile, overrideFile, true);
+ }
+
+ /**
+ * Create a new ResourceReferencesMetaData.
+ */
+ public ResourceReferencesMetaData()
+ {
+ super("resource ref name");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceSharingScopeType.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceSharingScopeType.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ResourceSharingScopeType.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * ResourceSharingScopeType.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="res-sharing-scopeType")
+public enum ResourceSharingScopeType
+{
+ /** Shareable */
+ Shareable,
+
+ /** Unshareable */
+ Unshareable,
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/RunAsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/RunAsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/RunAsMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.IdMetaDataImplWithDescriptions;
+
+/**
+ * RunAsMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="run-asType")
+public class RunAsMetaData extends IdMetaDataImplWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6132381662482264933L;
+
+ /** The role name */
+ private String roleName;
+
+ /**
+ * Create a new SecurityRoleRefMetaData.
+ */
+ public RunAsMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the roleName.
+ *
+ * @return the roleName.
+ */
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ /**
+ * Set the roleName.
+ *
+ * @param roleName the roleName.
+ * @throws IllegalArgumentException for a null roleName
+ */
+ public void setRoleName(String roleName)
+ {
+ if (roleName == null)
+ throw new IllegalArgumentException("Null roleName");
+ this.roleName = roleName;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,123 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.MergeableMappedMetaData;
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptions;
+import org.jboss.javaee.metadata.support.NonNullLinkedHashSet;
+
+/**
+ * SecurityRoleMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="security-roleType")
+public class SecurityRoleMetaData extends NamedMetaDataWithDescriptions implements MergeableMappedMetaData<SecurityRoleMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -4349954695900237831L;
+
+ /** The prinicpals */
+ private Set<String> principals;
+
+ /**
+ * Create a new SecurityRoleMetaData.
+ */
+ public SecurityRoleMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the roleName.
+ *
+ * @return the roleName.
+ */
+ public String getRoleName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the roleName.
+ *
+ * @param roleName the roleName.
+ * @throws IllegalArgumentException for a null roleName
+ */
+ public void setRoleName(String roleName)
+ {
+ setName(roleName);
+ }
+
+ /**
+ * Get the principals.
+ *
+ * @return the principals.
+ */
+ public Set<String> getPrincipals()
+ {
+ return principals;
+ }
+
+ /**
+ * Set the principals.
+ *
+ * @param principals the principals.
+ * @throws IllegalArgumentException for a null principals
+ */
+ //@SchemaProperty(name="principal", mandatory=false, impl=NonNullLinkedHashSet.class)
+ @XmlElement(name="principal", required=false, type=NonNullLinkedHashSet.class)
+ public void setPrincipals(Set<String> principals)
+ {
+ if (principals == null)
+ throw new IllegalArgumentException("Null principals");
+ this.principals = principals;
+ }
+
+ /**
+ * Whether this roles has the principal
+ *
+ * @param userName the principal
+ * @return true when it has the principal
+ * @throws IllegalArgumentException for a null principal
+ */
+ public boolean hasPrincipal(String userName)
+ {
+ if (userName == null)
+ throw new IllegalArgumentException("Null userName");
+ if (principals == null)
+ return false;
+ return principals.contains(userName);
+ }
+
+ public SecurityRoleMetaData merge(SecurityRoleMetaData original)
+ {
+ // There is nothing to merge
+ return this;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptions;
+
+/**
+ * SecurityRoleRefMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="security-role-refType")
+public class SecurityRoleRefMetaData extends NamedMetaDataWithDescriptions
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8092072767419265555L;
+
+ /** The role link */
+ private String roleLink;
+
+ /**
+ * Create a new SecurityRoleRefMetaData.
+ */
+ public SecurityRoleRefMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the roleLink.
+ *
+ * @return the roleLink.
+ */
+ public String getRoleLink()
+ {
+ return roleLink;
+ }
+
+ /**
+ * Set the roleLink.
+ *
+ * @param roleLink the roleLink.
+ * @throws IllegalArgumentException for a null roleLink
+ */
+ public void setRoleLink(String roleLink)
+ {
+ if (roleLink == null)
+ throw new IllegalArgumentException("Null roleLink");
+ this.roleLink = roleLink;
+ }
+
+ /**
+ * Get the roleNames.
+ *
+ * @return the roleNames.
+ */
+ public String getRoleName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the roleName.
+ *
+ * @param roleName the roleName.
+ * @throws IllegalArgumentException for a null roleName
+ */
+ public void setRoleName(String roleName)
+ {
+ setName(roleName);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRoleRefsMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.NonNullLinkedHashSet;
+
+/**
+ * SecurityRoleRefsMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SecurityRoleRefsMetaData extends NonNullLinkedHashSet<SecurityRoleRefMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1775636729892021076L;
+
+ /**
+ * Create a new SecurityRoleRefsMetaData.
+ */
+ public SecurityRoleRefsMetaData()
+ {
+ // For serialization
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRolesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRolesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/SecurityRolesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,92 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * SecurityRolesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SecurityRolesMetaData extends AbstractMappedMetaData<SecurityRoleMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4551308976124434096L;
+
+ /**
+ * Create a new SecurityRolesMetaData.
+ */
+ public SecurityRolesMetaData()
+ {
+ super("role name for security role");
+ }
+
+ /**
+ * Get the security roles by principal
+ *
+ * @param userName the principal name
+ * @return the security roles containing the principal or null for no roles
+ * @throws IllegalArgumentException for a null user name
+ */
+ public SecurityRolesMetaData getSecurityRolesByPrincipal(String userName)
+ {
+ if (userName == null)
+ throw new IllegalArgumentException("Null userName");
+ if (isEmpty())
+ return null;
+ SecurityRolesMetaData result = new SecurityRolesMetaData();
+ for (SecurityRoleMetaData role : this)
+ {
+ if (role.hasPrincipal(userName))
+ result.add(role);
+ }
+ return result;
+ }
+
+ /**
+ * Get the security role names by principal
+ *
+ * @param userName the principal name
+ * @return the security role names containing the principal
+ * @throws IllegalArgumentException for a null user name
+ */
+ public Set<String> getSecurityRoleNamesByPrincipal(String userName)
+ {
+ if (userName == null)
+ throw new IllegalArgumentException("Null userName");
+ if (isEmpty())
+ return Collections.emptySet();
+ Set<String> result = new LinkedHashSet<String>();
+ for (SecurityRoleMetaData role : this)
+ {
+ if (role.hasPrincipal(userName))
+ result.add(role.getRoleName());
+ }
+ return result;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,109 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * ServiceReferenceHandlerChainMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="service-ref_handler-chainType", mandatory=false)
+ at XmlType(name="service-ref_handler-chainType")
+public class ServiceReferenceHandlerChainMetaData implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -1266911268623169174L;
+
+ /** The id */
+ private String id;
+
+ // TODO service-name-pattern
+
+ // TODO port-name-pattern
+
+ // TODO protocol-bindings
+
+ /** The handlers */
+ private ServiceReferenceHandlersMetaData handlers;
+
+ /**
+ * Create a new ServiceReferenceHandlerChainMetaData.
+ */
+ public ServiceReferenceHandlerChainMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the handlers.
+ *
+ * @return the handlers.
+ */
+ public ServiceReferenceHandlersMetaData getHandlers()
+ {
+ return handlers;
+ }
+
+ /**
+ * Set the handlers.
+ *
+ * @param handlers the handlers.
+ * @throws IllegalArgumentException for a null handlers
+ */
+ @XmlElement(name="handler")
+ public void setHandlers(ServiceReferenceHandlersMetaData handlers)
+ {
+ if (handlers == null)
+ throw new IllegalArgumentException("Null handlers");
+ this.handlers = handlers;
+ }
+
+ /**
+ * Get the id.
+ *
+ * @return the id.
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * Set the id.
+ *
+ * @param id the id.
+ * @throws IllegalArgumentException for a null id
+ */
+ public void setId(String id)
+ {
+ if (id == null)
+ throw new IllegalArgumentException("Null id");
+ this.id = id;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainsMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainsMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerChainsMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.NonNullLinkedHashSet;
+
+/**
+ * ServiceReferenceHandlerChainsMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaType(name="service-ref_handler-chainsType", mandatory=false)
+ at XmlType(name="service-ref_handler-chainsType")
+public class ServiceReferenceHandlerChainsMetaData extends NonNullLinkedHashSet<ServiceReferenceHandlerChainMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -480961032781276640L;
+
+ /**
+ * Create a new ServiceReferenceChainssMetaData.
+ */
+ public ServiceReferenceHandlerChainsMetaData()
+ {
+ // For serialization
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlerMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,102 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.javaee.metadata.support.NamedMetaDataWithDescriptionGroup;
+
+/**
+ * ServiceReferenceHandlerMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="service-ref_handlerType")
+public class ServiceReferenceHandlerMetaData extends NamedMetaDataWithDescriptionGroup
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5693673588576610322L;
+
+ /** The handler class */
+ private String handlerClass;
+
+ // TODO init-params
+
+ // TODO soap-headers
+
+ // TODO soap-roles
+
+ // TODO port-names
+
+ /**
+ * Create a new ServiceReferenceHandlerMetaData.
+ */
+ public ServiceReferenceHandlerMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the handlerName.
+ *
+ * @return the handlerName.
+ */
+ public String getHandlerName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the handlerName.
+ *
+ * @param handlerName the handlerName.
+ * @throws IllegalArgumentException for a null handlerName
+ */
+ public void setHandlerName(String handlerName)
+ {
+ setName(handlerName);
+ }
+
+ /**
+ * Get the handlerClass.
+ *
+ * @return the handlerClass.
+ */
+ public String getHandlerClass()
+ {
+ return handlerClass;
+ }
+
+ /**
+ * Set the handlerClass.
+ *
+ * @param handlerClass the handlerClass.
+ * @throws IllegalArgumentException for a null handlerClass
+ */
+ public void setHandlerClass(String handlerClass)
+ {
+ if (handlerClass == null)
+ throw new IllegalArgumentException("Null handlerClass");
+ this.handlerClass = handlerClass;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlersMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlersMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceHandlersMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * ServiceReferenceHandlersMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServiceReferenceHandlersMetaData extends AbstractMappedMetaData<ServiceReferenceHandlerMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -732816449464795631L;
+
+ /**
+ * Create a new ServiceReferencesMetaData.
+ */
+ public ServiceReferenceHandlersMetaData()
+ {
+ super("handler name for service ref handler");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferenceMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,257 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.jboss.javaee.metadata.support.ResourceInjectionMetaDataWithDescriptionGroup;
+
+/**
+ * ServiceReferenceMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="service-refType")
+public class ServiceReferenceMetaData extends ResourceInjectionMetaDataWithDescriptionGroup
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5693673588576610322L;
+
+ /** The service interface */
+ private String serviceInterface;
+
+ /** The service reference type */
+ private String serviceRefType;
+
+ /** The wsdl file */
+ private String wsdlFile;
+
+ /** The jaxrpc mapping file */
+ private String jaxrpcMappingFile;
+
+ /** The service qname */
+ private QName serviceQname;
+
+ /** The handlers */
+ private ServiceReferenceHandlersMetaData handlers;
+
+ /** The handler chains */
+ private ServiceReferenceHandlerChainsMetaData handlerChains;
+
+ /**
+ * Create a new ServiceReferenceMetaData.
+ */
+ public ServiceReferenceMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the serviceRefName.
+ *
+ * @return the serviceRefName.
+ */
+ public String getServiceRefName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the serviceRefName.
+ *
+ * @param serviceRefName the serviceRefName.
+ * @throws IllegalArgumentException for a null serviceRefName
+ */
+ public void setServiceRefName(String serviceRefName)
+ {
+ setName(serviceRefName);
+ }
+
+ /**
+ * Get the jaxrpcMappingFile.
+ *
+ * @return the jaxrpcMappingFile.
+ */
+ public String getJaxrpcMappingFile()
+ {
+ return jaxrpcMappingFile;
+ }
+
+ /**
+ * Set the jaxrpcMappingFile.
+ *
+ * @param jaxrpcMappingFile the jaxrpcMappingFile.
+ * @throws IllegalArgumentException for a null jaxrpcMappingFile
+ */
+ public void setJaxrpcMappingFile(String jaxrpcMappingFile)
+ {
+ if (jaxrpcMappingFile == null)
+ throw new IllegalArgumentException("Null jaxrpcMappingFile");
+ this.jaxrpcMappingFile = jaxrpcMappingFile;
+ }
+
+ /**
+ * Get the serviceInterface.
+ *
+ * @return the serviceInterface.
+ */
+ public String getServiceInterface()
+ {
+ return serviceInterface;
+ }
+
+ /**
+ * Set the serviceInterface.
+ *
+ * @param serviceInterface the serviceInterface.
+ * @throws IllegalArgumentException for a null serviceInterface
+ */
+ public void setServiceInterface(String serviceInterface)
+ {
+ if (serviceInterface == null)
+ throw new IllegalArgumentException("Null serviceInterface");
+ this.serviceInterface = serviceInterface;
+ }
+
+ /**
+ * Get the serviceQname.
+ *
+ * @return the serviceQname.
+ */
+ public QName getServiceQname()
+ {
+ return serviceQname;
+ }
+
+ /**
+ * Set the serviceQname.
+ *
+ * @param serviceQname the serviceQname.
+ * @throws IllegalArgumentException for a null serviceQname
+ */
+ public void setServiceQname(QName serviceQname)
+ {
+ if (serviceQname == null)
+ throw new IllegalArgumentException("Null serviceQname");
+ this.serviceQname = serviceQname;
+ }
+
+ /**
+ * Get the serviceRefType.
+ *
+ * @return the serviceRefType.
+ */
+ public String getServiceRefType()
+ {
+ return serviceRefType;
+ }
+
+ /**
+ * Set the serviceRefType.
+ *
+ * @param serviceRefType the serviceRefType.
+ * @throws IllegalArgumentException for a null serviceRefType
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setServiceRefType(String serviceRefType)
+ {
+ if (serviceRefType == null)
+ throw new IllegalArgumentException("Null serviceRefType");
+ this.serviceRefType = serviceRefType;
+ }
+
+ /**
+ * Get the wsdlFile.
+ *
+ * @return the wsdlFile.
+ */
+ public String getWsdlFile()
+ {
+ return wsdlFile;
+ }
+
+ /**
+ * Set the wsdlFile.
+ *
+ * @param wsdlFile the wsdlFile.
+ * @throws IllegalArgumentException for a null wsdlFile
+ */
+ public void setWsdlFile(String wsdlFile)
+ {
+ if (wsdlFile == null)
+ throw new IllegalArgumentException("Null wsdlFile");
+ this.wsdlFile = wsdlFile;
+ }
+
+ /**
+ * Get the handlers.
+ *
+ * @return the handlers.
+ */
+ public ServiceReferenceHandlersMetaData getHandlers()
+ {
+ return handlers;
+ }
+
+ /**
+ * Set the handlers.
+ *
+ * @param handlers the handlers.
+ * @throws IllegalArgumentException for a null handlers
+ */
+ @XmlElement(name="handler")
+ public void setHandlers(ServiceReferenceHandlersMetaData handlers)
+ {
+ if (handlers == null)
+ throw new IllegalArgumentException("Null handlers");
+ this.handlers = handlers;
+ }
+
+ /**
+ * Get the handlerChains.
+ *
+ * @return the handlerChains.
+ */
+ public ServiceReferenceHandlerChainsMetaData getHandlerChains()
+ {
+ return handlerChains;
+ }
+
+ /**
+ * Set the handlerChains.
+ *
+ * @param handlerChains the handlerChains.
+ * @throws IllegalArgumentException for a null handlerChains
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setHandlerChains(ServiceReferenceHandlerChainsMetaData handlerChains)
+ {
+ if (handlerChains == null)
+ throw new IllegalArgumentException("Null handlerChains");
+ this.handlerChains = handlerChains;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferencesMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferencesMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/spec/ServiceReferencesMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.spec;
+
+import org.jboss.javaee.metadata.support.AbstractMappedMetaData;
+
+/**
+ * ServiceReferencesMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+//@SchemaGroup(name="service-refGroup")
+public class ServiceReferencesMetaData extends AbstractMappedMetaData<ServiceReferenceMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2667900705228419782L;
+
+ /**
+ * Create a new ServiceReferencesMetaData.
+ */
+ public ServiceReferencesMetaData()
+ {
+ super("service ref name for service ref");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,308 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * MappedMetaData.
+ *
+ * @param <T> the metadata type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractMappedMetaData<T extends MappableMetaData> extends IdMetaDataImpl implements MappedMetaData<T>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5696461894017065337L;
+
+ /** The key name */
+ private String keyName;
+
+ /** The metaDatas */
+ private Map<String, T> map;
+
+ /**
+ * Get By Name
+ *
+ * @param <T> the type
+ * @param name the name
+ * @param map the map
+ * @return the result
+ */
+ public static <T extends MappableMetaData> T getByName(String name, AbstractMappedMetaData<T> map)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+ if (map == null)
+ return null;
+ return map.get(name);
+ }
+
+ /**
+ * Create a new MappedMetaData.
+ *
+ * @param keyName the key name
+ */
+ protected AbstractMappedMetaData(String keyName)
+ {
+ if (keyName == null)
+ throw new IllegalArgumentException("Null keyName");
+ this.keyName = keyName;
+ }
+
+ /**
+ * Get the key set
+ *
+ * @return the key set
+ */
+ public Set<String> keySet()
+ {
+ if (map == null)
+ return Collections.emptySet();
+ return Collections.unmodifiableSet(map.keySet());
+ }
+
+ /**
+ * Get the metadata for the given key
+ *
+ * @param key the key
+ * @return the key
+ * @throws IllegalArgumentException for a null key
+ */
+ public T get(String key)
+ {
+ if (key == null)
+ throw new IllegalArgumentException("No " + keyName);
+ if (map == null)
+ return null;
+ return map.get(key);
+ }
+
+ public boolean add(T o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ String key = o.getKey();
+ if (key == null)
+ throw new IllegalArgumentException("No " + keyName);
+
+ if (map == null)
+ map = new NonNullLinkedHashMap<String, T>();
+ T result = map.put(key, o);
+ if (result != null)
+ removeNotification(result);
+ addNotification(o);
+ return true;
+ }
+
+ public void clear()
+ {
+ for (T t : map.values())
+ removeNotification(t);
+ map = null;
+ }
+
+ public boolean contains(Object o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ if (map == null)
+ return false;
+ return map.containsValue(o);
+ }
+
+ public Iterator<T> iterator()
+ {
+ if (map == null)
+ {
+ Collection<T> result = Collections.emptyList();
+ return result.iterator();
+ }
+ return Collections.unmodifiableCollection(map.values()).iterator();
+ }
+
+ public boolean remove(Object o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ if (o instanceof MappableMetaData)
+ return false;
+
+ if (map == null)
+ return false;
+
+ MappableMetaData m = (MappableMetaData) o;
+ String key = m.getKey();
+ MappableMetaData v = map.get(key);
+ if (m.equals(v))
+ {
+ T result = map.remove(key);
+ if (result != null)
+ {
+ removeNotification(result);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int size()
+ {
+ return map.size();
+ }
+
+ public boolean addAll(Collection<? extends T> c)
+ {
+ boolean result = false;
+ for (T object : c)
+ {
+ if (add(object))
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean containsAll(Collection<?> c)
+ {
+ if (map == null)
+ return c.isEmpty();
+
+ for (Object object : c)
+ {
+ if (contains(object) == false)
+ return false;
+ }
+ return true;
+ }
+
+ public boolean isEmpty()
+ {
+ if (map == null)
+ return true;
+ return size() == 0;
+ }
+
+ public boolean removeAll(Collection<?> c)
+ {
+ if (map == null)
+ return false;
+
+ boolean result = false;
+ for (Object object : c)
+ {
+ if (remove(object))
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean retainAll(Collection<?> c)
+ {
+ if (map == null)
+ return false;
+
+ boolean result = false;
+ for (Object o : map.values())
+ {
+ if (c.contains(o))
+ {
+ if (remove(o))
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ public Object[] toArray()
+ {
+ if (map == null)
+ return new Object[0];
+ return map.values().toArray();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T[] toArray(T[] a)
+ {
+ if (map == null)
+ return (T[]) new Object[0];
+ return map.values().toArray(a);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ return true;
+ if (obj == null || obj instanceof Collection == false)
+ return false;
+ Collection<?> other = (Collection) obj;
+
+ if (size() != other.size())
+ return false;
+
+ if (map == null)
+ return true;
+
+ return other.containsAll(map.values());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ if (map == null)
+ return 0;
+ return map.values().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ if (map == null)
+ return "[]";
+ return map.values().toString();
+ }
+
+ /**
+ * Notification that something was added
+ *
+ * @param added the thing added
+ */
+ protected void addNotification(T added)
+ {
+ // Nothing
+ }
+
+ /**
+ * Notification that something was removed
+ *
+ * @param removed the thing removed
+ */
+ protected void removeNotification(T removed)
+ {
+ // Nothing
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaDataWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaDataWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/AbstractMappedMetaDataWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+
+/**
+ * MappedMetaData.
+ *
+ * @param <C> the overriden component type
+ * @param <T> the mapped type
+ * @param <O> the overriden type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractMappedMetaDataWithOverride<C extends MappableMetaData, T extends MappableMetaDataWithOverride<C>, O extends MappedMetaData<C>> extends AbstractMappedMetaData<T> implements MappedMetaDataWithOverride<C, T, O>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1646142944205417776L;
+
+ /** The overriden metadata */
+ private O data;
+
+ /**
+ * Create a new MappedMetaData.
+ *
+ * @param keyName the key name
+ */
+ protected AbstractMappedMetaDataWithOverride(String keyName)
+ {
+ super(keyName);
+ }
+
+ public O getOverridenMetaData()
+ {
+ return data;
+ }
+
+ //@SchemaProperty(ignore=true)
+ @XmlTransient
+ public void setOverridenMetaData(O data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+ this.data = data;
+ }
+
+ public C createOriginal(T data)
+ {
+ throw new UnsupportedOperationException("Create originals from overrides is not supported for " + getClass().getName());
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.io.Serializable;
+
+/**
+ * IdMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdMetaData extends Serializable
+{
+
+ /**
+ * Get the id.
+ *
+ * @return the id.
+ */
+ String getId();
+
+ /**
+ * Set the id.
+ *
+ * @param id the id.
+ * @throws IllegalArgumentException for a null id
+ */
+ void setId(String id);
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImpl.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImpl.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImpl.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,91 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import org.jboss.util.UnreachableStatementException;
+
+/**
+ * IdMetaDataImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class IdMetaDataImpl implements IdMetaData, Cloneable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2952233733011178332L;
+
+ /** The id */
+ String id;
+
+ /**
+ * Create a new IdMetaDataImpl.
+ */
+ public IdMetaDataImpl()
+ {
+ // For serialization
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ if (id == null)
+ throw new IllegalArgumentException("Null id");
+ this.id = id;
+ }
+
+ @Override
+ public IdMetaDataImpl clone()
+ {
+ try
+ {
+ return (IdMetaDataImpl) super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new UnreachableStatementException("clone");
+ }
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ * @throws IllegalArgumentException for a null merged or original
+ */
+ public void merge(IdMetaDataImpl merged, IdMetaDataImpl original)
+ {
+ if (merged == null)
+ throw new IllegalArgumentException("Null merged");
+ if (original == null)
+ throw new IllegalArgumentException("Null original");
+ if (id != null)
+ merged.setId(id);
+ else if (original.id != null)
+ merged.setId(original.id);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroup.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroup.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroup.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import org.jboss.javaee.metadata.spec.DescriptionGroupMetaData;
+
+/**
+ * IdMetaDataImplWithDescriptionGroup.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class IdMetaDataImplWithDescriptionGroup extends IdMetaDataImpl
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 3906255525185441267L;
+
+ /** The description group */
+ private DescriptionGroupMetaData descriptionGroup;
+
+ /**
+ * Create a new IdMetaDataImplWithDescriptions.
+ */
+ public IdMetaDataImplWithDescriptionGroup()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the descriptionGroup.
+ *
+ * @return the descriptionGroup.
+ */
+ public DescriptionGroupMetaData getDescriptionGroup()
+ {
+ return descriptionGroup;
+ }
+
+ /**
+ * Set the descriptionGroup.
+ *
+ * @param descriptionGroup the descriptionGroup.
+ * @throws IllegalArgumentException for a null descriptionGroup
+ */
+ //@SchemaProperty(noInterceptor=true)
+ public void setDescriptionGroup(DescriptionGroupMetaData descriptionGroup)
+ {
+ if (descriptionGroup == null)
+ throw new IllegalArgumentException("Null descriptionGroup");
+ this.descriptionGroup = descriptionGroup;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroupWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroupWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionGroupWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+
+/**
+ * IdMetaDataImplWithDescriptionGroup.
+ *
+ * @param <T> the overriden type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class IdMetaDataImplWithDescriptionGroupWithOverride<T> extends IdMetaDataImplWithDescriptionGroup implements OverrideMetaData<T>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7273605180933967019L;
+
+ /** The overriden metadata */
+ private T data;
+
+ public T getOverridenMetaData()
+ {
+ return data;
+ }
+
+ /**
+ * Get the override metadata
+ *
+ * @return the data
+ * @throws IllegalStateException when not set
+ */
+ protected T getOverridenMetaDataWithCheck()
+ {
+ if (data == null)
+ throw new IllegalStateException("Override metadata has not been set " + this);
+ return data;
+ }
+
+ //@SchemaProperty(ignore=true)
+ @XmlTransient
+ public void setOverridenMetaData(T data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+ this.data = data;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptions.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptions.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptions.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.metadata.spec.DescriptionsImpl;
+
+/**
+ * IdMetaDataImplWithDescriptions.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class IdMetaDataImplWithDescriptions extends IdMetaDataImpl
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8444982686386775186L;
+
+ /** The descriptions */
+ private Descriptions descriptions;
+
+ /**
+ * Create a new IdMetaDataImplWithDescriptions.
+ */
+ public IdMetaDataImplWithDescriptions()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the descriptions.
+ *
+ * @return the descriptions.
+ */
+ public Descriptions getDescriptions()
+ {
+ return descriptions;
+ }
+
+ /**
+ * Set the descriptions.
+ *
+ * @param descriptions the descriptions.
+ * @throws IllegalArgumentException for a null descriptions
+ */
+ @XmlElement(name="description", type=DescriptionsImpl.class)
+ public void setDescriptions(Descriptions descriptions)
+ {
+ if (descriptions == null)
+ throw new IllegalArgumentException("Null descriptions");
+ this.descriptions = descriptions;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionsWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionsWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithDescriptionsWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+
+/**
+ * IdMetaDataImplWithDescriptionsWithOverride.
+ *
+ * @param <T> the overriden type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IdMetaDataImplWithDescriptionsWithOverride<T> extends IdMetaDataImplWithDescriptions implements OverrideMetaData<T>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 3513592008103433460L;
+
+ /** The overriden metadata */
+ private T data;
+
+ public T getOverridenMetaData()
+ {
+ return data;
+ }
+
+ /**
+ * Get the override metadata
+ *
+ * @return the data
+ * @throws IllegalStateException when not set
+ */
+ protected T getOverridenMetaDataWithCheck()
+ {
+ if (data == null)
+ throw new IllegalStateException("Override metadata has not been set " + this);
+ return data;
+ }
+
+ //@SchemaProperty(ignore=true)
+ @XmlTransient
+ public void setOverridenMetaData(T data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+ this.data = data;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/IdMetaDataImplWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+
+/**
+ * IdMetaDataImpl.
+ *
+ * @param <T> the overridden metadata
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IdMetaDataImplWithOverride<T> extends IdMetaDataImpl implements OverrideMetaData<T>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1178687564812348455L;
+
+ /** The overriden metadata */
+ private T data;
+
+ public T getOverridenMetaData()
+ {
+ return data;
+ }
+
+ //@SchemaProperty(ignore=true)
+ @XmlTransient
+ public void setOverridenMetaData(T data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+ this.data = data;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/JavaEEMetaDataUtil.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/JavaEEMetaDataUtil.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/JavaEEMetaDataUtil.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,222 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * Util.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JavaEEMetaDataUtil
+{
+ /**
+ * Merged overriden mapped metadata, using the ejb-jar.xml and jboss.xml file names
+ *
+ * @param <T> the metadata component
+ * @param <M> the metadata map
+ * @param merged the skeleton merged metadata
+ * @param overriden the overriden metadata
+ * @param mapped the the override metadata
+ * @param context a context for error messages
+ * @param mustOverride whether the overridden data must exist
+ * @return the merged metadata
+ */
+ public static <T extends MergeableMappedMetaData<T>,
+ M extends MappedMetaData<T>>
+ M mergeJBossXml(M merged, M overriden, M mapped, String context, boolean mustOverride)
+ {
+ return merge(merged, overriden, mapped, context, "ejb-jar.xml", "jboss.xml", mustOverride);
+ }
+
+ /**
+ * Merged mapped metadata
+ *
+ * @param <T> the metadata component
+ * @param <M> the metadata map
+ * @param merged the skeleton merged metadata
+ * @param overriden the overriden metadata
+ * @param mapped the the override metadata
+ * @param context a context for error messages
+ * @param overridenFile the xml file the overridden metadata comes from for error messages
+ * @param overrideFile the xml file the override metadata comes from for error messages
+ * @param mustOverride whether the overridden data must exist
+ * @return the merged metadata
+ */
+ public static <T extends MergeableMappedMetaData<T>,
+ M extends MappedMetaData<T>>
+ M merge(M merged, M overriden, M mapped, String context, String overridenFile, String overrideFile, boolean mustOverride)
+ {
+ if (merged == null)
+ throw new IllegalArgumentException("Null merged");
+
+ // Nothing to do
+ if (overriden == null && mapped == null)
+ return merged;
+
+ // No override
+ if (overriden == null || overriden.isEmpty())
+ {
+ if (mapped.isEmpty() == false && mustOverride)
+ throw new IllegalStateException(overridenFile + " has no " + context + "s but " + overrideFile + " has " + mapped.keySet());
+ return mapped;
+ }
+
+ // Check the overrides
+ if (mapped != null && mapped.isEmpty() == false)
+ {
+ for (T t : mapped)
+ {
+ String key = t.getKey();
+ T original = overriden.get(key);
+ if (original == null)
+ {
+ if (mustOverride)
+ throw new IllegalStateException(key + " in " + overrideFile + ", but not in "+ overridenFile);
+ else
+ merged.add(t);
+ }
+ else
+ {
+ T merge = t.merge(original);
+ merged.add(merge);
+ }
+ }
+ }
+
+ // Process the originals
+ if (overriden != null)
+ {
+ for (T t : overriden)
+ {
+ // Add if no override
+ String key = t.getKey();
+ if (merged.get(key) == null)
+ {
+ merged.add(t);
+ }
+ }
+ }
+
+ return merged;
+ }
+
+ /**
+ * Merged overriden mapped metadata, using the ejb-jar.xml and jboss.xml file names
+ *
+ * @param <C> the original metadata component
+ * @param <O> the original metadata map
+ * @param <T> the overridden metadata component
+ * @param <M> the overridden metadata map
+ * @param merged the skeleton merged metadata
+ * @param overriden the overriden metadata
+ * @param mapped the the override metadata
+ * @param context a context for error messages
+ * @param mustOverride whether the overridden data must exist
+ * @return the merged metadata
+ */
+ public static <C extends MappableMetaData,
+ O extends MappedMetaData<C>,
+ T extends MappableMetaDataWithOverride<C>,
+ M extends MappedMetaDataWithOverride<C, T, O>>
+ M mergeOverrideJBossXml(M merged, O overriden, M mapped, String context, boolean mustOverride)
+ {
+ return mergeOverride(merged, overriden, mapped, context, "ejb-jar.xml", "jboss.xml", mustOverride);
+ }
+
+ /**
+ * Merged overriden mapped metadata
+ *
+ * @param <C> the original metadata component
+ * @param <O> the original metadata map
+ * @param <T> the overridden metadata component
+ * @param <M> the overridden metadata map
+ * @param merged the skeleton merged metadata
+ * @param overriden the overriden metadata
+ * @param mapped the the override metadata
+ * @param context a context for error messages
+ * @param overridenFile the xml file the overridden metadata comes from for error messages
+ * @param overrideFile the xml file the override metadata comes from for error messages
+ * @param mustOverride whether the overridden data must exist
+ * @return the merged metadata
+ */
+ public static <C extends MappableMetaData,
+ O extends MappedMetaData<C>,
+ T extends MappableMetaDataWithOverride<C>,
+ M extends MappedMetaDataWithOverride<C, T, O>>
+ M mergeOverride(M merged, O overriden, M mapped, String context, String overridenFile, String overrideFile, boolean mustOverride)
+ {
+ if (merged == null)
+ throw new IllegalArgumentException("Null merged");
+
+ // Nothing to do
+ if (overriden == null && mapped == null)
+ return merged;
+
+ // No override
+ if (overriden == null || overriden.isEmpty())
+ {
+ if (mapped.isEmpty() == false && mustOverride)
+ throw new IllegalStateException(overridenFile + " has no " + context + "s but " + overrideFile + " has " + mapped.keySet());
+ return mapped;
+ }
+
+ // Process the originals
+ if (overriden != null)
+ {
+ for (C c : overriden)
+ {
+ // Look for an override
+ String key = c.getKey();
+ T t = null;
+ if (mapped != null)
+ t = mapped.get(key);
+
+ // No override, create one
+ if (t == null)
+ t = merged.createOverride(c);
+
+ // Return the result
+ t.setOverridenMetaData(c);
+ merged.add(t);
+ }
+ }
+
+ // Check for unprocessed
+ if (mapped != null && mapped.isEmpty() == false)
+ {
+ for (T t : mapped)
+ {
+ String key = t.getKey();
+ if (merged.get(key) == null)
+ {
+ if (mustOverride)
+ throw new IllegalStateException(key + " in " + overrideFile + ", but not in "+ overridenFile);
+ else
+ merged.createOriginal(t);
+ }
+ }
+ }
+
+ return merged;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/LanguageMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/LanguageMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/LanguageMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,129 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.metadata.annotation.AbstractAnnotationImpl;
+import org.jboss.xb.binding.Constants;
+
+/**
+ * LanguageMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class LanguageMetaData extends AbstractAnnotationImpl implements Serializable, MappableMetaData, IdMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 64867085990650156L;
+
+ /** The id */
+ private String id;
+
+ /** The language */
+ private String language = Description.DEFAULT_LANGUAGE;
+
+ /**
+ * Create a new LanguageMetaData.
+ *
+ * @param annotationType the annotation type
+ */
+ public LanguageMetaData(Class<? extends Annotation> annotationType)
+ {
+ super(annotationType);
+ }
+
+ public String language()
+ {
+ return getLanguage();
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ if (id == null)
+ throw new IllegalArgumentException("Null id");
+ this.id = id;
+ }
+
+ public String getKey()
+ {
+ return getLanguage();
+ }
+
+ /**
+ * Get the language.
+ *
+ * @return the language.
+ */
+ public String getLanguage()
+ {
+ return language;
+ }
+
+ /**
+ * Set the Langauge.
+ *
+ * @param language the language.
+ * @throws IllegalArgumentException for a null name
+ */
+ @XmlAttribute(name="lang", namespace=Constants.NS_XML_NAMESPACE)
+ public void setLanguage(String language)
+ {
+ if (language == null)
+ throw new IllegalArgumentException("Null language");
+ this.language = language;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == null || obj.getClass() == getClass() == false)
+ return false;
+ String name = getLanguage();
+ LanguageMetaData other = (LanguageMetaData) obj;
+ String otherName = other.getLanguage();
+ return name.equals(otherName);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ String name = getLanguage();
+ return name.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "{" + getLanguage() + "}";
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * MappableMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MappableMetaData
+{
+ /**
+ * The key
+ *
+ * @return return the key
+ */
+ String getKey();
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaDataWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaDataWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappableMetaDataWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * MappableMetaData with override
+ *
+ * @param <T> the overriden type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MappableMetaDataWithOverride<T extends MappableMetaData> extends MappableMetaData, OverrideMetaData<T>
+{
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedAnnotationMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedAnnotationMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedAnnotationMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,196 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.metadata.annotation.AbstractAnnotationImpl;
+
+/**
+ * MappedAnnotationMetaData.
+ *
+ * @param <T> the metadata type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class MappedAnnotationMetaData<T extends MappableMetaData> extends AbstractAnnotationImpl implements Collection<T>, Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3359670727781266839L;
+
+ /** The metaDatas */
+ private Map<String, T> map = new NonNullLinkedHashMap<String, T>();
+
+ /**
+ * Create a new MappedAnnotationMetaData
+ *
+ * @param annotationType the annotation type
+ */
+ public MappedAnnotationMetaData(Class<? extends Annotation> annotationType)
+ {
+ super(annotationType);
+ }
+
+ /**
+ * Get the metadata for the given key
+ *
+ * @param key the key
+ * @return the key
+ * @throws IllegalArgumentException for a null key
+ */
+ public T get(String key)
+ {
+ if (key == null)
+ throw new IllegalArgumentException("Null key");
+ return map.get(key);
+ }
+
+ public boolean add(T o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ String key = o.getKey();
+ if (key == null)
+ throw new IllegalArgumentException("Null key");
+
+ return map.put(key, o) == null;
+ }
+
+ public void clear()
+ {
+ map.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ return map.containsValue(o);
+ }
+
+ public Iterator<T> iterator()
+ {
+ return map.values().iterator();
+ }
+
+ public boolean remove(Object o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ if (o instanceof MappableMetaData)
+ return false;
+ MappableMetaData m = (MappableMetaData) o;
+ String key = m.getKey();
+ MappableMetaData v = map.get(key);
+ if (m.equals(v))
+ return map.remove(key) != null;
+ return false;
+ }
+
+ public int size()
+ {
+ return map.size();
+ }
+
+ public boolean addAll(Collection<? extends T> c)
+ {
+ boolean result = false;
+ for (T object : c)
+ {
+ if (add(object))
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean containsAll(Collection<?> c)
+ {
+ for (Object object : c)
+ {
+ if (contains(object) == false)
+ return false;
+ }
+ return true;
+ }
+
+ public boolean isEmpty()
+ {
+ return size() == 0;
+ }
+
+ public boolean removeAll(Collection<?> c)
+ {
+ boolean result = false;
+ for (Object object : c)
+ {
+ if (remove(object))
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean retainAll(Collection<?> c)
+ {
+ boolean result = false;
+ for (Object o : map.values())
+ {
+ if (c.contains(o))
+ {
+ if (remove(o))
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ public Object[] toArray()
+ {
+ return map.values().toArray();
+ }
+
+ public <T> T[] toArray(T[] a)
+ {
+ return map.values().toArray(a);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return map.values().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return map.values().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return map.values().toString();
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * MappedMetaData.
+ *
+ * @param <T> the mapped type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MappedMetaData<T extends MappableMetaData> extends IdMetaData, Collection<T>
+{
+ /**
+ * Get a value
+ *
+ * @param key the key
+ * @return the value
+ */
+ public T get(String key);
+
+ /**
+ * Get the key set
+ *
+ * @return the key set
+ */
+ Set<String> keySet();
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithDescriptions.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithDescriptions.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithDescriptions.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,198 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+
+/**
+ * MappedMetaData.
+ *
+ * @param <T> the metadata type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class MappedMetaDataWithDescriptions<T extends MappableMetaData> extends IdMetaDataImplWithDescriptions implements Collection<T>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5696461894017065337L;
+
+ /** The key name */
+ private String keyName;
+
+ /** The metaDatas */
+ private Map<String, T> map = new NonNullLinkedHashMap<String, T>();
+
+ /**
+ * Create a new MappedMetaData.
+ *
+ * @param keyName the key name
+ */
+ protected MappedMetaDataWithDescriptions(String keyName)
+ {
+ if (keyName == null)
+ throw new IllegalArgumentException("Null keyName");
+ this.keyName = keyName;
+ }
+
+ /**
+ * Get the metadata for the given key
+ *
+ * @param key the key
+ * @return the key
+ * @throws IllegalArgumentException for a null key
+ */
+ public T get(String key)
+ {
+ if (key == null)
+ throw new IllegalArgumentException("No " + keyName);
+ return map.get(key);
+ }
+
+ public boolean add(T o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ String key = o.getKey();
+ if (key == null)
+ throw new IllegalArgumentException("No " + keyName);
+
+ return map.put(key, o) == null;
+ }
+
+ public void clear()
+ {
+ map.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ return map.containsValue(o);
+ }
+
+ public Iterator<T> iterator()
+ {
+ return map.values().iterator();
+ }
+
+ public boolean remove(Object o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+ if (o instanceof MappableMetaData)
+ return false;
+ MappableMetaData m = (MappableMetaData) o;
+ String key = m.getKey();
+ MappableMetaData v = map.get(key);
+ if (m.equals(v))
+ return map.remove(key) != null;
+ return false;
+ }
+
+ public int size()
+ {
+ return map.size();
+ }
+
+ public boolean addAll(Collection<? extends T> c)
+ {
+ boolean result = false;
+ for (T object : c)
+ {
+ if (add(object))
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean containsAll(Collection<?> c)
+ {
+ for (Object object : c)
+ {
+ if (contains(object) == false)
+ return false;
+ }
+ return true;
+ }
+
+ public boolean isEmpty()
+ {
+ return size() == 0;
+ }
+
+ public boolean removeAll(Collection<?> c)
+ {
+ boolean result = false;
+ for (Object object : c)
+ {
+ if (remove(object))
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean retainAll(Collection<?> c)
+ {
+ boolean result = false;
+ for (Object o : map.values())
+ {
+ if (c.contains(o))
+ {
+ if (remove(o))
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ public Object[] toArray()
+ {
+ return map.values().toArray();
+ }
+
+ public <T> T[] toArray(T[] a)
+ {
+ return map.values().toArray(a);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return map.values().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return map.values().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return map.values().toString();
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MappedMetaDataWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * MappedMetaDataWithOverride.
+ *
+ * @param <C> the overriden component type
+ * @param <T> the mapped type
+ * @param <O> the overriden type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MappedMetaDataWithOverride<C extends MappableMetaData, T extends MappableMetaDataWithOverride<C>, O extends MappedMetaData<C>> extends MappedMetaData<T>, OverrideMetaData<O>
+{
+ /**
+ * Create an override metadata
+ *
+ * @param data the overridden metadata
+ * @return the override metadata
+ */
+ T createOverride(C data);
+
+ /**
+ * Create an original metadata
+ *
+ * @param data the overridden metadata
+ * @return the original
+ */
+ C createOriginal(T data);
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMappedMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMappedMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMappedMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * MergeableMappedMetaData.
+ *
+ * @param <T> the type this is mergeable
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MergeableMappedMetaData<T> extends MappableMetaData, MergeableMetaData<T>
+{
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/MergeableMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * MergeableMappedMetaData.
+ *
+ * @param <T> the type this is mergeable
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MergeableMetaData<T>
+{
+ /**
+ * Merge some metadata
+ *
+ * @param original the original
+ * @return the merged metadata
+ */
+ T merge(T original);
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedAnnotationMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedAnnotationMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedAnnotationMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,114 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+
+import org.jboss.metadata.annotation.AbstractAnnotationImpl;
+
+/**
+ * NamedAnnotationMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NamedAnnotationMetaData extends AbstractAnnotationImpl implements Serializable, MappableMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 2705312164569803721L;
+
+ /** The name */
+ private String name;
+
+ /**
+ * Create a new NamedMetaData.
+ *
+ * @param annotationType the annotation type
+ */
+ public NamedAnnotationMetaData(Class<? extends Annotation> annotationType)
+ {
+ super(annotationType);
+ }
+
+ public String getKey()
+ {
+ return getName();
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String name()
+ {
+ return name;
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name the name.
+ * @throws IllegalArgumentException for a null name
+ */
+ public void setName(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == null || obj.getClass() == getClass() == false)
+ return false;
+ String name = getName();
+ NamedAnnotationMetaData other = (NamedAnnotationMetaData) obj;
+ String otherName = other.getName();
+ return name.equals(otherName);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ String name = getName();
+ return name.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "{" + getName() + "}";
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,115 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlElement;
+
+
+/**
+ * NamedMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NamedMetaData extends IdMetaDataImpl implements MappableMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2918254376676527511L;
+
+ /** The name */
+ private String name;
+
+ public String getKey()
+ {
+ return getName();
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name the name.
+ * @throws IllegalArgumentException for a null name
+ */
+ //@SchemaProperty(mandatory=false)
+ @XmlElement(required=false)
+ public void setName(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == null || obj.getClass() == getClass() == false)
+ return false;
+ String name = getName();
+ NamedMetaData other = (NamedMetaData) obj;
+ String otherName = other.getName();
+ return name.equals(otherName);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ String name = getName();
+ if (name == null)
+ return 0;
+ return name.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "{" + getName() + "}";
+ }
+
+ /**
+ * Merge
+ *
+ * @param merged the data to merge into
+ * @param original the original data
+ * @throws IllegalArgumentException for a null merged or original
+ * @throws IllegalStateException if neither have a name
+ */
+ public void merge(NamedMetaData merged, NamedMetaData original)
+ {
+ super.merge(merged, original);
+ if (name != null)
+ merged.setName(name);
+ else if (original.name != null)
+ merged.setName(original.name);
+ else
+ throw new IllegalStateException("Neither the merged metadata " + merged + " or the original " + original + " have a name.");
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroup.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroup.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroup.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import org.jboss.javaee.metadata.spec.DescriptionGroupMetaData;
+
+/**
+ * NamedMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NamedMetaDataWithDescriptionGroup extends NamedMetaData implements MappableMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -1282107210311451130L;
+
+ /** The description */
+ private DescriptionGroupMetaData descriptionGroup;
+
+ /**
+ * Get the descriptionGroup.
+ *
+ * @return the descriptionGroup.
+ */
+ public DescriptionGroupMetaData getDescriptionGroup()
+ {
+ return descriptionGroup;
+ }
+
+ /**
+ * Set the descriptionGroup.
+ *
+ * @param descriptionGroup the descriptionGroup.
+ * @throws IllegalArgumentException for a null descriptionGroup
+ */
+ //@SchemaProperty(noInterceptor=true)
+ public void setDescriptionGroup(DescriptionGroupMetaData descriptionGroup)
+ {
+ if (descriptionGroup == null)
+ throw new IllegalArgumentException("Null descriptionGroup");
+ this.descriptionGroup = descriptionGroup;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroupWithOverride.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroupWithOverride.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptionGroupWithOverride.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+
+/**
+ * NamedMetaData.
+ *
+ * @param <T> the overriden type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NamedMetaDataWithDescriptionGroupWithOverride<T extends MappableMetaData> extends NamedMetaDataWithDescriptionGroup implements MappableMetaDataWithOverride<T>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 281861015522919956L;
+
+ /** The overriden metadata */
+ private T data;
+
+ public T getOverridenMetaData()
+ {
+ return data;
+ }
+
+ /**
+ * Get the overriden metadata
+ *
+ * @return the overriden metadata
+ * @throws IllegalStateException if there is no overriden metadata
+ */
+ public T getOverridenMetaDataWithCheck()
+ {
+ if (data == null)
+ throw new IllegalStateException("No overriden metadata");
+ return data;
+ }
+
+ //@SchemaProperty(ignore=true)
+ @XmlTransient
+ public void setOverridenMetaData(T data)
+ {
+ if (data == null)
+ throw new IllegalArgumentException("Null data");
+ this.data = data;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptions.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptions.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NamedMetaDataWithDescriptions.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.metadata.spec.DescriptionsImpl;
+
+/**
+ * NamedMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NamedMetaDataWithDescriptions extends NamedMetaData implements MappableMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8129636357927225616L;
+
+ /** The descriptions */
+ private Descriptions descriptions;
+
+ /**
+ * Get the descriptions.
+ *
+ * @return the descriptions.
+ */
+ public Descriptions getDescriptions()
+ {
+ return descriptions;
+ }
+
+ /**
+ * Set the descriptions.
+ *
+ * @param descriptions the descriptions.
+ * @throws IllegalArgumentException for a null descriptions
+ */
+ @XmlElement(name="description", type=DescriptionsImpl.class)
+ public void setDescriptions(Descriptions descriptions)
+ {
+ if (descriptions == null)
+ throw new IllegalArgumentException("Null descriptions");
+ this.descriptions = descriptions;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashMap.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashMap.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashMap.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * NonNullLinkedhashMap
+ *
+ * @param <K> the key type
+ * @param <V> the value type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonNullLinkedHashMap<K, V> extends LinkedHashMap<K, V> implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5239003812587497285L;
+
+ /**
+ * Create a new NonNullLinkedHashMap.
+ */
+ public NonNullLinkedHashMap()
+ {
+ // For serialization
+ }
+
+ @Override
+ public V put(K key, V value)
+ {
+ if (key == null)
+ throw new IllegalArgumentException("Null key");
+ if (value == null)
+ throw new IllegalArgumentException("Null value");
+ return super.put(key, value);
+ }
+
+ @Override
+ public void putAll(Map<? extends K, ? extends V> m)
+ {
+ if (m == null)
+ throw new IllegalArgumentException("Null map");
+ for (Entry<? extends K, ? extends V> entry : m.entrySet())
+ {
+ if (entry.getKey() == null)
+ throw new IllegalArgumentException("Map contains a null key: " + m);
+ if (entry.getValue() == null)
+ throw new IllegalArgumentException("Map contains a null value: " + m);
+ }
+ super.putAll(m);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSet.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSet.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSet.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+
+/**
+ * NonNullLinkedHashSet<p>
+ *
+ * Overrides LinkedHashSet to disallow null values
+ *
+ * @param <E> the element type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonNullLinkedHashSet<E> extends LinkedHashSet<E>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8065024688096621632L;
+
+ /**
+ * Create a new SimpleMappedMetaData.
+ */
+ public NonNullLinkedHashSet()
+ {
+ // For serialization
+ }
+
+ @Override
+ public boolean add(E o)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object");
+
+ return super.add(o);
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends E> c)
+ {
+ if (c == null)
+ throw new IllegalArgumentException("Null collection");
+ if (c.isEmpty())
+ return false;
+
+ for (E o : c)
+ {
+ if (o == null)
+ throw new IllegalArgumentException("Null object in " + c);
+ }
+
+ return super.addAll(c);
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSetWithId.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSetWithId.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/NonNullLinkedHashSetWithId.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+
+/**
+ * NonNullLinkedHashSet<p>
+ *
+ * Overrides LinkedHashSet to disallow null values
+ *
+ * @param <E> the element type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonNullLinkedHashSetWithId<E> extends NonNullLinkedHashSet<E> implements IdMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 3210601531294204704L;
+
+ /** The id */
+ private String id;
+
+ /**
+ * Create a new NonNullLinkedHashSetWithId
+ */
+ public NonNullLinkedHashSetWithId()
+ {
+ // For serialization
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ if (id == null)
+ throw new IllegalArgumentException("Null id");
+ this.id = id;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/OverrideMetaData.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/OverrideMetaData.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/OverrideMetaData.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+/**
+ * OverrideMetaData.
+ *
+ * @param <T> the overriden metadata type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface OverrideMetaData<T>
+{
+ /**
+ * Get the overriden metadata
+ *
+ * @return the overridden metadata
+ */
+ T getOverridenMetaData();
+
+ /**
+ * Set the overriden metadata
+ *
+ * @param data the overridden metadata
+ * @throws IllegalArgumentException for null data
+ */
+ void setOverridenMetaData(T data);
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptionGroup.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptionGroup.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptionGroup.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import org.jboss.javaee.metadata.spec.DescriptionGroupMetaData;
+import org.jboss.javaee.metadata.spec.ResourceInjectionMetaData;
+
+/**
+ * ResourceInjectionMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class ResourceInjectionMetaDataWithDescriptionGroup extends ResourceInjectionMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 5085818160192282098L;
+ /** The description group */
+ private DescriptionGroupMetaData descriptionGroup;
+
+ /**
+ * Get the descriptionGroup.
+ *
+ * @return the descriptionGroup.
+ */
+ public DescriptionGroupMetaData getDescriptionGroup()
+ {
+ return descriptionGroup;
+ }
+
+ /**
+ * Set the descriptionGroup.
+ *
+ * @param descriptionGroup the descriptionGroup.
+ * @throws IllegalArgumentException for a null descriptionGroup
+ */
+ //@SchemaProperty(noInterceptor=true)
+ public void setDescriptionGroup(DescriptionGroupMetaData descriptionGroup)
+ {
+ if (descriptionGroup == null)
+ throw new IllegalArgumentException("Null descriptionGroup");
+ this.descriptionGroup = descriptionGroup;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptions.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptions.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/javaee/metadata/support/ResourceInjectionMetaDataWithDescriptions.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.javaee.metadata.support;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.metadata.spec.DescriptionsImpl;
+import org.jboss.javaee.metadata.spec.ResourceInjectionMetaData;
+
+/**
+ * ResourceInjectionMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class ResourceInjectionMetaDataWithDescriptions extends ResourceInjectionMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3420035274417539783L;
+
+ /** The descriptions */
+ private Descriptions descriptions;
+
+ /**
+ * Get the descriptions.
+ *
+ * @return the descriptions.
+ */
+ public Descriptions getDescriptions()
+ {
+ return descriptions;
+ }
+
+ /**
+ * Set the descriptions.
+ *
+ * @param descriptions the descriptions.
+ * @throws IllegalArgumentException for a null descriptions
+ */
+ @XmlElement(name="description", type=DescriptionsImpl.class)
+ public void setDescriptions(Descriptions descriptions)
+ {
+ if (descriptions == null)
+ throw new IllegalArgumentException("Null descriptions");
+ this.descriptions = descriptions;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/AbstractJavaEEEverythingTest.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/AbstractJavaEEEverythingTest.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/AbstractJavaEEEverythingTest.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,883 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.annotation.DisplayName;
+import org.jboss.javaee.annotation.DisplayNames;
+import org.jboss.javaee.annotation.Icon;
+import org.jboss.javaee.annotation.Icons;
+import org.jboss.javaee.metadata.jboss.AnnotationMetaData;
+import org.jboss.javaee.metadata.jboss.AnnotationPropertiesMetaData;
+import org.jboss.javaee.metadata.jboss.AnnotationPropertyMetaData;
+import org.jboss.javaee.metadata.jboss.AnnotationsMetaData;
+import org.jboss.javaee.metadata.jboss.JndiRefMetaData;
+import org.jboss.javaee.metadata.jboss.JndiRefsMetaData;
+import org.jboss.javaee.metadata.spec.DescriptionGroupMetaData;
+import org.jboss.javaee.metadata.spec.DescriptionsImpl;
+import org.jboss.javaee.metadata.spec.DisplayNamesImpl;
+import org.jboss.javaee.metadata.spec.EJBLocalReferenceMetaData;
+import org.jboss.javaee.metadata.spec.EJBLocalReferencesMetaData;
+import org.jboss.javaee.metadata.spec.EJBReferenceMetaData;
+import org.jboss.javaee.metadata.spec.EJBReferenceType;
+import org.jboss.javaee.metadata.spec.EJBReferencesMetaData;
+import org.jboss.javaee.metadata.spec.EmptyMetaData;
+import org.jboss.javaee.metadata.spec.EnvironmentEntriesMetaData;
+import org.jboss.javaee.metadata.spec.EnvironmentEntryMetaData;
+import org.jboss.javaee.metadata.spec.EnvironmentRefsGroupMetaData;
+import org.jboss.javaee.metadata.spec.IconsImpl;
+import org.jboss.javaee.metadata.spec.LifecycleCallbackMetaData;
+import org.jboss.javaee.metadata.spec.LifecycleCallbacksMetaData;
+import org.jboss.javaee.metadata.spec.MessageDestinationMetaData;
+import org.jboss.javaee.metadata.spec.MessageDestinationReferenceMetaData;
+import org.jboss.javaee.metadata.spec.MessageDestinationReferencesMetaData;
+import org.jboss.javaee.metadata.spec.MessageDestinationUsageType;
+import org.jboss.javaee.metadata.spec.MessageDestinationsMetaData;
+import org.jboss.javaee.metadata.spec.PersistenceContextReferenceMetaData;
+import org.jboss.javaee.metadata.spec.PersistenceContextReferencesMetaData;
+import org.jboss.javaee.metadata.spec.PersistenceContextType;
+import org.jboss.javaee.metadata.spec.PersistenceUnitReferenceMetaData;
+import org.jboss.javaee.metadata.spec.PersistenceUnitReferencesMetaData;
+import org.jboss.javaee.metadata.spec.PropertiesMetaData;
+import org.jboss.javaee.metadata.spec.PropertyMetaData;
+import org.jboss.javaee.metadata.spec.ResourceAuthorityType;
+import org.jboss.javaee.metadata.spec.ResourceEnvironmentReferenceMetaData;
+import org.jboss.javaee.metadata.spec.ResourceEnvironmentReferencesMetaData;
+import org.jboss.javaee.metadata.spec.ResourceInjectionMetaData;
+import org.jboss.javaee.metadata.spec.ResourceInjectionTargetMetaData;
+import org.jboss.javaee.metadata.spec.ResourceReferenceMetaData;
+import org.jboss.javaee.metadata.spec.ResourceReferencesMetaData;
+import org.jboss.javaee.metadata.spec.ResourceSharingScopeType;
+import org.jboss.javaee.metadata.spec.SecurityRoleMetaData;
+import org.jboss.javaee.metadata.spec.SecurityRolesMetaData;
+import org.jboss.javaee.metadata.support.IdMetaData;
+//import org.jboss.metadata.EjbLocalRefMetaData;
+//import org.jboss.metadata.EjbRefMetaData;
+//import org.jboss.metadata.EnvEntryMetaData;
+//import org.jboss.metadata.MessageDestinationRefMetaData;
+//import org.jboss.metadata.ResourceEnvRefMetaData;
+//import org.jboss.metadata.ResourceRefMetaData;
+import org.jboss.test.javaee.metadata.AbstractJavaEEMetaDataTest;
+
+/**
+ * AbstractJavaEEEverythingTest.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractJavaEEEverythingTest extends AbstractJavaEEMetaDataTest
+{
+ public AbstractJavaEEEverythingTest(String name)
+ {
+ super(name);
+ }
+
+ protected void assertId(String prefix, Object object)
+ {
+ assertNotNull(object);
+ assertTrue(object instanceof IdMetaData);
+ IdMetaData idMetaData = (IdMetaData) object;
+ assertEquals(prefix + "-id", idMetaData.getId());
+ }
+
+ protected void fixUpId(String prefix, Object object)
+ {
+ assertNotNull(object);
+ assertTrue(object instanceof IdMetaData);
+ IdMetaData idMetaData = (IdMetaData) object;
+ idMetaData.setId(prefix + "-id");
+ }
+
+ protected void assertDescriptionGroup(String suffix, DescriptionGroupMetaData group)
+ {
+ assertNotNull(group);
+ assertDescriptions(suffix, group.getDescriptions());
+ assertDisplayNames(suffix, group.getDisplayNames());
+ assertIcons(suffix, group.getIcons());
+ }
+
+ protected void assertDescriptions(String suffix, Descriptions descriptions)
+ {
+ assertNotNull(descriptions);
+ assertTrue(descriptions instanceof DescriptionsImpl);
+ DescriptionsImpl impl = (DescriptionsImpl) descriptions;
+ assertEquals(3, impl.size());
+ assertDescription("en", suffix, impl);
+ assertDescription("fr", suffix, impl);
+ assertDescription("de", suffix, impl);
+ }
+
+ protected void assertDescription(String lang, String suffix, DescriptionsImpl impl)
+ {
+ Description description = impl.get(lang);
+ assertNotNull(description);
+ assertEquals(lang + "-" + suffix + "-desc", description.value());
+ }
+
+ protected void assertDisplayNames(String suffix, DisplayNames displayNames)
+ {
+ assertNotNull(displayNames);
+ assertTrue(displayNames instanceof DisplayNamesImpl);
+ DisplayNamesImpl impl = (DisplayNamesImpl) displayNames;
+ assertEquals(3, impl.size());
+ assertDisplayName("en", suffix, impl);
+ assertDisplayName("fr", suffix, impl);
+ assertDisplayName("de", suffix, impl);
+ }
+
+ protected void assertDisplayName(String lang, String suffix, DisplayNamesImpl impl)
+ {
+ DisplayName displayName = impl.get(lang);
+ assertNotNull(displayName);
+ assertEquals(lang + "-" + suffix + "-disp", displayName.value());
+ }
+
+ protected void assertIcons(String suffix, Icons icons)
+ {
+ assertNotNull(icons);
+ assertTrue(icons instanceof IconsImpl);
+ IconsImpl impl = (IconsImpl) icons;
+ assertEquals(3, impl.size());
+ assertIcon("en", suffix, impl);
+ assertIcon("fr", suffix, impl);
+ assertIcon("de", suffix, impl);
+ }
+
+ protected void assertIcon(String lang, String suffix, IconsImpl impl)
+ {
+ Icon icon = impl.get(lang);
+ assertNotNull(icon);
+ assertEquals(lang + "-" + suffix + "-small-icon", icon.smallIcon());
+ assertEquals(lang + "-" + suffix + "-large-icon", icon.largeIcon());
+ assertId(lang + "-" + suffix + "-icon", icon);
+ }
+
+ protected void assertClass(String prefix, String type, String className)
+ {
+ assertEquals(prefix + type, className);
+ }
+
+ protected void assertEmpty(String prefix, String type, EmptyMetaData emptyMetaData)
+ {
+ assertNotNull(emptyMetaData);
+ assertId(prefix + type, emptyMetaData);
+ }
+
+ protected void assertSecurityRoles(int size, SecurityRolesMetaData securityRolesMetaData)
+ {
+ assertNotNull(securityRolesMetaData);
+ assertEquals(size, securityRolesMetaData.size());
+ int count = 1;
+ for (SecurityRoleMetaData securityRoleMetaData : securityRolesMetaData)
+ {
+ assertSecurityRole("securityRole" + count, securityRoleMetaData);
+ ++count;
+ }
+ }
+
+ protected void assertSecurityRole(String prefix, SecurityRoleMetaData securityRoleMetaData)
+ {
+ assertNotNull(securityRoleMetaData);
+ assertId(prefix, securityRoleMetaData);
+ assertDescriptions(prefix, securityRoleMetaData.getDescriptions());
+ assertEquals(prefix + "RoleName", securityRoleMetaData.getRoleName());
+ }
+
+ protected void assertPrincipals(String prefix, int size, Set<String> principals)
+ {
+ assertNotNull(principals);
+ assertEquals(size, principals.size());
+ int count = 1;
+ for (String principal : principals)
+ {
+ assertEquals(prefix + "Principal" + count, principal);
+ ++count;
+ }
+ }
+
+/* protected void assertSecurityRoles(int size, Map<String, org.jboss.security.SecurityRoleMetaData> securityRoles)
+ {
+ assertNotNull(securityRoles);
+ assertEquals(size, securityRoles.size());
+ int count = 1;
+ for (org.jboss.security.SecurityRoleMetaData securityRoleMetaData : securityRoles.values())
+ {
+ assertSecurityRole("securityRole" + count, securityRoleMetaData);
+ ++count;
+ }
+ }
+
+ protected void assertSecurityRole(String prefix, org.jboss.security.SecurityRoleMetaData securityRole)
+ {
+ assertNotNull(securityRole);
+ assertEquals(prefix + "RoleName", securityRole.getRoleName());
+ }
+*/
+ protected void assertMessageDestinations(int size, MessageDestinationsMetaData messageDestinationsMetaData)
+ {
+ assertNotNull(messageDestinationsMetaData);
+ assertEquals(size, messageDestinationsMetaData.size());
+ int count = 1;
+ for (MessageDestinationMetaData messageDestinationMetaData : messageDestinationsMetaData)
+ {
+ assertMessageDestination("messageDestination" + count, messageDestinationMetaData);
+ ++count;
+ }
+ }
+
+ protected void fixUpMessageDestinations(int size, MessageDestinationsMetaData messageDestinationsMetaData)
+ {
+ assertEmpty(messageDestinationsMetaData);
+ for (int i = 1; i <= size; ++i)
+ {
+ MessageDestinationMetaData messageDestinationMetaData = new MessageDestinationMetaData();
+ String prefix = "messageDestination" + i;
+ fixUpId(prefix, messageDestinationMetaData);
+ messageDestinationMetaData.setMessageDestinationName(prefix + "Name");
+ messageDestinationMetaData.setMappedName(prefix + "MappedName");
+ messageDestinationsMetaData.add(messageDestinationMetaData);
+ }
+ }
+
+ protected void assertMessageDestination(String prefix, MessageDestinationMetaData messageDestinationMetaData)
+ {
+ assertMessageDestination14(prefix, messageDestinationMetaData);
+ }
+
+ protected void assertMessageDestination14(String prefix, MessageDestinationMetaData messageDestinationMetaData)
+ {
+ assertNotNull(messageDestinationMetaData);
+ assertId(prefix, messageDestinationMetaData);
+ assertDescriptionGroup(prefix, messageDestinationMetaData.getDescriptionGroup());
+ assertEquals(prefix + "Name", messageDestinationMetaData.getMessageDestinationName());
+ }
+
+ protected void assertMessageDestination50(String prefix, MessageDestinationMetaData messageDestinationMetaData)
+ {
+ assertMessageDestination14(prefix, messageDestinationMetaData);
+ assertEquals(prefix + "MappedName", messageDestinationMetaData.getMappedName());
+ }
+
+/* protected void assertMessageDestination(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
+ {
+ assertMessageDestination14(prefix, messageDestinationMetaData);
+ }
+
+ protected void assertMessageDestination14(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
+ {
+ assertNotNull(messageDestinationMetaData);
+ assertEquals(prefix + "Name", messageDestinationMetaData.getName());
+ }
+
+ protected void assertMessageDestination50(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
+ {
+ assertMessageDestination14(prefix, messageDestinationMetaData);
+ assertEquals(prefix + "MappedName", messageDestinationMetaData.getJNDIName());
+ }
+*/
+ protected void assertLifecycleCallbacks(String ejbName, String type, int size, LifecycleCallbacksMetaData lifecycleCallbacksMetaData)
+ {
+ assertNotNull(lifecycleCallbacksMetaData);
+ assertEquals(size, lifecycleCallbacksMetaData.size());
+ int count = 1;
+ for (LifecycleCallbackMetaData lifecycleCallback : lifecycleCallbacksMetaData)
+ {
+ assertEquals(ejbName + type + count + "Class", lifecycleCallback.getClassName());
+ assertEquals(ejbName + type + count + "Method", lifecycleCallback.getMethodName());
+ ++count;
+ }
+ }
+
+ protected void assertEnvironment(String prefix, EnvironmentRefsGroupMetaData environment, boolean full)
+ {
+ assertNotNull(environment);
+ if (full)
+ assertEnvEntries(prefix, 2, environment.getEnvironmentEntries(), full);
+ assertEjbRefs(prefix, 2, environment.getEjbReferences(), full);
+ assertEjbLocalRefs(prefix, 2, environment.getEjbLocalReferences(), full);
+ // TODO service-refGroup
+ assertResourceRefs(prefix, 2, environment.getResourceReferences(), full);
+ assertResourceEnvRefs(prefix, 2, environment.getResourceEnvironmentReferences(), full);
+ assertMessageDestinationRefs(prefix, 3, environment.getMessageDestinationReferences(), full);
+ if (full)
+ {
+ assertPersistenceContextRefs(prefix, 2, environment.getPersistenceContextRefs());
+ assertPersistenceUnitRefs(prefix, 2, environment.getPersistenceUnitRefs());
+ assertLifecycleCallbacks(prefix, "PostConstruct", 2, environment.getPostConstructs());
+ assertLifecycleCallbacks(prefix, "PreDestroy", 2, environment.getPreDestroys());
+ }
+ }
+
+ protected void assertNullEnvironment(EnvironmentRefsGroupMetaData environment)
+ {
+ if (environment != null)
+ {
+ assertNull(environment.getEnvironmentEntries());
+ assertNull(environment.getEjbReferences());
+ assertNull(environment.getEjbLocalReferences());
+ assertNull(environment.getServiceReferences());
+ assertNull(environment.getResourceReferences());
+ assertNull(environment.getResourceEnvironmentReferences());
+ assertNull(environment.getMessageDestinationReferences());
+ assertNull(environment.getPersistenceContextRefs());
+ assertNull(environment.getPersistenceUnitRefs());
+ assertNull(environment.getPostConstructs());
+ assertNull(environment.getPreDestroys());
+ }
+ }
+
+ private void assertEnvEntries(String prefix, int size, EnvironmentEntriesMetaData environmentEntriesMetaData, boolean full)
+ {
+ assertNotNull(environmentEntriesMetaData);
+ assertEquals(size, environmentEntriesMetaData.size());
+ int count = 1;
+ for (EnvironmentEntryMetaData environmentEntryMetaData : environmentEntriesMetaData)
+ {
+ assertId(prefix + "EnvEntry" + count, environmentEntryMetaData);
+ assertDescriptions(prefix + "EnvEntry" + count, environmentEntryMetaData.getDescriptions());
+ assertEquals(prefix + "EnvEntry" + count + "Name", environmentEntryMetaData.getEnvEntryName());
+ assertEquals(prefix + "EnvEntry" + count + "Type", environmentEntryMetaData.getType());
+ assertEquals(prefix + "EnvEntry" + count + "Value", environmentEntryMetaData.getValue());
+ assertResourceGroup(prefix + "EnvEntry" + count, environmentEntryMetaData, full, count == 1);
+ ++count;
+ }
+ }
+/*
+ protected void assertEnvEntries(String prefix, int size, Iterator<EnvEntryMetaData> envEntries, boolean full)
+ {
+ assertNotNull(envEntries);
+ int count = 1;
+ while (envEntries.hasNext())
+ {
+ EnvEntryMetaData envEntry = envEntries.next();
+ String pref = prefix + "EnvEntry" + count;
+ assertEquals(pref + "Name", envEntry.getName());
+ assertEquals(pref + "Type", envEntry.getType());
+ assertEquals(pref + "Value", envEntry.getValue());
+ ++count;
+ }
+ assertEquals(size + 1, count);
+ }
+*/
+ protected EJBReferencesMetaData fixUpEjbRefs(EJBReferencesMetaData overriden, EJBReferencesMetaData override)
+ {
+ if (override == null || override.isEmpty())
+ return null;
+
+ if (overriden == null)
+ overriden = new EJBReferencesMetaData();
+
+ for (EJBReferenceMetaData ref : override)
+ {
+ String name = ref.getName();
+ if (overriden.get(name) == null)
+ {
+ EJBReferenceMetaData r = new EJBReferenceMetaData();
+ r.setName(name);
+ overriden.add(r);
+ }
+ }
+
+ return overriden;
+ }
+
+ private void assertEjbRefs(String prefix, int size, EJBReferencesMetaData ejbReferencesMetaData, boolean full)
+ {
+ assertNotNull(ejbReferencesMetaData);
+ assertEquals(size, ejbReferencesMetaData.size());
+ int count = 1;
+ for (EJBReferenceMetaData ejbReferenceMetaData : ejbReferencesMetaData)
+ {
+ assertId(prefix + "EjbRef" + count, ejbReferenceMetaData);
+ assertDescriptions(prefix + "EjbRef" + count, ejbReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "EjbRef" + count + "Name", ejbReferenceMetaData.getEjbRefName());
+ if (full)
+ {
+ if (count == 1)
+ assertEquals(EJBReferenceType.Session, ejbReferenceMetaData.getEjbRefType());
+ else
+ assertEquals(EJBReferenceType.Entity, ejbReferenceMetaData.getEjbRefType());
+ assertEquals(prefix + "EjbRef" + count + "Home", ejbReferenceMetaData.getHome());
+ assertEquals(prefix + "EjbRef" + count + "Remote", ejbReferenceMetaData.getRemote());
+ assertEquals(prefix + "EjbRef" + count + "EjbLink", ejbReferenceMetaData.getLink());
+ }
+ assertResourceGroup(prefix + "EjbRef" + count, ejbReferenceMetaData, full, count == 1);
+ ++count;
+ }
+ }
+/*
+ protected void assertEjbRefs(String prefix, int size, Iterator<EjbRefMetaData> ejbRefs, boolean full)
+ {
+ assertNotNull(ejbRefs);
+ int count = 1;
+ while (ejbRefs.hasNext())
+ {
+ EjbRefMetaData ejbRef = ejbRefs.next();
+ String pref = prefix + "EjbRef" + count;
+ assertEquals(pref + "Name", ejbRef.getName());
+ if (full)
+ {
+ if (count == 1)
+ assertEquals("Session", ejbRef.getType());
+ else
+ assertEquals("Entity", ejbRef.getType());
+ assertEquals(pref + "Home", ejbRef.getHome());
+ assertEquals(pref + "Remote", ejbRef.getRemote());
+ assertEquals(pref + "EjbLink", ejbRef.getLink());
+ }
+ assertJndiName(pref, full, ejbRef.getJndiName());
+ ++count;
+ }
+ assertEquals(size + 1, count);
+ }
+*/
+ protected EJBLocalReferencesMetaData fixUpEjbLocalRefs(EJBLocalReferencesMetaData overriden, EJBLocalReferencesMetaData override)
+ {
+ if (override == null || override.isEmpty())
+ return null;
+
+ if (overriden == null)
+ overriden = new EJBLocalReferencesMetaData();
+
+ for (EJBLocalReferenceMetaData ref : override)
+ {
+ String name = ref.getName();
+ if (overriden.get(name) == null)
+ {
+ EJBLocalReferenceMetaData r = new EJBLocalReferenceMetaData();
+ r.setName(name);
+ overriden.add(r);
+ }
+ }
+
+ return overriden;
+ }
+
+ private void assertEjbLocalRefs(String prefix, int size, EJBLocalReferencesMetaData ejbReferencesMetaData, boolean full)
+ {
+ assertNotNull(ejbReferencesMetaData);
+ assertEquals(size, ejbReferencesMetaData.size());
+ int count = 1;
+ for (EJBLocalReferenceMetaData ejbReferenceMetaData : ejbReferencesMetaData)
+ {
+ assertId(prefix + "EjbLocalRef" + count, ejbReferenceMetaData);
+ assertDescriptions(prefix + "EjbLocalRef" + count, ejbReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "EjbLocalRef" + count + "Name", ejbReferenceMetaData.getEjbRefName());
+ if (full)
+ {
+ if (count == 1)
+ assertEquals(EJBReferenceType.Session, ejbReferenceMetaData.getEjbRefType());
+ else
+ assertEquals(EJBReferenceType.Entity, ejbReferenceMetaData.getEjbRefType());
+ assertEquals(prefix + "EjbLocalRef" + count + "LocalHome", ejbReferenceMetaData.getLocalHome());
+ assertEquals(prefix + "EjbLocalRef" + count + "Local", ejbReferenceMetaData.getLocal());
+ assertEquals(prefix + "EjbLocalRef" + count + "EjbLink", ejbReferenceMetaData.getLink());
+ }
+ assertResourceGroup(prefix + "EjbLocalRef" + count, ejbReferenceMetaData, full, count == 1);
+ ++count;
+ }
+ }
+/*
+ protected void assertEjbLocalRefs(String prefix, int size, Iterator<EjbLocalRefMetaData> ejbLocalRefs, boolean full)
+ {
+ assertNotNull(ejbLocalRefs);
+ int count = 1;
+ while (ejbLocalRefs.hasNext())
+ {
+ EjbLocalRefMetaData ejbLocalRef = ejbLocalRefs.next();
+ String pref = prefix + "EjbLocalRef" + count;
+ assertEquals(pref + "Name", ejbLocalRef.getName());
+ if (full)
+ {
+ if (count == 1)
+ assertEquals("Session", ejbLocalRef.getType());
+ else
+ assertEquals("Entity", ejbLocalRef.getType());
+ assertEquals(pref + "LocalHome", ejbLocalRef.getLocalHome());
+ assertEquals(pref + "Local", ejbLocalRef.getLocal());
+ assertEquals(pref + "EjbLink", ejbLocalRef.getLink());
+ }
+ assertJndiName(pref, full, ejbLocalRef.getJndiName());
+ ++count;
+ }
+ assertEquals(size + 1, count);
+ }
+*/
+ protected ResourceReferencesMetaData fixUpResourceRefs(ResourceReferencesMetaData overriden, ResourceReferencesMetaData override)
+ {
+ if (override == null || override.isEmpty())
+ return null;
+
+ if (overriden == null)
+ overriden = new ResourceReferencesMetaData();
+
+ for (ResourceReferenceMetaData ref : override)
+ {
+ String name = ref.getName();
+ if (overriden.get(name) == null)
+ {
+ ResourceReferenceMetaData r = new ResourceReferenceMetaData();
+ r.setName(name);
+ overriden.add(r);
+ }
+ }
+
+ return overriden;
+ }
+
+ private void assertResourceRefs(String prefix, int size, ResourceReferencesMetaData resourceReferencesMetaData, boolean full)
+ {
+ assertNotNull(resourceReferencesMetaData);
+ assertEquals(size, resourceReferencesMetaData.size());
+ int count = 1;
+ for (ResourceReferenceMetaData resourceReferenceMetaData : resourceReferencesMetaData)
+ {
+ assertId(prefix + "ResourceRef" + count, resourceReferenceMetaData);
+ assertDescriptions(prefix + "ResourceRef" + count, resourceReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "ResourceRef" + count + "Name", resourceReferenceMetaData.getResourceRefName());
+ if (full)
+ {
+ assertEquals(prefix + "ResourceRef" + count + "Type", resourceReferenceMetaData.getType());
+ if (count == 1)
+ {
+ assertEquals(ResourceAuthorityType.Application, resourceReferenceMetaData.getResAuth());
+ assertEquals(ResourceSharingScopeType.Shareable, resourceReferenceMetaData.getResSharingScope());
+ }
+ else
+ {
+ assertEquals(ResourceAuthorityType.Container, resourceReferenceMetaData.getResAuth());
+ assertEquals(ResourceSharingScopeType.Unshareable, resourceReferenceMetaData.getResSharingScope());
+ }
+ }
+ assertResourceGroup(prefix + "ResourceRef" + count, resourceReferenceMetaData, full, count == 1);
+ ++count;
+ }
+ }
+/*
+ protected void assertResourceRefs(String prefix, int size, Iterator<ResourceRefMetaData> resRefs, boolean full)
+ {
+ assertNotNull(resRefs);
+ int count = 1;
+ while (resRefs.hasNext())
+ {
+ ResourceRefMetaData resRef = resRefs.next();
+ String pref = prefix + "ResourceRef" + count;
+ assertEquals(pref + "Name", resRef.getName());
+ if (full)
+ {
+ assertEquals(pref + "Type", resRef.getType());
+ if (count == 1)
+ {
+ assertFalse(pref + "Auth", resRef.isContainerAuth());
+ assertTrue(pref + "Scope", resRef.isShareable());
+ }
+ else
+ {
+ assertTrue(pref + "Auth", resRef.isContainerAuth());
+ assertFalse(pref + "Scope", resRef.isShareable());
+ }
+ }
+ assertJndiName(pref, full, resRef.getJndiName());
+ ++count;
+ }
+ assertEquals(size + 1, count);
+ }
+*/
+ protected ResourceEnvironmentReferencesMetaData fixUpResourceEnvRefs(ResourceEnvironmentReferencesMetaData overriden, ResourceEnvironmentReferencesMetaData override)
+ {
+ if (override == null || override.isEmpty())
+ return null;
+
+ if (overriden == null)
+ overriden = new ResourceEnvironmentReferencesMetaData();
+
+ for (ResourceEnvironmentReferenceMetaData ref : override)
+ {
+ String name = ref.getName();
+ if (overriden.get(name) == null)
+ {
+ ResourceEnvironmentReferenceMetaData r = new ResourceEnvironmentReferenceMetaData();
+ r.setName(name);
+ overriden.add(r);
+ }
+ }
+
+ return overriden;
+ }
+
+ private void assertResourceEnvRefs(String prefix, int size, ResourceEnvironmentReferencesMetaData resourceEnvReferencesMetaData, boolean full)
+ {
+ assertNotNull(resourceEnvReferencesMetaData);
+ assertEquals(size, resourceEnvReferencesMetaData.size());
+ int count = 1;
+ for (ResourceEnvironmentReferenceMetaData resourceEnvReferenceMetaData : resourceEnvReferencesMetaData)
+ {
+ assertId(prefix + "ResourceEnvRef" + count, resourceEnvReferenceMetaData);
+ assertDescriptions(prefix + "ResourceEnvRef" + count, resourceEnvReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "ResourceEnvRef" + count + "Name", resourceEnvReferenceMetaData.getResourceEnvRefName());
+ if (full)
+ assertEquals(prefix + "ResourceEnvRef" + count + "Type", resourceEnvReferenceMetaData.getType());
+ assertResourceGroup(prefix + "ResourceEnvRef" + count, resourceEnvReferenceMetaData, full, count == 1);
+ ++count;
+ }
+ }
+/*
+ protected void assertResourceEnvRefs(String prefix, int size, Iterator<ResourceEnvRefMetaData> resEnvRefs, boolean full)
+ {
+ assertNotNull(resEnvRefs);
+ int count = 1;
+ while (resEnvRefs.hasNext())
+ {
+ ResourceEnvRefMetaData resRef = resEnvRefs.next();
+ String pref = prefix + "ResourceEnvRef" + count;
+ assertEquals(pref + "Name", resRef.getName());
+ if (full)
+ {
+ assertEquals(pref + "Type", resRef.getType());
+ }
+ assertJndiName(pref, full, resRef.getJndiName());
+ ++count;
+ }
+ assertEquals(size + 1, count);
+ }
+*/
+ protected MessageDestinationReferencesMetaData fixUpMessageDestinationRefs(MessageDestinationReferencesMetaData overriden, MessageDestinationReferencesMetaData override)
+ {
+ if (override == null || override.isEmpty())
+ return null;
+
+ if (overriden == null)
+ overriden = new MessageDestinationReferencesMetaData();
+
+ for (MessageDestinationReferenceMetaData ref : override)
+ {
+ String name = ref.getName();
+ if (overriden.get(name) == null)
+ {
+ MessageDestinationReferenceMetaData r = new MessageDestinationReferenceMetaData();
+ r.setName(name);
+ overriden.add(r);
+ }
+ }
+
+ return overriden;
+ }
+
+ private void assertMessageDestinationRefs(String prefix, int size, MessageDestinationReferencesMetaData messageDestinationReferencesMetaData, boolean full)
+ {
+ assertNotNull(messageDestinationReferencesMetaData);
+ assertEquals(size, messageDestinationReferencesMetaData.size());
+ int count = 1;
+ for (MessageDestinationReferenceMetaData messageDestinationReferenceMetaData : messageDestinationReferencesMetaData)
+ {
+ assertId(prefix + "MessageDestinationRef" + count, messageDestinationReferenceMetaData);
+ assertDescriptions(prefix + "MessageDestinationRef" + count, messageDestinationReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "MessageDestinationRef" + count + "Name", messageDestinationReferenceMetaData.getMessageDestinationRefName());
+ if (full)
+ {
+ assertEquals(prefix + "MessageDestinationRef" + count + "Type", messageDestinationReferenceMetaData.getType());
+ if (count == 1)
+ assertEquals(MessageDestinationUsageType.Consumes, messageDestinationReferenceMetaData.getMessageDestinationUsage());
+ else if (count == 2)
+ assertEquals(MessageDestinationUsageType.Produces, messageDestinationReferenceMetaData.getMessageDestinationUsage());
+ else
+ assertEquals(MessageDestinationUsageType.ConsumesProduces, messageDestinationReferenceMetaData.getMessageDestinationUsage());
+ assertEquals(prefix + "MessageDestinationRef" + count + "Link", messageDestinationReferenceMetaData.getLink());
+ }
+ assertResourceGroup(prefix + "MessageDestinationRef" + count, messageDestinationReferenceMetaData, full, count == 1);
+ ++count;
+ }
+ }
+/*
+ protected void assertMessageDestinationRefs(String prefix, int size, Iterator<MessageDestinationRefMetaData> refs, boolean full)
+ {
+ assertNotNull(refs);
+ int count = 1;
+ while (refs.hasNext())
+ {
+ MessageDestinationRefMetaData ref = refs.next();
+ String pref = prefix + "MessageDestinationRef" + count;
+ assertEquals(pref + "Name", ref.getRefName());
+ if (full)
+ {
+ assertEquals(pref + "Type", ref.getType());
+ if (count == 1)
+ assertEquals(MessageDestinationRefMetaData.CONSUMES, ref.getUsage());
+ else if (count == 2)
+ assertEquals(MessageDestinationRefMetaData.PRODUCES, ref.getUsage());
+ else
+ assertEquals(MessageDestinationRefMetaData.CONSUMESPRODUCES, ref.getUsage());
+ assertEquals(prefix + "MessageDestinationRef" + count + "Link", ref.getLink());
+ }
+ ++count;
+ }
+ assertEquals(size + 1, count);
+ }
+*/
+ protected void assertPersistenceContextRefs(String prefix, int size, PersistenceContextReferencesMetaData persistenceContextReferencesMetaData)
+ {
+ assertNotNull(persistenceContextReferencesMetaData);
+ assertEquals(size, persistenceContextReferencesMetaData.size());
+ int count = 1;
+ for (PersistenceContextReferenceMetaData persistenceContextReferenceMetaData : persistenceContextReferencesMetaData)
+ {
+ assertId(prefix + "PersistenceContextRef" + count, persistenceContextReferenceMetaData);
+ assertDescriptions(prefix + "PersistenceContextRef" + count, persistenceContextReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "PersistenceContextRef" + count + "Name", persistenceContextReferenceMetaData.getPersistenceContextRefName());
+ assertEquals(prefix + "PersistenceContextRef" + count + "Unit", persistenceContextReferenceMetaData.getPersistenceUnitName());
+ if (count == 1)
+ assertEquals(PersistenceContextType.Transaction, persistenceContextReferenceMetaData.getPersistenceContextType());
+ else
+ assertEquals(PersistenceContextType.Extended, persistenceContextReferenceMetaData.getPersistenceContextType());
+ assertProperties(prefix + "PersistenceContextRef" + count, 2, persistenceContextReferenceMetaData.getProperties());
+ assertResourceGroup(prefix + "PersistenceContextRef" + count, persistenceContextReferenceMetaData, true, count == 1);
+ ++count;
+ }
+ }
+
+ protected void assertPersistenceUnitRefs(String prefix, int size, PersistenceUnitReferencesMetaData persistenceUnitReferencesMetaData)
+ {
+ assertNotNull(persistenceUnitReferencesMetaData);
+ assertEquals(size, persistenceUnitReferencesMetaData.size());
+ int count = 1;
+ for (PersistenceUnitReferenceMetaData persistenceUnitReferenceMetaData : persistenceUnitReferencesMetaData)
+ {
+ assertId(prefix + "PersistenceUnitRef" + count, persistenceUnitReferenceMetaData);
+ assertDescriptions(prefix + "PersistenceUnitRef" + count, persistenceUnitReferenceMetaData.getDescriptions());
+ assertEquals(prefix + "PersistenceUnitRef" + count + "Name", persistenceUnitReferenceMetaData.getPersistenceUnitRefName());
+ assertEquals(prefix + "PersistenceUnitRef" + count + "Unit", persistenceUnitReferenceMetaData.getPersistenceUnitName());
+ assertResourceGroup(prefix + "PersistenceUnitRef" + count, persistenceUnitReferenceMetaData, true, count == 1);
+ ++count;
+ }
+ }
+
+ private void assertProperties(String prefix, int size, PropertiesMetaData propertiesMetaData)
+ {
+ assertNotNull(propertiesMetaData);
+ assertEquals(size, propertiesMetaData.size());
+ int count = 1;
+ for (PropertyMetaData property : propertiesMetaData)
+ {
+ assertId(prefix + "Property" + count, property);
+ assertEquals(prefix + "Property" + count + "Name", property.getName());
+ assertEquals(prefix + "Property" + count + "Value", property.getValue());
+ ++count;
+ }
+ }
+
+ protected void assertResourceGroupNoJndiName(String prefix, ResourceInjectionMetaData resourceInjectionMetaData, boolean full, boolean first)
+ {
+ assertNotNull(resourceInjectionMetaData);
+ assertResourceInjectionTargets(prefix, 2, resourceInjectionMetaData.getInjectionTargets());
+ }
+
+ protected void assertResourceGroup(String prefix, ResourceInjectionMetaData resourceInjectionMetaData, boolean full, boolean first)
+ {
+ assertResourceGroupJndiName(prefix, resourceInjectionMetaData, full, first);
+ }
+
+ private void assertResourceGroupJndiName(String prefix, ResourceInjectionMetaData resourceInjectionMetaData, boolean full, boolean first)
+ {
+ assertResourceGroupNoJndiName(prefix, resourceInjectionMetaData, full, first);
+ assertJndiName(prefix, full, resourceInjectionMetaData.getMappedName());
+ }
+
+ protected void assertResourceInjectionTargets(String prefix, int size, Set<ResourceInjectionTargetMetaData> targets)
+ {
+ assertNotNull(targets);
+ assertEquals(targets.toString(), size, targets.size());
+ int count = 1;
+ for (ResourceInjectionTargetMetaData target : targets)
+ {
+ assertResourceInjectionTarget(prefix + "Injection" + count, target);
+ ++count;
+ }
+ }
+
+ protected void assertResourceInjectionTarget(String prefix, ResourceInjectionTargetMetaData target)
+ {
+ assertNotNull(target);
+ assertEquals(prefix + "Class", target.getInjectionTargetClass());
+ assertEquals(prefix + "Name", target.getInjectionTargetName());
+ }
+
+ protected void assertJndiName(String prefix, boolean full, String jndiName)
+ {
+ assertNotNull(jndiName);
+ if (full)
+ assertEquals(prefix + "MappedName", jndiName);
+ else
+ assertEquals(prefix + "JndiName", jndiName);
+ }
+
+ protected void assertAnnotations(String prefix, int size, AnnotationsMetaData annotationsMetaData)
+ {
+ assertNotNull(annotationsMetaData);
+ assertEquals(size, annotationsMetaData.size());
+ int count = 1;
+ for (AnnotationMetaData annotation : annotationsMetaData)
+ {
+ assertId(prefix + "Annotation" + count, annotation);
+ assertDescriptions(prefix + "Annotation" + count, annotation.getDescriptions());
+ assertEquals(prefix + "Annotation" + count + "Class", annotation.getAnnotationClass());
+ assertEquals(prefix + "Annotation" + count + "Impl", annotation.getAnnotationImplementationClass());
+ assertResourceInjectionTarget(prefix + "Annotation" + count + "InjectionTarget", annotation.getInjectionTarget());
+ assertAnnotationProperties(prefix + "Annotation" + count, 2, annotation.getProperties());
+ ++count;
+ }
+ }
+
+ private void assertAnnotationProperties(String prefix, int size, AnnotationPropertiesMetaData annotationPropertiesMetaData)
+ {
+ assertNotNull(annotationPropertiesMetaData);
+ assertEquals(size, annotationPropertiesMetaData.size());
+ int count = 1;
+ for (AnnotationPropertyMetaData annotationProperty : annotationPropertiesMetaData)
+ {
+ assertId(prefix + "Property" + count, annotationProperty);
+ assertDescriptions(prefix + "Property" + count, annotationProperty.getDescriptions());
+ assertEquals(prefix + "Property" + count + "Name", annotationProperty.getPropertyName());
+ assertEquals(prefix + "Property" + count + "Value", annotationProperty.getPropertyValue());
+ ++count;
+ }
+ }
+
+ protected void assertJndiRefs(String prefix, int size, JndiRefsMetaData jndiRefsMetaData)
+ {
+ assertNotNull(jndiRefsMetaData);
+ assertEquals(size, jndiRefsMetaData.size());
+ int count = 1;
+ for (JndiRefMetaData jndiRef : jndiRefsMetaData)
+ {
+ assertId(prefix + "JndiRef" + count, jndiRef);
+ assertDescriptions(prefix + "JndiRef" + count, jndiRef.getDescriptions());
+ assertEquals(prefix + "JndiRef" + count + "Name", jndiRef.getJndiRefName());
+ assertResourceGroupJndiName(prefix + "JndiRef" + count, jndiRef, true, count == 1);
+ ++count;
+ }
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/JavaEETestSuite.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/JavaEETestSuite.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/JavaEETestSuite.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee;
+
+import org.jboss.test.javaee.metadata.test.JavaEEMetaDataTestSuite;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * JavaEE Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.8 $
+ */
+public class JavaEETestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JavaEE Tests");
+
+ suite.addTest(JavaEEMetaDataTestSuite.suite());
+
+ return suite;
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/AbstractJavaEEMetaDataTest.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,285 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata;
+
+import java.lang.annotation.Annotation;
+import java.net.URL;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.jboss.javaee.metadata.spec.JavaEEMetaDataConstants;
+import org.jboss.test.AbstractTestCaseWithSetup;
+import org.jboss.test.AbstractTestDelegate;
+
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.w3c.dom.ls.LSInput;
+
+
+/**
+ * A JavaEE metadata Test.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.2 $
+ */
+public abstract class AbstractJavaEEMetaDataTest extends AbstractTestCaseWithSetup
+{
+ /**
+ * Create a new JavaEEMetaDataTest.
+ *
+ * @param name the test name
+ */
+ public AbstractJavaEEMetaDataTest(String name)
+ {
+ super(name);
+ }
+
+ public static SchemaBindingResolver initResolverJavaEE(Class<?> clazz, String xsd)
+ {
+ DefaultSchemaResolver resolver = initResolverJavaEE(clazz);
+ String xsdPath = findXSD(xsd);
+ resolver.addSchemaLocation(JavaEEMetaDataConstants.JAVAEE_NS, xsdPath);
+ return resolver;
+ }
+
+ public static DefaultSchemaResolver initResolverJavaEE(Class<?> clazz)
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ SchemaBindingInitializer initializer = JBossXBBuilder.newInitializer(clazz);
+ resolver.addSchemaInitializer(JavaEEMetaDataConstants.JAVAEE_NS, initializer);
+ resolver.addSchemaParseAnnotations(JavaEEMetaDataConstants.JAVAEE_NS, Boolean.FALSE);
+ return resolver;
+ }
+
+ public static DefaultSchemaResolver initResolverJ2EE(Class<?> clazz)
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ SchemaBindingInitializer initializer = JBossXBBuilder.newInitializer(clazz);
+ resolver.addSchemaInitializer(JavaEEMetaDataConstants.J2EE_NS, initializer);
+ resolver.addSchemaParseAnnotations(JavaEEMetaDataConstants.J2EE_NS, Boolean.FALSE);
+ return resolver;
+ }
+
+ /**
+ * Setup the test delegate
+ *
+ * @param clazz the class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ {
+ return new JavaEEMetaDataTestDelegate(clazz);
+ }
+
+ protected JavaEEMetaDataTestDelegate getJavaEEMetaDataDelegate()
+ {
+ return (JavaEEMetaDataTestDelegate) getDelegate();
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param <T> the expected type
+ * @param expected the expected type
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected <T> T unmarshal(Class<T> expected) throws Exception
+ {
+ String name = getClass().getSimpleName();
+ int index = name.lastIndexOf("UnitTestCase");
+ if (index != -1)
+ name = name.substring(0, index);
+ name = name + "_" + getName() + ".xml";
+ return unmarshal(name, expected, null);
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param <T> the expected type
+ * @param expected the expected type
+ * @param resolver the resolver
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected <T> T unmarshal(Class<T> expected, SchemaBindingResolver resolver) throws Exception
+ {
+ String name = getClass().getSimpleName();
+ int index = name.lastIndexOf("UnitTestCase");
+ if (index != -1)
+ name = name.substring(0, index);
+ name = name + "_" + getName() + ".xml";
+ return unmarshal(name, expected, resolver);
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param <T> the expected type
+ * @param name the name
+ * @param expected the expected type
+ * @param resolver the resolver
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected <T> T unmarshal(String name, Class<T> expected, SchemaBindingResolver resolver) throws Exception
+ {
+ Object object = unmarshal(name, resolver);
+ if (object == null)
+ fail("No object from " + name);
+ assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass()));
+ return expected.cast(object);
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param name the name
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected Object unmarshal(String name) throws Exception
+ {
+ return unmarshal(name, (SchemaBindingResolver) null);
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param name the name
+ * @param resolver the resolver
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected Object unmarshal(String name, SchemaBindingResolver resolver) throws Exception
+ {
+ String url = findXML(name);
+ return getJavaEEMetaDataDelegate().unmarshal(url, resolver);
+ }
+
+ /**
+ * Find the xml
+ *
+ * @param name the name
+ * @return the url of the xml
+ */
+ protected String findXML(String name)
+ {
+ URL url = getResource(name);
+ if (url == null)
+ fail(name + " not found");
+ return url.toString();
+ }
+
+ /**
+ * Find the xml
+ *
+ * @param name the name
+ * @return the url of the xml
+ */
+ protected static String findXSD(String name)
+ {
+ URL url = findResource(AbstractJavaEEMetaDataTest.class, "test" +"/" + name);
+ if (url == null)
+ fail(name + " not found");
+ return url.toString();
+ }
+
+ protected static SchemaBindingResolver schemaResolverForClass(final Class root)
+ {
+ return new SchemaBindingResolver()
+ {
+ public String getBaseURI()
+ {
+ return null;
+ }
+
+ public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
+ {
+ return JBossXBBuilder.build(root);
+ }
+
+ public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
+ {
+ return null;
+ }
+
+ public void setBaseURI(String baseURI)
+ {
+ }
+ };
+ }
+
+ protected static SchemaBindingResolver schemaResolverForElement(final QName rootQName, final Class<?> rootType)
+ {
+ return new SchemaBindingResolver()
+ {
+ public String getBaseURI()
+ {
+ return null;
+ }
+
+ public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
+ {
+ XmlType xmlType = rootType.getAnnotation(XmlType.class);
+ if(xmlType == null)
+ {
+ fail("The root type is expected to be annotated with XmlType: " + rootType);
+ }
+
+ SchemaBinding schema = JBossXBBuilder.build(rootType);
+ String typeNs = xmlType.namespace();
+ if(typeNs.equals(JBossXmlConstants.DEFAULT))
+ {
+ typeNs = (String) schema.getNamespaces().iterator().next();
+ }
+ QName typeName = new QName(typeNs, xmlType.name());
+ TypeBinding type = schema.getType(typeName);
+ if(type == null)
+ {
+ fail("Type " + typeName + " not found in the schema!");
+ }
+
+ schema.addElement(rootQName, type);
+
+ return schema;
+ }
+
+ public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
+ {
+ return null;
+ }
+
+ public void setBaseURI(String baseURI)
+ {
+ }
+ };
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/JavaEEMetaDataTestDelegate.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata;
+
+import java.lang.reflect.Method;
+
+import org.jboss.test.xb.builder.JBossXBTestDelegate;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * JBossXBTestDelegate.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40492 $
+ */
+public class JavaEEMetaDataTestDelegate extends JBossXBTestDelegate
+{
+ /**
+ * Create a new JavaEEMetaDataTestDelegate.
+ *
+ * @param clazz the test class
+ */
+ public JavaEEMetaDataTestDelegate(Class<?> clazz)
+ {
+ super(clazz);
+ }
+
+ protected void initResolver() throws Exception
+ {
+ Class test = clazz;
+ while (test != null)
+ {
+ try
+ {
+ Method method = test.getMethod("initResolver", null);
+ defaultResolver = (SchemaBindingResolver) method.invoke(null, null);
+ return;
+ }
+ catch (NoSuchMethodException ignored)
+ {
+ }
+ test = test.getSuperclass();
+ }
+ defaultResolver = new DefaultSchemaResolver();
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionGroupUnitTestCase.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionGroupUnitTestCase.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionGroupUnitTestCase.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,137 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata.test;
+
+
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import junit.framework.Test;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.annotation.Descriptions;
+import org.jboss.javaee.annotation.DisplayName;
+import org.jboss.javaee.annotation.DisplayNames;
+import org.jboss.javaee.annotation.Icon;
+import org.jboss.javaee.annotation.Icons;
+import org.jboss.javaee.metadata.spec.DescriptionGroupMetaData;
+import org.jboss.javaee.metadata.spec.DescriptionImpl;
+import org.jboss.javaee.metadata.spec.DisplayNameImpl;
+import org.jboss.javaee.metadata.spec.IconImpl;
+import org.jboss.test.javaee.metadata.AbstractJavaEEMetaDataTest;
+import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * DescriptionGroupUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DescriptionGroupUnitTestCase extends AbstractJavaEEMetaDataTest
+{
+ public static Test suite()
+ {
+ return suite(DescriptionGroupUnitTestCase.class);
+ }
+
+ public static SchemaBindingResolver initResolver()
+ {
+ return schemaResolverForClass(DescriptionsElement.class);
+ //return AbstractJavaEEMetaDataTest.initResolverJavaEE(DescriptionsElement.class, "Description.xsd");
+ }
+
+ public DescriptionGroupUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected void configureLogging()
+ {
+ //enableTrace("org.jboss.xb");
+ //enableTrace("org.jboss.xb.builder");
+ }
+
+ public void testDescriptionDefaultLanguage() throws Exception
+ {
+ DescriptionsElement result = unmarshal(DescriptionsElement.class);
+
+ DescriptionGroupMetaData group = result.getDescriptionGroup();
+ assertNotNull(group);
+ Descriptions descriptions = group.getDescriptions();
+ assertNotNull(descriptions);
+
+ DescriptionImpl hello = new DescriptionImpl();
+ hello.setDescription("Hello");
+ assertEquals(new Description[] { hello }, descriptions.value());
+ }
+
+ public void testDisplayNameDefaultLanguage() throws Exception
+ {
+ DescriptionsElement result = unmarshal(DescriptionsElement.class);
+ DescriptionGroupMetaData group = result.getDescriptionGroup();
+ assertNotNull(group);
+ DisplayNames displayNames = group.getDisplayNames();
+ assertNotNull(displayNames);
+
+ DisplayNameImpl hello = new DisplayNameImpl();
+ hello.setDisplayName("Hello");
+ assertEquals(new DisplayName[] { hello }, displayNames.value());
+ }
+
+ public void testIconDefaultLanguage() throws Exception
+ {
+ DescriptionsElement result = unmarshal(DescriptionsElement.class);
+ DescriptionGroupMetaData group = result.getDescriptionGroup();
+ assertNotNull(group);
+ Icons icons = group.getIcons();
+ assertNotNull(icons);
+
+ IconImpl icon = new IconImpl();
+ icon.setSmallIcon("small");
+ icon.setLargeIcon("large");
+ assertEquals(new Icon[] { icon }, icons.value());
+ }
+
+ @JBossXmlSchema(
+ ignoreUnresolvedFieldOrClass=false,
+ namespace="http://java.sun.com/xml/ns/javaee",
+ elementFormDefault=XmlNsForm.QUALIFIED)
+ //@SchemaElement(name="descriptions")
+ @XmlRootElement(name="descriptions", namespace="http://java.sun.com/xml/ns/javaee")
+ public static class DescriptionsElement
+ {
+ private DescriptionGroupMetaData descriptionGroup;
+
+ public DescriptionGroupMetaData getDescriptionGroup()
+ {
+ return descriptionGroup;
+ }
+
+ public void setDescriptionGroup(DescriptionGroupMetaData descriptionGroup)
+ {
+ if (descriptionGroup == null)
+ throw new IllegalArgumentException("Null descriptionGroup");
+ this.descriptionGroup = descriptionGroup;
+ }
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionUnitTestCase.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionUnitTestCase.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DescriptionUnitTestCase.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,70 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata.test;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.metadata.spec.DescriptionImpl;
+import org.jboss.test.javaee.metadata.AbstractJavaEEMetaDataTest;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * DescriptionUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DescriptionUnitTestCase extends AbstractJavaEEMetaDataTest
+{
+ public static Test suite()
+ {
+ return suite(DescriptionUnitTestCase.class);
+ }
+
+ public static SchemaBindingResolver initResolver()
+ {
+ return schemaResolverForElement(new QName("http://java.sun.com/xml/ns/javaee", "description"), DescriptionImpl.class);
+ //return AbstractJavaEEMetaDataTest.initResolverJavaEE(DescriptionImpl.class, "Description.xsd");
+ }
+
+ public DescriptionUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDefaultLanguage() throws Exception
+ {
+ Description description = unmarshal(Description.class);
+ assertEquals("Hello", description.value());
+ assertEquals(Description.DEFAULT_LANGUAGE, description.language());
+ }
+
+ public void testNonDefaultLanguage() throws Exception
+ {
+ Description description = unmarshal(Description.class);
+ assertEquals("Bonjour", description.value());
+ assertEquals("fr", description.language());
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DisplayNameUnitTestCase.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DisplayNameUnitTestCase.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/DisplayNameUnitTestCase.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata.test;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.annotation.DisplayName;
+import org.jboss.javaee.metadata.spec.DisplayNameImpl;
+import org.jboss.test.javaee.metadata.AbstractJavaEEMetaDataTest;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * DisplayNameUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DisplayNameUnitTestCase extends AbstractJavaEEMetaDataTest
+{
+ public static Test suite()
+ {
+ return suite(DisplayNameUnitTestCase.class);
+ }
+
+ public static SchemaBindingResolver initResolver()
+ {
+ return schemaResolverForElement(new QName("http://java.sun.com/xml/ns/javaee", "displayName"), DisplayNameImpl.class);
+ //return AbstractJavaEEMetaDataTest.initResolverJavaEE(DisplayNameImpl.class, "Description.xsd");
+ }
+
+ public DisplayNameUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDefaultLanguage() throws Exception
+ {
+ DisplayName displayName = unmarshal(DisplayName.class);
+ assertEquals("Goodbye", displayName.value());
+ assertEquals(Description.DEFAULT_LANGUAGE, displayName.language());
+ }
+
+ public void testNonDefaultLanguage() throws Exception
+ {
+ DisplayName displayName = unmarshal(DisplayName.class);
+ assertEquals("Au revoir", displayName.value());
+ assertEquals("fr", displayName.language());
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/IconUnitTestCase.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/IconUnitTestCase.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/IconUnitTestCase.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata.test;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.javaee.annotation.Description;
+import org.jboss.javaee.annotation.Icon;
+import org.jboss.javaee.metadata.spec.IconImpl;
+import org.jboss.test.javaee.metadata.AbstractJavaEEMetaDataTest;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * IconUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class IconUnitTestCase extends AbstractJavaEEMetaDataTest
+{
+ public static Test suite()
+ {
+ return suite(IconUnitTestCase.class);
+ }
+
+ public static SchemaBindingResolver initResolver()
+ {
+ return schemaResolverForElement(new QName("icon"), IconImpl.class);
+ //return AbstractJavaEEMetaDataTest.initResolverJavaEE(IconImpl.class, "Description.xsd");
+ }
+
+ public IconUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDefaultLanguage() throws Exception
+ {
+ Icon icon = unmarshal(Icon.class);
+ assertEquals("small", icon.smallIcon());
+ assertEquals("large", icon.largeIcon());
+ assertEquals(Description.DEFAULT_LANGUAGE, icon.language());
+ }
+
+ public void testNonDefaultLanguage() throws Exception
+ {
+ enableTrace("org.jboss.xb");
+ Icon icon = unmarshal(Icon.class);
+ assertEquals("petite", icon.smallIcon());
+ assertEquals("grand", icon.largeIcon());
+ assertEquals("fr", icon.language());
+ }
+}
Added: jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/JavaEEMetaDataTestSuite.java
===================================================================
--- jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/JavaEEMetaDataTestSuite.java (rev 0)
+++ jbossxb-builder/trunk/src/test/java/org/jboss/test/javaee/metadata/test/JavaEEMetaDataTestSuite.java 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.javaee.metadata.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * JavaEE Metadata Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.8 $
+ */
+public class JavaEEMetaDataTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JavaEE Metadata Tests");
+
+ suite.addTest(DescriptionUnitTestCase.suite());
+ suite.addTest(DisplayNameUnitTestCase.suite());
+ suite.addTest(IconUnitTestCase.suite());
+ suite.addTest(DescriptionGroupUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDescriptionDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDescriptionDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDescriptionDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<descriptions xmlns="http://java.sun.com/xml/ns/javaee">
+ <description>Hello</description>
+</descriptions>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDisplayNameDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDisplayNameDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testDisplayNameDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<descriptions xmlns="http://java.sun.com/xml/ns/javaee">
+ <display-name>Hello</display-name>
+</descriptions>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testIconDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testIconDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DescriptionGroup_testIconDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<descriptions xmlns="http://java.sun.com/xml/ns/javaee">
+ <icon>
+ <small-icon>small</small-icon>
+ <large-icon>large</large-icon>
+ </icon>
+</descriptions>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<description xmlns="http://java.sun.com/xml/ns/javaee">Hello</description>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testNonDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testNonDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Description_testNonDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<description xmlns="http://java.sun.com/xml/ns/javaee" xml:lang="fr">Bonjour</description>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<displayName xmlns="http://java.sun.com/xml/ns/javaee">Goodbye</displayName>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testNonDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testNonDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/DisplayName_testNonDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<displayName xmlns="http://java.sun.com/xml/ns/javaee" xml:lang="fr">Au revoir</displayName>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<icon>
+ <small-icon>small</small-icon>
+ <large-icon>large</large-icon>
+</icon>
\ No newline at end of file
Added: jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testNonDefaultLanguage.xml
===================================================================
--- jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testNonDefaultLanguage.xml (rev 0)
+++ jbossxb-builder/trunk/src/test/resources/org/jboss/test/javaee/metadata/test/Icon_testNonDefaultLanguage.xml 2007-07-18 13:38:52 UTC (rev 2448)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<icon xml:lang="fr">
+ <small-icon>petite</small-icon>
+ <large-icon>grand</large-icon>
+</icon>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list