Index: src/jaxme/org/apache/ws/jaxme/generator/sg/PropertySG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/PropertySG.java,v
retrieving revision 1.4
diff -u -r1.4 PropertySG.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/PropertySG.java	8 Apr 2005 23:10:45 -0000	1.4
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/PropertySG.java	6 May 2005 20:01:49 -0000
@@ -41,10 +41,15 @@
    */
   public String getCollectionType();
 
-  /** <p>Returns the objects property name.</p>
+  /** <p>Returns the objects field name. By default, this is the
+   * property name with the prefix '_'.</p>
    */
   public String getXMLFieldName() throws SAXException;
 
+  /** <p>Returns the objects property name.</p>
+   */
+  public String getPropertyName() throws SAXException;
+
   /** <p>Returns the objects getter name.</p>
    */
   public String getXMLGetMethodName() throws SAXException;
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/SimpleTypeSG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/SimpleTypeSG.java,v
retrieving revision 1.6
diff -u -r1.6 SimpleTypeSG.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/SimpleTypeSG.java	28 Apr 2005 23:57:53 -0000	1.6
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/SimpleTypeSG.java	6 May 2005 20:01:50 -0000
@@ -148,8 +148,8 @@
 
   /** <p>Generates a set method for the simple type.</p>
    */
-  public JavaMethod getXMLSetMethod(JavaSource pSource,
-                                     String pFieldName, String pMethodName) throws SAXException;
+  public JavaMethod getXMLSetMethod(JavaSource pSource, String pFieldName,
+		  							String pParamName, String pMethodName) throws SAXException;
 
   /** <p>Adds code for validating the value <code>pValue</code> to the "add" or
    * "set" method <code>pMethod</code>.</p>
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/TypeSG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/TypeSG.java,v
retrieving revision 1.7
diff -u -r1.7 TypeSG.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/TypeSG.java	13 Oct 2004 22:51:53 -0000	1.7
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/TypeSG.java	6 May 2005 20:01:50 -0000
@@ -116,6 +116,7 @@
   /** <p>Generates a set method returning an instance of this type.</p>
    */
   public JavaMethod getXMLSetMethod(JavaSource pSource, String pFieldName,
+		  							String pParamName,
   		                            String pMethodName, boolean pSetIsSet) throws SAXException;
 
   /** <p>Generates an "isSet" method returning whether the field is set.</p>
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBPropertySG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBPropertySG.java,v
retrieving revision 1.12
diff -u -r1.12 JAXBPropertySG.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBPropertySG.java	24 Apr 2005 20:16:48 -0000	1.12
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBPropertySG.java	6 May 2005 20:01:50 -0000
@@ -39,7 +39,6 @@
 import org.apache.ws.jaxme.xs.XSElement;
 import org.apache.ws.jaxme.xs.XSObject;
 import org.apache.ws.jaxme.xs.XSType;
-import org.apache.ws.jaxme.xs.jaxb.JAXBElement;
 import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
 import org.apache.ws.jaxme.xs.jaxb.JAXBPropertyOwner;
 import org.xml.sax.SAXException;
@@ -55,12 +54,9 @@
 	private final boolean generateIsSetMethod;
 	private final String defaultValue;
 	private final TypeSG typeSG;
-    private final boolean globalType;
 
 	protected JAXBPropertySG(String pDefaultPropertyName, SchemaSG pSchema, XSObject pXSObject,
 							 String pDefaultValue, TypeSG pTypeSG) {
-		globalType = (pTypeSG != null  &&  pTypeSG.isGlobalType()
-                 ||  (pXSObject instanceof XSElement  &&  ((XSElement) pXSObject).isGlobal()));
         typeSG = pTypeSG;
 	    defaultValue = pDefaultValue;
 	    String myPropertyName = null;
@@ -110,6 +106,10 @@
 	public String getCollectionType(PropertySG pController) { return collectionType; }
 	
 	public String getXMLFieldName(PropertySG pController) throws SAXException {
+		return fieldName;
+	}
+
+	public String getPropertyName(PropertySG pController) throws SAXException {
 		return propertyName;
 	}
 
@@ -121,8 +121,8 @@
         } else {
         	prefix = "get";
         }
-		String fieldName = pController.getXMLFieldName();
-		String methodName = prefix + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
+		String propName = pController.getPropertyName();
+		String methodName = prefix + Character.toUpperCase(propName.charAt(0)) + propName.substring(1);
         if (methodName.equals("getClass")) {
         	throw new SAXException("Method name getClass() conflicts with java.lang.Object.getClass(), use jaxb:property to customize the property name.");
         }
@@ -130,33 +130,35 @@
 	}
 	
 	public String getXMLSetMethodName(PropertySG pController) throws SAXException {
-		String fieldName = pController.getXMLFieldName();
-		return "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
+		String propName = pController.getPropertyName();
+		return "set" + Character.toUpperCase(propName.charAt(0)) + propName.substring(1);
 	}
 	
 	public String getXMLIsSetMethodName(PropertySG pController) throws SAXException {
-		String fieldName = pController.getXMLFieldName();
+		String propName = pController.getPropertyName();
 		return hasIsSetMethod(pController) ?
-										   "isSet" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1) : null;
+										   "isSet" + Character.toUpperCase(propName.charAt(0)) + propName.substring(1) : null;
 	}
 
 	public JavaField getXMLField(PropertySG pController, JavaSource pSource) throws SAXException {
-		return typeSG.getXMLField(pSource, fieldName, defaultValue);
+		return typeSG.getXMLField(pSource, pController.getXMLFieldName(), defaultValue);
 	}
 	
 	public JavaMethod getXMLGetMethod(PropertySG pController, JavaSource pSource) throws SAXException {
-		return typeSG.getXMLGetMethod(pSource, fieldName,
-				pController.getXMLGetMethodName());
+		return typeSG.getXMLGetMethod(pSource, pController.getXMLFieldName(),
+									  pController.getXMLGetMethodName());
 	}
 	
 	public JavaMethod getXMLSetMethod(PropertySG pController, JavaSource pSource) throws SAXException {
-		return typeSG.getXMLSetMethod(pSource, fieldName,
-				                      pController.getXMLSetMethodName(),
+		String propName = pController.getPropertyName();
+		String pName = "p" + Character.toUpperCase(propName.charAt(0)) + propName.substring(1);
+		return typeSG.getXMLSetMethod(pSource, pController.getXMLFieldName(),
+									  pName, pController.getXMLSetMethodName(),
                                       pController.hasIsSetMethod());
 	}
 	
 	public JavaMethod getXMLIsSetMethod(PropertySG pController, JavaSource pSource) throws SAXException {
-		return typeSG.getXMLIsSetMethod(pSource, fieldName,
+		return typeSG.getXMLIsSetMethod(pSource, pController.getXMLFieldName(),
 				pController.getXMLIsSetMethodName());
 	}
 	
@@ -236,11 +238,4 @@
 	public void addValue(PropertySG pController, JavaMethod pMethod, DirectAccessible pElement, TypedValue pValue, JavaQName pType) throws SAXException {
 		pController.setValue(pMethod, pElement, pValue, pType);
 	}
-	
-	public String getDefaultValue(PropertySG pController) throws IllegalStateException {
-		if (typeSG.isComplex()) {
-			throw new IllegalStateException("Complex type " + typeSG.getName() + " doesn't support default value.");
-		}
-		return defaultValue;
-	}
 }
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java,v
retrieving revision 1.15
diff -u -r1.15 JAXBTypeSG.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java	27 Apr 2005 06:23:26 -0000	1.15
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBTypeSG.java	6 May 2005 20:01:52 -0000
@@ -303,7 +303,7 @@
   }
 
   public JavaMethod getXMLGetMethod(TypeSG pController, JavaSource pSource,
-                                     String pFieldName, String pMethodName) throws SAXException {
+		  							String pFieldName, String pMethodName) throws SAXException {
     JavaQName runtimeType;
     if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
       SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
@@ -325,10 +325,10 @@
   }
 
   public JavaMethod getXMLSetMethod(TypeSG pController, JavaSource pSource,
-  		                            String pFieldName, String pMethodName,
+  		                            String pFieldName, String pParamName,
+  		                            String pMethodName,
                                     boolean pSetIsSet) throws SAXException {
   	if (pController.isComplex()) {
-  		String pName = "p" + Character.toUpperCase(pFieldName.charAt(0)) + pFieldName.substring(1);
   		JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
   		JavaQName runtimeType;
   		if (pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
@@ -343,13 +343,13 @@
   		else {
   			runtimeType = pController.getRuntimeType();
   		}
-  		DirectAccessible param = jm.addParam(runtimeType, pName);
+  		DirectAccessible param = jm.addParam(runtimeType, pParamName);
   		if (!pSource.isInterface()) {
   			jm.addLine(pFieldName, " = ", param, ";");
   		}
   		return jm;
   	} else {
-  		JavaMethod jm = pController.getSimpleTypeSG().getXMLSetMethod(pSource, pFieldName, pMethodName);
+  		JavaMethod jm = pController.getSimpleTypeSG().getXMLSetMethod(pSource, pFieldName, pParamName, pMethodName);
   		if (pSetIsSet  &&  pController.getRuntimeType().isPrimitive()) {
   			jm.addLine(getIsSetCheckFieldName(pFieldName), " = true;");
         }
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/BeanGeneratingVisitor.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/BeanGeneratingVisitor.java,v
retrieving revision 1.1
diff -u -r1.1 BeanGeneratingVisitor.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/BeanGeneratingVisitor.java	24 Apr 2005 20:16:48 -0000	1.1
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/BeanGeneratingVisitor.java	6 May 2005 20:01:53 -0000
@@ -104,6 +104,9 @@
 			PropertySGChain chain = ((PropertySGImpl) elementSG).getHeadOfChain();
 			PropertySGChain head = new PropertySGChainImpl(chain){
 				public String getXMLFieldName(PropertySG pController) throws SAXException {
+					return "_value";
+				}
+				public String getPropertyName(PropertySG pController) throws SAXException {
 					return "value";
 				}
 			};
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupUtil.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupUtil.java,v
retrieving revision 1.3
diff -u -r1.3 GroupUtil.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupUtil.java	24 Apr 2005 20:16:48 -0000	1.3
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupUtil.java	6 May 2005 20:01:53 -0000
@@ -5,7 +5,6 @@
 import org.apache.ws.jaxme.generator.util.JavaNamer;
 import org.apache.ws.jaxme.js.JavaQName;
 import org.apache.ws.jaxme.js.JavaQNameImpl;
-import org.apache.ws.jaxme.js.JavaSource;
 import org.xml.sax.SAXException;
 
 
@@ -33,7 +32,7 @@
 					if (num++ > 0) {
 						sb.append(sep);
 					}
-					String f = particle.getPropertySG().getXMLFieldName();
+					String f = particle.getPropertySG().getPropertyName();
 					sb.append(Character.toUpperCase(f.charAt(0)) + f.substring(1));
 					if (num == 3) {
 						break;
@@ -50,7 +49,7 @@
 
 	static JavaQName getContentClass(GroupSG pGroup, ParticleSG pParticle,
 									 JavaQName pQName) throws SAXException {
-		String name = pParticle.getPropertySG().getXMLFieldName();
+		String name = pParticle.getPropertySG().getPropertyName();
 		name = Character.toUpperCase(name.charAt(0)) + name.substring(1);
 		if (pGroup.isGlobal()) {
 			return JavaQNameImpl.getInstance(pQName.getPackageName(),
Index: src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/SimpleContentHandlerSG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/SimpleContentHandlerSG.java,v
retrieving revision 1.5
diff -u -r1.5 SimpleContentHandlerSG.java
--- src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/SimpleContentHandlerSG.java	28 Apr 2005 23:57:53 -0000	1.5
+++ src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/SimpleContentHandlerSG.java	6 May 2005 20:01:53 -0000
@@ -44,7 +44,7 @@
 		element.addLine("(", elementInterface, ") result");
 		SimpleContentSG scSG = ctSG.getSimpleContentSG();
 		TypedValue tv = createSimpleTypeConversion(result, scSG.getContentTypeSG(),
-												   getParamResult(), scSG.getPropertySG().getXMLFieldName());
+												   getParamResult(), scSG.getPropertySG().getPropertyName());
 		scSG.getPropertySG().addValue(result, element, tv, null);
 		return result;
 	}
Index: src/jaxme/org/apache/ws/jaxme/generator/types/SimpleTypeSGImpl.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/types/SimpleTypeSGImpl.java,v
retrieving revision 1.3
diff -u -r1.3 SimpleTypeSGImpl.java
--- src/jaxme/org/apache/ws/jaxme/generator/types/SimpleTypeSGImpl.java	30 Sep 2004 00:09:30 -0000	1.3
+++ src/jaxme/org/apache/ws/jaxme/generator/types/SimpleTypeSGImpl.java	6 May 2005 20:01:54 -0000
@@ -110,11 +110,10 @@
   }
 
   public JavaMethod getXMLSetMethod(SimpleTypeSG pController, JavaSource pSource,
-                                     String pFieldName, String pMethodName) throws SAXException {
+                                    String pFieldName, String pParamName, String pMethodName) throws SAXException {
     if (pController.hasSetMethod()) {
-      String pName = "p" + Character.toUpperCase(pFieldName.charAt(0)) + pFieldName.substring(1);
       JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
-      DirectAccessible param = jm.addParam(pController.getRuntimeType(), pName);
+      DirectAccessible param = jm.addParam(pController.getRuntimeType(), pParamName);
       if (!pSource.isInterface()) {
         pController.addValidation(jm, param);
         jm.addLine(pFieldName, " = ", param, ";");
Index: src/test/jaxb/jira/jaxme-21.xsd
===================================================================
RCS file: /home/cvs/ws-jaxme/src/test/jaxb/jira/jaxme-21.xsd,v
retrieving revision 1.2
diff -u -r1.2 jaxme-21.xsd
--- src/test/jaxb/jira/jaxme-21.xsd	12 Aug 2004 00:04:28 -0000	1.2
+++ src/test/jaxb/jira/jaxme-21.xsd	6 May 2005 20:01:55 -0000
@@ -168,4 +168,19 @@
 		<attribute name="lastLoginDate" type="dateTime"/>
 	</complexType>
 	
+  <complexType name="VisualType">
+    <all>
+      <element name="periodlist">
+        <complexType>
+          <sequence>
+            <element name="period" type="string" maxOccurs="unbounded">
+              <annotation><appinfo>
+                <jaxb:property generateIsSetMethod="true"/>
+              </appinfo></annotation>
+            </element>
+          </sequence>
+		</complexType>
+	  </element>
+	</all>
+  </complexType>
 </schema>
