de.ispsoft.jaxme.generator
Class SchemaAbstractSimpleElement

java.lang.Object
  extended byde.ispsoft.jaxme.generator.SchemaAnnotationOwner
      extended byde.ispsoft.jaxme.generator.SchemaElement
          extended byde.ispsoft.jaxme.generator.SchemaAbstractSimpleElement
Direct Known Subclasses:
SchemaAttribute, SchemaSimpleElement

public abstract class SchemaAbstractSimpleElement
extends SchemaElement

Implementation of a simple element. Abstract, because it is used to derive both simple elements and attributes.

Author:
Jochen Wiedmann

Nested Class Summary
 
Nested classes inherited from class de.ispsoft.jaxme.generator.SchemaElement
SchemaElement.ClassExtension, SchemaElement.ImplementedInterface, SchemaElement.PieceOfJavaSource
 
Constructor Summary
SchemaAbstractSimpleElement(SchemaAnnotationOwner pParent)
          Creates new SchemaAbstractSimpleElement
 
Method Summary
 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.Short getPrimaryKey()
          Returns whether this element is part of a primary key.
 java.lang.String getQueryName()
          Returns a name for the element being used in queries.
 ElementRestrictionContainer getRestrictions()
          Returns the elements restrictions, if any, or null.
 boolean isComplex()
          Returns whether the element is complex.
 void setPrimaryKey(java.lang.Short pPrimaryKey)
          Sets whether this element is part of a primary key.
 void setQueryName(java.lang.String pQueryName)
          Sets a name for the element being used in queries.
 
Methods inherited from class de.ispsoft.jaxme.generator.SchemaElement
addClassExtension, addElementDecorator, addImplementedInterface, addJavaSource, addOption, clearClassExtensions, clearImplementedInterfaces, clearJavaSources, clearOptions, convertNameToJavaName, getAddMethodName, getAssignmentFrom, getAssignmentTo, getClassExtension, getClassName, 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, isAttribute, 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
 

Constructor Detail

SchemaAbstractSimpleElement

public SchemaAbstractSimpleElement(SchemaAnnotationOwner pParent)
Creates new SchemaAbstractSimpleElement

Method Detail

isComplex

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

Returns whether the element is complex.

Specified by:
isComplex in class SchemaElement

getPrimaryKey

public java.lang.Short getPrimaryKey()

Returns whether this element is part of a primary key. The order of all parts can be determined by sorting all the result, lower comes first.

See Also:
setPrimaryKey(java.lang.Short)

setPrimaryKey

public void setPrimaryKey(java.lang.Short pPrimaryKey)

Sets whether this element is part of a primary key. The order of all parts can be determined by sorting all the result, lower comes first.

See Also:
getPrimaryKey()

getQueryName

public java.lang.String getQueryName()

Returns a name for the element being used in queries.


setQueryName

public void setQueryName(java.lang.String pQueryName)

Sets a name for the element being used in queries.


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

getRestrictions

public ElementRestrictionContainer getRestrictions()

Returns the elements restrictions, if any, or null.