|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.generator.SchemaAnnotationOwner de.ispsoft.jaxme.generator.SchemaElement
Represents a single SchemaElement.
Nested Class Summary | |
protected class |
SchemaElement.ClassExtension
|
protected class |
SchemaElement.ImplementedInterface
|
protected class |
SchemaElement.PieceOfJavaSource
|
Constructor Summary | |
SchemaElement(SchemaAnnotationOwner pParent)
Creates a new SchemaElement instance. |
Method Summary | |
void |
addClassExtension(java.lang.String pExtendedClassName,
java.lang.String pExtendingClassName)
Adds an item to the list of extension declarations. |
void |
addElementDecorator(ElementDecoratorFactory pFactory,
ElementDecorator pElement)
Adds an ElementDecorator to the list of
registered decorators. |
void |
addImplementedInterface(java.lang.String pInterface,
java.lang.String pClass)
Adds an interface name to the list of interfaces implemented by the specified class. |
void |
addJavaSource(java.lang.String pSource,
java.lang.String pClass)
Adds a piece of Java source being included into the generated classes. |
void |
addOption(java.lang.Object pOption)
Adds an option to the list of options configuring the element. |
void |
clearClassExtensions()
Clears the list of class extension declarations. |
void |
clearImplementedInterfaces()
Clears the list of interfaces implemented by the generated classes. |
void |
clearJavaSources()
Clears the list of Java source pieces being included into the generated classes. |
void |
clearOptions()
Clears the elements list of options. |
protected java.lang.String |
convertNameToJavaName(java.lang.String pName)
|
java.lang.String |
getAddMethodName()
If this element has accessor methods: Returns the name of the get method. |
java.lang.String |
getAssignmentFrom()
Returns Java code that reads the fields value. |
java.lang.String |
getAssignmentTo(java.lang.String pValue)
Returns Java code that assigns a value to this field. |
java.lang.String |
getClassExtension(java.lang.String pPackage,
java.lang.String pClass)
Returns a class extended by the given class or null, if no matching declaration was found. |
java.lang.String |
getClassName()
Returns this elements class name. |
java.lang.String |
getClone(java.lang.String pValue)
Returns Java code that creates a clone of this element. |
java.lang.String |
getDefaultFieldName()
Returns this elements default field name. |
java.lang.String |
getDisplayName()
Returns a human readable version of the element name. |
org.w3c.dom.Element |
getDOMNode()
If this element was generated from an XML schema: The xs:element or xs:attribute node defining the element or attribute. |
ElementDecorator |
getElementDecorator(ElementDecoratorFactory pFactory)
Returns an ElementDecorator registered
for the given ElementDecoratorFactory . |
java.util.Iterator |
getElementDecorators()
Returns an iterator to the list of registered ElementDecorator instances. |
SchemaElement |
getExtendedElement()
Returns an element extended by the current element. |
java.lang.String |
getFieldName()
Returns this elements field name. |
abstract 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 |
getGetMethodName()
If this element has accessor methods: Returns the name of the get method. |
java.lang.String[] |
getImplementedInterfaces(java.lang.String pPackage,
java.lang.String pClass)
Returns the array of interfaces implemented by the given class. |
abstract 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[] |
getJavaSources(java.lang.String pPackage,
java.lang.String pClass)
Returns Java source being included into the given class. |
java.lang.String |
getManagerClassName()
Returns the manager class name. |
int |
getMaxOccurs()
Returns the maximum number of occurrences. |
int |
getMinOccurs()
Returns the minimum number of occurrences. |
java.lang.String |
getName()
Returns the elements local name. |
java.lang.String |
getNamespace()
Returns the elements namespace. |
java.lang.String |
getNamespacePrefix()
Returns the elements preferred namespace prefix. |
java.util.Iterator |
getOptions()
Returns an iterator to the elements options. |
SchemaAnnotationOwner |
getParent()
|
java.lang.String |
getPrefix()
Returns the prefix being used for default field names. |
java.lang.String |
getQClassName()
Returns the fully qualified class name, including a package name. |
Schema |
getSchema()
Returns the schema. |
SchemaType |
getSchemaType()
Returns this elements SchemaType. |
java.lang.String |
getSetMethodName()
If this element has accessor methods: Returns the name of the set method. |
boolean |
getSuppress()
Returns whether this element should be suppressed. |
java.lang.String |
getSystemId()
Returns the SchemaElements SystemId. |
boolean |
getTypeIsExplicit()
Returns whether the elements type was explicitly specified. |
abstract boolean |
isAttribute()
Returns whether the element is actually an attribute. |
abstract boolean |
isComplex()
Returns whether the element is complex. |
boolean |
isMultiple()
Returns whether this element or attribute can occur multiple times. |
void |
setAddMethodName(java.lang.String pAddMethodName)
Sets the name of the add method. |
void |
setClassName(java.lang.String pClassName)
Sets this elements class name. |
void |
setDOMNode(org.w3c.dom.Element pNode)
If this element was generated from an XML schema: Sets the xs:element or xs:attribute node defining the element or attribute. |
void |
setExtendedElement(SchemaElement pExtendedElement)
Sets an element extended by the current element. |
void |
setFieldName(java.lang.String pFieldName)
Sets this elements field name. |
void |
setGetMethodName(java.lang.String pGetMethodName)
Sets the name of the get method. |
void |
setManagerClassName(java.lang.String pManagerClassName)
Sets the manager class name. |
void |
setMaxOccurs(int pMaxOccurs)
Sets the maximum number of occurrences; -1 for unbounded. |
void |
setMinOccurs(int pMinOccurs)
Sets the minimum number of occurrences. |
void |
setName(java.lang.String pName)
Sets the elements local name. |
void |
setNamespace(java.lang.String pNamespace)
Sets the elements namespace. |
void |
setNamespacePrefix(java.lang.String pPrefix)
Sets the elements preferred namespace prefix. |
void |
setPrefix(java.lang.String pPrefix)
Sets the prefix being used for default field names. |
void |
setSchemaType(SchemaType pSchemaType)
Sets this elements SchemaType. |
void |
setSetMethodName(java.lang.String pSetMethodName)
Sets the name of the set method. |
void |
setSuppress(boolean pSuppress)
Sets whether this element should be suppressed. |
void |
setSystemId(java.lang.String pSystemId)
Sets the SchemaElements SystemId. |
void |
setTypeIsExplicit(boolean pTypeIsExplicit)
Sets whether the elements type was explicitly specified. |
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 |
public SchemaElement(SchemaAnnotationOwner pParent)
Method Detail |
public SchemaAnnotationOwner getParent()
public Schema getSchema()
SchemaAnnotationOwner
Returns the schema.
getSchema
in class SchemaAnnotationOwner
public abstract boolean isComplex()
Returns whether the element is complex.
public abstract boolean isAttribute()
Returns whether the element is actually an attribute.
public void setNamespace(java.lang.String pNamespace)
Sets the elements namespace.
public java.lang.String getNamespace()
Returns the elements namespace.
public void setName(java.lang.String pName)
Sets the elements local name.
public java.lang.String getName()
Returns the elements local name.
public void setSchemaType(SchemaType pSchemaType)
Sets this elements SchemaType.
public SchemaType getSchemaType()
Returns this elements SchemaType.
public void setFieldName(java.lang.String pFieldName)
Sets this elements field name.
public java.lang.String getDefaultFieldName()
Returns this elements default field name.
public java.lang.String getFieldName()
Returns this elements field name.
public void setClassName(java.lang.String pClassName)
Sets this elements class name.
public java.lang.String getClassName()
Returns this elements class name.
public java.lang.String getQClassName()
Returns the fully qualified class name, including a package name.
public void setSuppress(boolean pSuppress)
Sets whether this element should be suppressed.
public boolean getSuppress()
Returns whether this element should be suppressed.
protected java.lang.String convertNameToJavaName(java.lang.String pName)
public void setMinOccurs(int pMinOccurs)
Sets the minimum number of occurrences.
public int getMinOccurs()
Returns the minimum number of occurrences.
public void setMaxOccurs(int pMaxOccurs)
Sets the maximum number of occurrences; -1 for unbounded.
public int getMaxOccurs()
Returns the maximum number of occurrences.
public boolean isMultiple()
Returns whether this element or attribute can occur multiple times. Same as
getMaxOccurs() > 1 || getMaxOccurs() == -1
public void setSystemId(java.lang.String pSystemId)
Sets the SchemaElements SystemId.
public java.lang.String getSystemId()
Returns the SchemaElements SystemId.
public java.lang.String getDisplayName()
Returns a human readable version of the element name.
public void setPrefix(java.lang.String pPrefix)
Sets the prefix being used for default field names.
getFieldName()
public java.lang.String getPrefix()
Returns the prefix being used for default field names.
getFieldName()
public void setGetMethodName(java.lang.String pGetMethodName)
Sets the name of the get method. Used only if
getAccessor()
returns true.
public java.lang.String getGetMethodName()
If this element has accessor methods: Returns the name of the get method.
public void setSetMethodName(java.lang.String pSetMethodName)
Sets the name of the set method. Used only if
getAccessor()
returns true.
public java.lang.String getSetMethodName()
If this element has accessor methods: Returns the name of the set method.
public void setAddMethodName(java.lang.String pAddMethodName)
Sets the name of the add method. Used only if
getAccessor()
returns true.
public java.lang.String getAddMethodName()
If this element has accessor methods: Returns the name of the get method.
public java.lang.String getAssignmentTo(java.lang.String pValue)
Returns Java code that assigns a value to this field.
public java.lang.String getAssignmentFrom()
Returns Java code that reads the fields value.
public abstract java.lang.String getFieldType()
Returns the Java type that this element has as a field in a parent element:
getMultiple()
returns true, then
the field type is java.util.List
.isComplex()
is true,
the field type is getClassName()
.pChild.getSchemaType().getRuntimeType().getName()
.
public abstract java.lang.String getInstanceType()
Returns the Java type that this element would has
or would have in the absence of a maxOccurs
attribute.
isComplex()
is true,
the field type is getClassName()
.pChild.getSchemaType().getRuntimeType().getName()
.
public java.lang.String getClone(java.lang.String pValue)
Returns Java code that creates a clone of this element.
public void addOption(java.lang.Object pOption)
Adds an option to the list of options configuring the element.
public void clearOptions()
Clears the elements list of options.
public java.util.Iterator getOptions()
Returns an iterator to the elements options.
public void setManagerClassName(java.lang.String pManagerClassName)
Sets the manager class name.
public java.lang.String getManagerClassName()
Returns the manager class name.
public SchemaElement getExtendedElement()
Returns an element extended by the current element. It is a JaxMe design flaw, that the XML schema standard doesn't define extension of elements, but extension of types.
public void setExtendedElement(SchemaElement pExtendedElement)
Sets an element extended by the current element. It is a JaxMe design flaw, that the XML schema standard doesn't define extension of elements, but extension of types.
public boolean getTypeIsExplicit()
Returns whether the elements type was explicitly specified.
public void setTypeIsExplicit(boolean pTypeIsExplicit)
Sets whether the elements type was explicitly specified.
public void addJavaSource(java.lang.String pSource, java.lang.String pClass)
Adds a piece of Java source being included into the generated classes.
public void clearJavaSources()
Clears the list of Java source pieces being included into the generated classes.
public java.lang.String[] getJavaSources(java.lang.String pPackage, java.lang.String pClass)
Returns Java source being included into the given class.
public void addImplementedInterface(java.lang.String pInterface, java.lang.String pClass)
Adds an interface name to the list of interfaces implemented by the specified class.
public void clearImplementedInterfaces()
Clears the list of interfaces implemented by the generated classes.
public java.lang.String[] getImplementedInterfaces(java.lang.String pPackage, java.lang.String pClass)
Returns the array of interfaces implemented by the given class.
public void addClassExtension(java.lang.String pExtendedClassName, java.lang.String pExtendingClassName)
Adds an item to the list of extension declarations.
pExtendedClassName
- Name of the class being extendedpExtendingClassName
- Name of the extending classpublic void clearClassExtensions()
Clears the list of class extension declarations.
public java.lang.String getClassExtension(java.lang.String pPackage, java.lang.String pClass)
Returns a class extended by the given class or null, if no matching declaration was found.
public void addElementDecorator(ElementDecoratorFactory pFactory, ElementDecorator pElement)
Adds an ElementDecorator
to the list of
registered decorators. If another decorator is already
registered for the same factory, is is removed and the
new decorator is registered instead.
pFactory
- The ElementDecoratorFactory
that created the decorator.pElement
- The ElementDecorator
being
registered. May be null to remove a previously registered
decorator.public ElementDecorator getElementDecorator(ElementDecoratorFactory pFactory)
Returns an ElementDecorator
registered
for the given ElementDecoratorFactory
.
pFactory
- The ElementDecoratorFactory
that was used as the first argument in a previous call to
addElementDecorator
to register a decorator.
ElementDecorator
or null, if no
decorator was registered for the given factory.public java.util.Iterator getElementDecorators()
Returns an iterator to the list of registered ElementDecorator instances.
public void setNamespacePrefix(java.lang.String pPrefix)
Sets the elements preferred namespace prefix.
public java.lang.String getNamespacePrefix()
Returns the elements preferred namespace prefix.
public org.w3c.dom.Element getDOMNode()
If this element was generated from an XML schema: The xs:element or xs:attribute node defining the element or attribute.
public void setDOMNode(org.w3c.dom.Element pNode)
If this element was generated from an XML schema: Sets the xs:element or xs:attribute node defining the element or attribute.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |