de.ispsoft.jaxme.generator
Class SchemaComplexElement

java.lang.Object
  extended byde.ispsoft.jaxme.generator.SchemaAnnotationOwner
      extended byde.ispsoft.jaxme.generator.SchemaElement
          extended byde.ispsoft.jaxme.generator.SchemaComplexElement
Direct Known Subclasses:
SchemaComplexJdbcElement

public class SchemaComplexElement
extends SchemaElement

Implementation of a complex element.

Author:
Jochen Wiedmann

Nested Class Summary
 
Nested classes inherited from class de.ispsoft.jaxme.generator.SchemaElement
SchemaElement.ClassExtension, SchemaElement.ImplementedInterface, SchemaElement.PieceOfJavaSource
 
Field Summary
static int COMPLEX_TYPE_ALL
          A possible value for setComplexType(): The "all" type.
static int COMPLEX_TYPE_CHOICE
          A possible value for setComplexType(): A choice.
static int COMPLEX_TYPE_SEQUENCE
          A possible value for setComplexType(): A sequence.
 
Constructor Summary
SchemaComplexElement(SchemaAnnotationOwner pParent)
          Creates new SchemaComplexElement
 
Method Summary
 void addAttribute(SchemaAttribute pAttribute)
          Adds a new attribute to the list of childs.
 void addChild(SchemaElement pChild)
          Adds a new child to the list of childs.
 void clearAttributes()
          Clears the current list of childs.
 void clearChilds()
          Clears the current list of childs.
 java.util.Iterator getAttributes()
          Returns an iterator to the current list of attributes.
 java.util.Iterator getChilds()
          Returns an iterator to the current list of childs.
 java.lang.String getClassName()
          Returns this elements class name.
 int getComplexType()
          Returns the structure type of this element.
 java.lang.String getDefaultClassName()
           
 java.lang.Integer getErrorCode()
          Returns the error code.
 java.lang.String getFieldType()
          Returns the Java type that this element has as a field in a parent element: If getMultiple() returns true, then the field type is java.util.List.
 java.lang.String getInstanceType()
          Returns the Java type that this element would has or would have in the absence of a maxOccurs attribute.
 java.lang.String[] getPrefixList()
          Returns a list of default prefixes being used when the element is unmarshalled.
 boolean hasProtectedConstructor()
          Returns whether the generated XML class has a protected constructor.
 boolean isAnyType()
          Returns whether the elements type is xs:anyType.
 boolean isAttribute()
          Returns whether the element is actually an attribute.
 boolean isComplex()
          Returns whether the element is complex.
 void setComplexType(int pType)
          Sets the structure type of this element.
 void setErrorCode(java.lang.Integer pErrorCode)
          Set the error code.
 void setPrefixList(java.lang.String[] pPrefixList)
          Sets a list of default prefixes being used when the element is unmarshalled.
 void setProtectedConstructor(boolean pProtectedConstructor)
          Sets whether the generated XML class has a protected constructor.
 
Methods inherited from class de.ispsoft.jaxme.generator.SchemaElement
addClassExtension, addElementDecorator, addImplementedInterface, addJavaSource, addOption, clearClassExtensions, clearImplementedInterfaces, clearJavaSources, clearOptions, convertNameToJavaName, getAddMethodName, getAssignmentFrom, getAssignmentTo, getClassExtension, getClone, getDefaultFieldName, getDisplayName, getDOMNode, getElementDecorator, getElementDecorators, getExtendedElement, getFieldName, getGetMethodName, getImplementedInterfaces, getJavaSources, getManagerClassName, getMaxOccurs, getMinOccurs, getName, getNamespace, getNamespacePrefix, getOptions, getParent, getPrefix, getQClassName, getSchema, getSchemaType, getSetMethodName, getSuppress, getSystemId, getTypeIsExplicit, isMultiple, setAddMethodName, setClassName, setDOMNode, setExtendedElement, setFieldName, setGetMethodName, setManagerClassName, setMaxOccurs, setMinOccurs, setName, setNamespace, setNamespacePrefix, setPrefix, setSchemaType, setSetMethodName, setSuppress, setSystemId, setTypeIsExplicit
 
Methods inherited from class de.ispsoft.jaxme.generator.SchemaAnnotationOwner
getAccessors, getDocumentation, getExtendsClassName, getPackageName, setAccessors, setDocumentation, setExtendsClassName, setPackageName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPLEX_TYPE_SEQUENCE

public static final int COMPLEX_TYPE_SEQUENCE

A possible value for setComplexType(): A sequence.

See Also:
COMPLEX_TYPE_CHOICE, Constant Field Values

COMPLEX_TYPE_CHOICE

public static final int COMPLEX_TYPE_CHOICE

A possible value for setComplexType(): A choice.

See Also:
COMPLEX_TYPE_SEQUENCE, Constant Field Values

COMPLEX_TYPE_ALL

public static final int COMPLEX_TYPE_ALL

A possible value for setComplexType(): The "all" type.

See Also:
COMPLEX_TYPE_SEQUENCE, Constant Field Values
Constructor Detail

SchemaComplexElement

public SchemaComplexElement(SchemaAnnotationOwner pParent)
Creates new SchemaComplexElement

Method Detail

isComplex

public final boolean isComplex()
Description copied from class: SchemaElement

Returns whether the element is complex.

Specified by:
isComplex in class SchemaElement

isAttribute

public final boolean isAttribute()
Description copied from class: SchemaElement

Returns whether the element is actually an attribute.

Specified by:
isAttribute in class SchemaElement

getErrorCode

public java.lang.Integer getErrorCode()

Returns the error code.

Returns:
errorCode

setErrorCode

public void setErrorCode(java.lang.Integer pErrorCode)

Set the error code.


addChild

public void addChild(SchemaElement pChild)

Adds a new child to the list of childs.

See Also:
getChilds(), clearChilds()

getChilds

public java.util.Iterator getChilds()

Returns an iterator to the current list of childs. This iterator is not "live": Changes to the returned iterator won't affect the actual list and vice versa.

See Also:
clearChilds(), addChild(de.ispsoft.jaxme.generator.SchemaElement)

clearChilds

public void clearChilds()

Clears the current list of childs.

See Also:
getChilds(), addChild(de.ispsoft.jaxme.generator.SchemaElement)

addAttribute

public void addAttribute(SchemaAttribute pAttribute)
                  throws SchemaException

Adds a new attribute to the list of childs.

Throws:
SchemaException
See Also:
getAttributes(), clearAttributes()

getAttributes

public java.util.Iterator getAttributes()

Returns an iterator to the current list of attributes. This iterator is not "live": Changes to the returned iterator won't affect the actual list and vice versa.

See Also:
clearAttributes(), addAttribute(de.ispsoft.jaxme.generator.SchemaAttribute)

clearAttributes

public void clearAttributes()

Clears the current list of childs.

See Also:
getChilds(), addChild(de.ispsoft.jaxme.generator.SchemaElement)

setComplexType

public void setComplexType(int pType)
                    throws SchemaException

Sets the structure type of this element.

Parameters:
pType - Either of COMPLEX_TYPE_SEQUENCE or COMPLEX_TYPE_CHOICE
Throws:
SchemaException

getComplexType

public int getComplexType()
                   throws SchemaException

Returns the structure type of this element.

Returns:
Either of COMPLEX_TYPE_SEQUENCE or COMPLEX_TYPE_CHOICE
Throws:
SchemaException - The complex type is not yet set.

getDefaultClassName

public java.lang.String getDefaultClassName()

getClassName

public java.lang.String getClassName()
Description copied from class: SchemaElement

Returns this elements class name.

Overrides:
getClassName in class SchemaElement

getFieldType

public java.lang.String getFieldType()

Returns the Java type that this element has as a field in a parent element:

  1. If getMultiple() returns true, then the field type is java.util.List.
  2. Otherwise, if isComplex() is true, the field type is getClassName().
  3. Otherwise the field type is pChild.getSchemaType().getRuntimeType().getName().

Specified by:
getFieldType in class SchemaElement

getInstanceType

public java.lang.String getInstanceType()
Description copied from class: SchemaElement

Returns the Java type that this element would has or would have in the absence of a maxOccurs attribute.

  1. Otherwise, if isComplex() is true, the field type is getClassName().
  2. Otherwise the field type is pChild.getSchemaType().getRuntimeType().getName().

Specified by:
getInstanceType in class SchemaElement

hasProtectedConstructor

public boolean hasProtectedConstructor()

Returns whether the generated XML class has a protected constructor.


setProtectedConstructor

public void setProtectedConstructor(boolean pProtectedConstructor)

Sets whether the generated XML class has a protected constructor.


isAnyType

public boolean isAnyType()

Returns whether the elements type is xs:anyType.


getPrefixList

public java.lang.String[] getPrefixList()

Returns a list of default prefixes being used when the element is unmarshalled. The array contains a set of pairs. The even elements are the prefixes and the odd elements are the namespaces.


setPrefixList

public void setPrefixList(java.lang.String[] pPrefixList)

Sets a list of default prefixes being used when the element is unmarshalled. The array contains a set of pairs. The even elements are the prefixes and the odd elements are the namespaces.