[jboss-svn-commits] JBoss Common SVN: r4142 - in jbossxb/trunk/src: main/java/org/jboss/xb/builder and 8 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Mar 10 09:47:12 EST 2010


Author: alex.loubyansky at jboss.com
Date: 2010-03-10 09:47:10 -0500 (Wed, 10 Mar 2010)
New Revision: 4142

Added:
   jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlAccessMode.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeGroupOverride.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeTypeOverride.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeGroupOverride.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeTypeOverride.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeGroupOverride.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeTypeOverride.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelAllAccessMode.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPropertyAccessMode.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPublicMemberAccessMode.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SomeType.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverrideUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverrideUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverrideUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverrideUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverrideUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverrideUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessModeUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessModeUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessModeUnitTestCase.java
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverride.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverride.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverride.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverride.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverride.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverride.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessMode.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessMode.xml
   jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessMode.xml
Modified:
   jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlModelGroup.java
   jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java
   jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlType.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java
Log:
JBXB-241

Added: jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlAccessMode.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlAccessMode.java	                        (rev 0)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlAccessMode.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, 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.xb.annotations;
+
+/**
+ * A JBossXmlPropertyAccessMode.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public enum JBossXmlAccessMode
+{
+   // not specified which means it will inherit the value from somewhere else depending on the context
+   NOT_SPECIFIED,
+   
+   // equivalent to javax.xml.bind.annotation.XmlAccessType.PROPERTY and org.jboss.beans.info.spi.BeanAccessMode.STANDARD
+   PROPERTY,
+   
+   // equivalent to javax.xml.bind.annotation.XmlAccessType.PUBLIC_MEMBER and org.jboss.beans.info.spi.BeanAccessMode.FIELD 
+   PUBLIC_MEMBER,
+   
+   // org.jboss.beans.info.spi.BeanAccessMode.ALL
+   ALL
+}

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlModelGroup.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlModelGroup.java	2010-03-09 14:15:08 UTC (rev 4141)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlModelGroup.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -50,6 +50,8 @@
     */
    String[] propOrder() default {""};
    
+   JBossXmlAccessMode accessMode() default JBossXmlAccessMode.NOT_SPECIFIED;
+   
    /**
     * Used when a model group is bound to a class hierarchy,
     * i.e. each subclass of the class annotated with JBossXmlModelGroup

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java	2010-03-09 14:15:08 UTC (rev 4141)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlSchema.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -67,4 +67,6 @@
    
    /** Whether to trim string values */
    boolean normalizeSpace() default false;
+   
+   JBossXmlAccessMode accessMode() default JBossXmlAccessMode.PROPERTY;
 }

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlType.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlType.java	2010-03-09 14:15:08 UTC (rev 4141)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/annotations/JBossXmlType.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -50,4 +50,6 @@
     * @return  model group type which should be used for the xml type
     */
    String modelGroup() default JBossXmlConstants.DEFAULT;
+   
+   JBossXmlAccessMode accessMode() default JBossXmlAccessMode.NOT_SPECIFIED;
 }

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java	2010-03-09 14:15:08 UTC (rev 4141)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBBuilder.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -29,6 +29,7 @@
 
 import javax.xml.XMLConstants;
 
+import org.jboss.beans.info.spi.BeanAccessMode;
 import org.jboss.config.plugins.property.PropertyConfiguration;
 import org.jboss.config.spi.Configuration;
 import org.jboss.reflect.spi.ClassInfo;
@@ -57,16 +58,29 @@
  */
 public class JBossXBBuilder
 {
-   /** system property name to use for initialization */
+   /** system property name to use for initialization
+    * whether to use unordered sequences as the default sequence type during binding
+    */
    public static final String USE_UNORDERED_SEQUENCE_PROPERTY = "xb.builder.useUnorderedSequence";
 
-   /** system property name to use for initialization */
+   /** system property name to use for initialization
+    * whether to enforce the presence of propOrder in XmlType annotation when content of the type is bound to a sequence
+    */
    public static final String SEQUENCES_REQUIRE_PROP_ORDER = "xb.builder.sequencesRequirePropOrder";
 
-   /** system property name to use for initialization */
+   /** system property name to use for initialization
+    * General purpose handlers in setParent do a map<QName, PropertyHandler>.get(QName) to find the correct
+    * property handler to add the child to the parent. In case of non-global elements/groups we know the parent
+    * and the property from the beginning (during binding), so these terms could have a handler that would use
+    * the property directly.
+    */
    public static final String ELEMENT_SET_PARENT_OVERRIDE_HANDLER = "xb.builder.elementSetParentOverrideHandler";
 
-   /** system property name to use for initialization */
+   /** system property name to use for initialization
+    * Used for collection or array properties. To avoid calling property getter to get the collection value
+    * and then add the just unmarshalled item, all the items could be collected first instead and then property
+    * setter could be called to set the final value. This is what repeatable particle handlers do.
+    */
    public static final String REPEATABLE_PARTICLE_HANDLERS = "xb.builder.repeatableParticleHandlers";
 
    /** The configuration */

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2010-03-09 14:15:08 UTC (rev 4141)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -55,6 +55,7 @@
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
 
+import org.jboss.beans.info.spi.BeanAccessMode;
 import org.jboss.beans.info.spi.BeanInfo;
 import org.jboss.beans.info.spi.PropertyInfo;
 import org.jboss.joinpoint.plugins.Config;
@@ -88,6 +89,7 @@
 import org.jboss.xb.annotations.JBossXmlNoElements;
 import org.jboss.xb.annotations.JBossXmlNsPrefix;
 import org.jboss.xb.annotations.JBossXmlPreserveWhitespace;
+import org.jboss.xb.annotations.JBossXmlAccessMode;
 import org.jboss.xb.annotations.JBossXmlSchema;
 import org.jboss.xb.annotations.JBossXmlTransient;
 import org.jboss.xb.annotations.JBossXmlTransients;
@@ -191,6 +193,8 @@
    private boolean elementSetParentHandler;
    private boolean repeatableParticleHandlers;
 
+   private BeanAccessMode beanAccessMode = BeanAccessMode.STANDARD;
+   
    /** transient property names by type name */
    private Map<String, Set<String>> jbossXmlTransients = Collections.emptyMap();
    
@@ -251,7 +255,7 @@
    {
       this.repeatableParticleHandlers = repeatableParticleHandlers;
    }
-
+   
    /**
     * Build the schema
     * 
@@ -371,8 +375,22 @@
             }
          }
       }
+      
+      if(jbossXmlSchema != null)
+         beanAccessMode = jbossXmlAccessModeToBeanAccessMode(jbossXmlSchema.accessMode());
    }
 
+   private static BeanAccessMode jbossXmlAccessModeToBeanAccessMode(JBossXmlAccessMode accessMode)
+   {
+      if (accessMode == JBossXmlAccessMode.ALL)
+         return BeanAccessMode.ALL;
+      else if (accessMode == JBossXmlAccessMode.PROPERTY)
+         return BeanAccessMode.STANDARD;
+      else if (accessMode == JBossXmlAccessMode.PUBLIC_MEMBER)
+         return BeanAccessMode.FIELDS;
+      throw new IllegalArgumentException("Unsupported JBossXmlAccessMode: " + accessMode);
+   }
+   
    /**
     * Create the root elements
     */
@@ -713,7 +731,7 @@
       Class<? extends ValueAdapter> adapter = annotation.valueAdapter();
       try
       {
-         BeanInfo adapterInfo = JBossXBBuilder.configuration.getBeanInfo(adapter);
+         BeanInfo adapterInfo = JBossXBBuilder.configuration.getBeanInfo(adapter, beanAccessMode);
 
          ValueAdapter valueAdapter = (ValueAdapter) adapterInfo.newInstance();
 
@@ -871,10 +889,16 @@
          factoryMethod = xmlType.factoryMethod();
          propertyOrder = xmlType.propOrder();
       }
+      
+      BeanAccessMode beanAccessMode = this.beanAccessMode;
       JBossXmlType jbossXmlType = typeInfo.getUnderlyingAnnotation(JBossXmlType.class);
+      
       if (jbossXmlType != null)
       {
          beanAdapterBuilderClass = jbossXmlType.beanAdapterBuilder();
+         JBossXmlAccessMode accessMode = jbossXmlType.accessMode();
+         if(accessMode != JBossXmlAccessMode.NOT_SPECIFIED)
+            beanAccessMode = jbossXmlAccessModeToBeanAccessMode(accessMode);
       }
       // Determine the property access order
       XmlAccessorOrder accessorOrder = typeInfo.getUnderlyingAnnotation(XmlAccessorOrder.class);
@@ -919,7 +943,7 @@
          factory = Config.findMethodInfo(factoryClassInfo, factoryMethod, null, true, true);
 
       // Create the handler
-      BeanInfo beanInfo = JBossXBBuilder.configuration.getBeanInfo(typeInfo);
+      BeanInfo beanInfo = JBossXBBuilder.configuration.getBeanInfo(typeInfo, beanAccessMode);
       BeanAdapterFactory beanAdapterFactory = createAdapterFactory(beanAdapterBuilderClass, beanInfo, factory);
       BeanHandler handler = new BeanHandler(beanInfo.getName(), beanAdapterFactory, typeBinding);
       typeBinding.setHandler(handler);
@@ -1333,7 +1357,7 @@
          {
             if (childWildcard.wrapper() != Object.class)
             {
-               BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(childWildcard.wrapper());
+               BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(childWildcard.wrapper(), beanAccessMode);
                childWildcardHandler = new ChildCollectionWildcardHandler(wrapperInfo, childWildcard.property());
             }
             else
@@ -1614,7 +1638,7 @@
             JBossXmlGroupText groupText = ((ClassInfo) propertyType).getUnderlyingAnnotation(JBossXmlGroupText.class);
             if (groupText != null && groupText.wrapper() != Object.class)
             {
-               BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(groupText.wrapper());
+               BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(groupText.wrapper(), beanAccessMode);
                TypeBinding wrapperTypeBinding = resolveTypeBinding(wrapperInfo.getClassInfo());
 
                ParticleHandler particleHandler = wrapperTypeBinding.getHandler();
@@ -1668,7 +1692,7 @@
                ChildWildcardHandler groupWildcardHandler;
                if (groupWildcard.wrapper() != Object.class)
                {
-                  BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(groupWildcard.wrapper());
+                  BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(groupWildcard.wrapper(), beanAccessMode);
                   groupWildcardHandler = new ChildWildcardHandler(property, wrapperInfo, groupWildcard.property());
                }
                else
@@ -1837,7 +1861,7 @@
                   Map<QName, AbstractPropertyHandler> properties = wrapperBeanFactory.getProperties();
                   if(properties.containsKey(entryQName) == false)
                   {
-                     MapPropertyHandler mapHandler = new MapPropertyHandler(JBossXBBuilder.configuration, property, localPropertyType, true);
+                     MapPropertyHandler mapHandler = new MapPropertyHandler(JBossXBBuilder.configuration, beanAccessMode, property, localPropertyType, true);
                      wrapperBeanFactory.addProperty(entryQName, mapHandler);
                   }
                   if(propertyHandler == null)
@@ -1849,7 +1873,7 @@
                {
                   propertyQName = entryQName;
                   if(propertyHandler == null)
-                     propertyHandler = new MapPropertyHandler(JBossXBBuilder.configuration, property, localPropertyType, false);
+                     propertyHandler = new MapPropertyHandler(JBossXBBuilder.configuration, beanAccessMode, property, localPropertyType, false);
                }
                // overriding setParent doesn't make sense for a map
                // entryTerm.setHandler(new SetParentOverrideHandler(entryTerm.getHandler(), propertyHandler));
@@ -1989,8 +2013,13 @@
          
          if(annotation.particles().length == 0)
          {
+            BeanAccessMode beanAccessMode = this.beanAccessMode;
+            JBossXmlAccessMode accessMode = annotation.accessMode();
+            if(accessMode != JBossXmlAccessMode.NOT_SPECIFIED)
+               beanAccessMode = jbossXmlAccessModeToBeanAccessMode(accessMode);
+            
             // handler for the model group members
-            BeanInfo groupBeanInfo = JBossXBBuilder.configuration.getBeanInfo(groupType);
+            BeanInfo groupBeanInfo = JBossXBBuilder.configuration.getBeanInfo(groupType, beanAccessMode);
             BeanAdapterFactory propBeanAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, groupBeanInfo, null);
 
             String[] memberOrder = annotation.propOrder();
@@ -2131,7 +2160,7 @@
    {
       try
       {
-         BeanInfo adapterBuilderInfo = JBossXBBuilder.configuration.getBeanInfo(beanAdapterBuilderClass);
+         BeanInfo adapterBuilderInfo = JBossXBBuilder.configuration.getBeanInfo(beanAdapterBuilderClass, beanAccessMode);
          BeanAdapterBuilder adapterBuilder = (BeanAdapterBuilder) adapterBuilderInfo.newInstance();
          return adapterBuilder.newFactory(beanInfo, factory);
       }
@@ -2335,7 +2364,7 @@
 
          // entry handler
          BeanAdapterFactory entryAdapterFactory = null;
-         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class);
+         BeanInfo entryInfo = JBossXBBuilder.configuration.getBeanInfo(DefaultMapEntry.class, beanAccessMode);
          entryAdapterFactory = createAdapterFactory(DefaultBeanAdapterBuilder.class, entryInfo, null);
 
          TypeBinding entryType = null;

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java	2010-03-09 14:15:08 UTC (rev 4141)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/MapPropertyHandler.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -27,6 +27,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.jboss.beans.info.spi.BeanAccessMode;
 import org.jboss.beans.info.spi.BeanInfo;
 import org.jboss.beans.info.spi.PropertyInfo;
 import org.jboss.config.spi.Configuration;
@@ -62,7 +63,7 @@
     * @param wrapped the wrapped flag
     * @throws IllegalArgumentException for a null qName or property
     */
-   public MapPropertyHandler(Configuration config, PropertyInfo propertyInfo, TypeInfo propertyType, boolean wrapped)
+   public MapPropertyHandler(Configuration config, BeanAccessMode beanAccessMode, PropertyInfo propertyInfo, TypeInfo propertyType, boolean wrapped)
    {
       super(propertyInfo, propertyType);
 
@@ -111,7 +112,7 @@
       
       if(entry != null && !JBossXmlMapEntry.DEFAULT.class.equals(entry.type()))
       {
-         BeanInfo entryBean = config.getBeanInfo(entry.type());
+         BeanInfo entryBean = config.getBeanInfo(entry.type(), beanAccessMode);
          mapPutAdapter = new CustomMapEntryPutAdapter(entryBean);
       }
       else

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeGroupOverride.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeGroupOverride.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeGroupOverride.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * A PropertyAccessModeType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.PUBLIC_MEMBER)
+ at XmlRootElement(name="root")
+public class AllAccessModeGroupOverride extends SomeType
+{
+   public PropertyAccessModeGroup e;
+   
+   @JBossXmlModelGroup(name="all", accessMode=JBossXmlAccessMode.ALL, kind=JBossXmlConstants.MODEL_GROUP_ALL)
+   public static class PropertyAccessModeGroup
+   {
+      private String property;
+      public String publicField;
+      private String privateField;
+      
+      public String getProperty()
+      {
+         return property;
+      }
+      
+      public void setProperty(String property)
+      {
+         this.property = property;
+      }
+      
+      public String privateField()
+      {
+         return privateField;
+      }
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeTypeOverride.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeTypeOverride.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/AllAccessModeTypeOverride.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xb.annotations.JBossXmlType;
+
+/**
+ * A PropertyAccessModeType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.PUBLIC_MEMBER)
+ at XmlRootElement(name="root")
+public class AllAccessModeTypeOverride extends SomeType
+{
+   @XmlElement
+   public PropertyAccessModeType e;
+   
+   @JBossXmlType(accessMode = JBossXmlAccessMode.ALL)
+   public static class PropertyAccessModeType extends SomeType
+   {      
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeGroupOverride.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeGroupOverride.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeGroupOverride.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * A PropertyAccessModeType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.ALL)
+ at XmlRootElement(name="root")
+public class PropertyAccessModeGroupOverride extends SomeType
+{
+   public PropertyAccessModeGroup e;
+   
+   @JBossXmlModelGroup(name="all", accessMode=JBossXmlAccessMode.PROPERTY, kind=JBossXmlConstants.MODEL_GROUP_ALL)
+   public static class PropertyAccessModeGroup
+   {
+      private String property;
+      public String publicField;
+      private String privateField;
+      
+      public String getProperty()
+      {
+         return property;
+      }
+      
+      public void setProperty(String property)
+      {
+         this.property = property;
+      }
+      
+      public String privateField()
+      {
+         return privateField;
+      }
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeTypeOverride.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeTypeOverride.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PropertyAccessModeTypeOverride.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xb.annotations.JBossXmlType;
+
+/**
+ * A PropertyAccessModeType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.ALL)
+ at XmlRootElement(name="root")
+public class PropertyAccessModeTypeOverride extends SomeType
+{
+   @XmlElement
+   public PropertyAccessModeType e;
+   
+   @JBossXmlType(accessMode = JBossXmlAccessMode.PROPERTY)
+   public static class PropertyAccessModeType extends SomeType
+   {      
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeGroupOverride.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeGroupOverride.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeGroupOverride.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * A PropertyAccessModeType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.ALL)
+ at XmlRootElement(name="root")
+public class PublicMemberAccessModeGroupOverride extends SomeType
+{
+   public PropertyAccessModeGroup e;
+   
+   @JBossXmlModelGroup(name="all", accessMode=JBossXmlAccessMode.PUBLIC_MEMBER, kind=JBossXmlConstants.MODEL_GROUP_ALL)
+   public static class PropertyAccessModeGroup
+   {
+      private String property;
+      public String publicField;
+      private String privateField;
+      
+      public String getProperty()
+      {
+         return property;
+      }
+      
+      public void setProperty(String property)
+      {
+         this.property = property;
+      }
+      
+      public String privateField()
+      {
+         return privateField;
+      }
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeTypeOverride.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeTypeOverride.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/PublicMemberAccessModeTypeOverride.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xb.annotations.JBossXmlType;
+
+/**
+ * A PropertyAccessModeType.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.ALL)
+ at XmlRootElement(name="root")
+public class PublicMemberAccessModeTypeOverride extends SomeType
+{
+   @XmlElement
+   public PropertyAccessModeType e;
+   
+   @JBossXmlType(accessMode = JBossXmlAccessMode.PUBLIC_MEMBER)
+   public static class PropertyAccessModeType extends SomeType
+   {      
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelAllAccessMode.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelAllAccessMode.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelAllAccessMode.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * A SchemaLevelPropertyBeanAccess.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.ALL)
+ at XmlRootElement(name="root")
+public class SchemaLevelAllAccessMode extends SomeType
+{
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPropertyAccessMode.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPropertyAccessMode.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPropertyAccessMode.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * A SchemaLevelPropertyBeanAccess.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.PROPERTY)
+ at XmlRootElement(name="root")
+public class SchemaLevelPropertyAccessMode extends SomeType
+{
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPublicMemberAccessMode.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPublicMemberAccessMode.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SchemaLevelPublicMemberAccessMode.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlAccessMode;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * A SchemaLevelPropertyBeanAccess.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(accessMode = JBossXmlAccessMode.PUBLIC_MEMBER)
+ at XmlRootElement(name="root")
+public class SchemaLevelPublicMemberAccessMode extends SomeType
+{
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SomeType.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SomeType.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/support/SomeType.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, 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.xb.builder.object.beanaccessmode.support;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * A Root.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SomeType
+{
+   @XmlAttribute
+   private String privateField;
+   
+   @XmlAttribute
+   public String publicField;
+   
+   private String property;
+   
+   @XmlAttribute
+   public String getProperty()
+   {
+      return property;
+   }
+   
+   public void setProperty(String property)
+   {
+      this.property = property;
+   }
+
+   public String privateField()
+   {
+      return privateField;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverrideUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverrideUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverrideUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,91 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.AllAccessModeGroupOverride;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.AllAccessModeGroupOverride.PropertyAccessModeGroup;
+import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A PropertyAccessModeTypeOverrideUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllAccessModeGroupOverrideUnitTestCase extends AbstractBuilderTest
+{
+   public AllAccessModeGroupOverrideUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(AllAccessModeGroupOverride.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(2, type.getAttributes().size());
+      ModelGroupBinding group = (ModelGroupBinding)type.getParticle().getTerm();
+      Collection<ParticleBinding> particles = group.getParticles();
+      assertEquals(1, particles.size());
+      AllBinding all = (AllBinding) particles.iterator().next().getTerm();
+      particles = all.getParticles();
+      assertEquals(3, particles.size());
+      Iterator<ParticleBinding> iterator = particles.iterator();
+      
+      QName propertyName = new QName("property");
+      QName publicFieldName = new QName("public-field");
+      QName privateFieldName = new QName("private-field");
+      while(iterator.hasNext())
+      {
+         ElementBinding e = (ElementBinding) iterator.next().getTerm();
+         QName eName = e.getQName();
+         assertTrue(eName.equals(propertyName) || eName.equals(publicFieldName) || eName.equals(privateFieldName));
+      }
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      AllAccessModeGroupOverride root = unmarshalObject(AllAccessModeGroupOverride.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertNull(root.privateField());
+      PropertyAccessModeGroup e = root.e;
+      assertNotNull(e);
+      assertEquals("property", e.getProperty());
+      assertEquals("fields", e.publicField);
+      assertEquals("all", e.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverrideUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverrideUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverrideUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,82 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.AllAccessModeTypeOverride;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.AllAccessModeTypeOverride.PropertyAccessModeType;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A PropertyAccessModeTypeOverrideUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllAccessModeTypeOverrideUnitTestCase extends AbstractBuilderTest
+{
+   public AllAccessModeTypeOverrideUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(AllAccessModeTypeOverride.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(2, type.getAttributes().size());
+      ModelGroupBinding group = (ModelGroupBinding)type.getParticle().getTerm();
+      Collection<ParticleBinding> particles = group.getParticles();
+      assertEquals(1, particles.size());
+      ElementBinding e = (ElementBinding) particles.iterator().next().getTerm();
+      assertEquals(new QName("e"), e.getQName());
+      type = e.getType();
+      assertEquals(3, type.getAttributes().size());
+      assertNotNull(type.getAttribute(new QName("property")));
+      assertNotNull(type.getAttribute(new QName("public-field")));
+      assertNotNull(type.getAttribute(new QName("private-field")));
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      AllAccessModeTypeOverride root = unmarshalObject(AllAccessModeTypeOverride.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertNull(root.privateField());
+      PropertyAccessModeType e = root.e;
+      assertNotNull(e);
+      assertEquals("property", e.getProperty());
+      assertEquals("fields", e.publicField);
+      assertEquals("all", e.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverrideUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverrideUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverrideUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PropertyAccessModeGroupOverride;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PropertyAccessModeGroupOverride.PropertyAccessModeGroup;
+import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A PropertyAccessModeTypeOverrideUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyAccessModeGroupOverrideUnitTestCase extends AbstractBuilderTest
+{
+   public PropertyAccessModeGroupOverrideUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(PropertyAccessModeGroupOverride.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(3, type.getAttributes().size());
+      ModelGroupBinding group = (ModelGroupBinding)type.getParticle().getTerm();
+      Collection<ParticleBinding> particles = group.getParticles();
+      assertEquals(1, particles.size());
+      AllBinding all = (AllBinding) particles.iterator().next().getTerm();
+      particles = all.getParticles();
+      assertEquals(1, particles.size());
+      ElementBinding e = (ElementBinding) particles.iterator().next().getTerm();
+      assertEquals(new QName("property"), e.getQName());
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      PropertyAccessModeGroupOverride root = unmarshalObject(PropertyAccessModeGroupOverride.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertEquals("all", root.privateField());
+      PropertyAccessModeGroup e = root.e;
+      assertNotNull(e);
+      assertEquals("property", e.getProperty());
+      assertNull(e.publicField);
+      assertNull(e.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverrideUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverrideUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverrideUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,80 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PropertyAccessModeTypeOverride;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PropertyAccessModeTypeOverride.PropertyAccessModeType;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A PropertyAccessModeTypeOverrideUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyAccessModeTypeOverrideUnitTestCase extends AbstractBuilderTest
+{
+   public PropertyAccessModeTypeOverrideUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(PropertyAccessModeTypeOverride.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(3, type.getAttributes().size());
+      ModelGroupBinding group = (ModelGroupBinding)type.getParticle().getTerm();
+      Collection<ParticleBinding> particles = group.getParticles();
+      assertEquals(1, particles.size());
+      ElementBinding e = (ElementBinding) particles.iterator().next().getTerm();
+      assertEquals(new QName("e"), e.getQName());
+      type = e.getType();
+      assertEquals(1, type.getAttributes().size());
+      assertNotNull(type.getAttribute(new QName("property")));
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      PropertyAccessModeTypeOverride root = unmarshalObject(PropertyAccessModeTypeOverride.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertEquals("all", root.privateField());
+      PropertyAccessModeType e = root.e;
+      assertNotNull(e);
+      assertEquals("property", e.getProperty());
+      assertNull(e.publicField);
+      assertNull(e.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverrideUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverrideUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverrideUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PublicMemberAccessModeGroupOverride;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PublicMemberAccessModeGroupOverride.PropertyAccessModeGroup;
+import org.jboss.xb.binding.sunday.unmarshalling.AllBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A PropertyAccessModeTypeOverrideUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PublicMemberAccessModeGroupOverrideUnitTestCase extends AbstractBuilderTest
+{
+   public PublicMemberAccessModeGroupOverrideUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(PublicMemberAccessModeGroupOverride.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(3, type.getAttributes().size());
+      ModelGroupBinding group = (ModelGroupBinding)type.getParticle().getTerm();
+      Collection<ParticleBinding> particles = group.getParticles();
+      assertEquals(1, particles.size());
+      AllBinding all = (AllBinding) particles.iterator().next().getTerm();
+      particles = all.getParticles();
+      assertEquals(2, particles.size());
+      Iterator<ParticleBinding> iterator = particles.iterator();
+      
+      QName propertyName = new QName("property");
+      QName publicFieldName = new QName("public-field");
+      while(iterator.hasNext())
+      {
+         ElementBinding e = (ElementBinding) iterator.next().getTerm();
+         QName eName = e.getQName();
+         assertTrue(eName.equals(propertyName) || eName.equals(publicFieldName));
+      }
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      PublicMemberAccessModeGroupOverride root = unmarshalObject(PublicMemberAccessModeGroupOverride.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertEquals("all", root.privateField());
+      PropertyAccessModeGroup e = root.e;
+      assertNotNull(e);
+      assertEquals("property", e.getProperty());
+      assertEquals("fields", e.publicField);
+      assertNull(e.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverrideUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverrideUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverrideUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PublicMemberAccessModeTypeOverride;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.PublicMemberAccessModeTypeOverride.PropertyAccessModeType;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * A PropertyAccessModeTypeOverrideUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class PublicMemberAccessModeTypeOverrideUnitTestCase extends AbstractBuilderTest
+{
+   public PublicMemberAccessModeTypeOverrideUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(PublicMemberAccessModeTypeOverride.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(3, type.getAttributes().size());
+      ModelGroupBinding group = (ModelGroupBinding)type.getParticle().getTerm();
+      Collection<ParticleBinding> particles = group.getParticles();
+      assertEquals(1, particles.size());
+      ElementBinding e = (ElementBinding) particles.iterator().next().getTerm();
+      assertEquals(new QName("e"), e.getQName());
+      type = e.getType();
+      assertEquals(2, type.getAttributes().size());
+      assertNotNull(type.getAttribute(new QName("property")));
+      assertNotNull(type.getAttribute(new QName("public-field")));
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      PublicMemberAccessModeTypeOverride root = unmarshalObject(PublicMemberAccessModeTypeOverride.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertEquals("all", root.privateField());
+      PropertyAccessModeType e = root.e;
+      assertNotNull(e);
+      assertEquals("property", e.getProperty());
+      assertEquals("fields", e.publicField);
+      assertNull(e.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessModeUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessModeUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessModeUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.SomeType;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.SchemaLevelAllAccessMode;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+
+/**
+ * A GlobalBeanAccessModeUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SchemaLevelAllAccessModeUnitTestCase extends AbstractBuilderTest
+{
+   public SchemaLevelAllAccessModeUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testAllBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(SchemaLevelAllAccessMode.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(3, type.getAttributes().size());
+      AttributeBinding attr = type.getAttribute(new QName("property"));
+      assertNotNull(attr);
+      attr = type.getAttribute(new QName("public-field"));
+      assertNotNull(attr);
+      attr = type.getAttribute(new QName("private-field"));
+      assertNotNull(attr);
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      SomeType root = unmarshalObject(SchemaLevelAllAccessMode.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertEquals("all", root.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessModeUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessModeUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessModeUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.SomeType;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.SchemaLevelPropertyAccessMode;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+
+/**
+ * A GlobalBeanAccessModeUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SchemaLevelPropertyAccessModeUnitTestCase extends AbstractBuilderTest
+{
+   public SchemaLevelPropertyAccessModeUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(SchemaLevelPropertyAccessMode.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(1, type.getAttributes().size());
+      AttributeBinding property = type.getAttribute(new QName("property"));
+      assertNotNull(property);
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      SomeType root = unmarshalObject(SchemaLevelPropertyAccessMode.class);
+      assertEquals("property", root.getProperty());
+      assertNull(root.publicField);
+      assertNull(root.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessModeUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessModeUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessModeUnitTestCase.java	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.xb.builder.object.beanaccessmode.test;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.test.xb.builder.AbstractBuilderTest;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.SomeType;
+import org.jboss.test.xb.builder.object.beanaccessmode.support.SchemaLevelPublicMemberAccessMode;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+
+/**
+ * A GlobalBeanAccessModeUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SchemaLevelPublicMemberAccessModeUnitTestCase extends AbstractBuilderTest
+{
+   public SchemaLevelPublicMemberAccessModeUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testFieldsBinding() throws Exception
+   {
+      SchemaBinding schema = JBossXBBuilder.build(SchemaLevelPublicMemberAccessMode.class, true);
+      ElementBinding root = schema.getElement(new QName("root"));
+      assertNotNull(root);
+      TypeBinding type = root.getType();
+      assertEquals(2, type.getAttributes().size());
+      AttributeBinding attr = type.getAttribute(new QName("property"));
+      assertNotNull(attr);
+      attr = type.getAttribute(new QName("public-field"));
+      assertNotNull(attr);
+   }
+   
+   public void testUnmarshalling() throws Exception
+   {
+      SomeType root = unmarshalObject(SchemaLevelPublicMemberAccessMode.class);
+      assertEquals("property", root.getProperty());
+      assertEquals("fields", root.publicField);
+      assertNull(root.privateField());
+   }
+}

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverride.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverride.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeGroupOverride.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,5 @@
+<root property="property" public-field="fields">
+   <property>property</property>
+   <public-field>fields</public-field>
+   <private-field>all</private-field>
+</root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverride.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverride.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/AllAccessModeTypeOverride.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,3 @@
+<root property="property" public-field="fields">
+   <e property="property" public-field="fields" private-field="all"/>
+</root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverride.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverride.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeGroupOverride.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,3 @@
+<root property="property" public-field="fields" private-field="all">
+   <property>property</property>
+</root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverride.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverride.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PropertyAccessModeTypeOverride.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,3 @@
+<root property="property" public-field="fields" private-field="all">
+   <e property="property"/>
+</root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverride.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverride.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeGroupOverride.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,4 @@
+<root property="property" public-field="fields" private-field="all">
+   <property>property</property>
+   <public-field>fields</public-field>
+</root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverride.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverride.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/PublicMemberAccessModeTypeOverride.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1,3 @@
+<root property="property" public-field="fields" private-field="all">
+   <e property="property" public-field="fields"/>
+</root>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessMode.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessMode.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelAllAccessMode.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1 @@
+<root property="property" public-field="fields" private-field="all"/>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessMode.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessMode.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPropertyAccessMode.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1 @@
+<root property="property"/>
\ No newline at end of file

Added: jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessMode.xml
===================================================================
--- jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessMode.xml	                        (rev 0)
+++ jbossxb/trunk/src/test/resources/org/jboss/test/xb/builder/object/beanaccessmode/test/SchemaLevelPublicMemberAccessMode.xml	2010-03-10 14:47:10 UTC (rev 4142)
@@ -0,0 +1 @@
+<root property="property" public-field="fields"/>
\ No newline at end of file



More information about the jboss-svn-commits mailing list