This class holds the necessary information so that the source generator can
properly create the necessary classes for the object model.
addFieldInfo
public void addFieldInfo(FieldInfo fieldInfo)
Adds the given FieldInfo to this ClassInfo
fieldInfo
- the FieldInfo to add
addFieldInfo
public void addFieldInfo(FieldInfo[] fields)
Adds the given set of FieldInfos to this ClassInfo
fields
- an Array of FieldInfo objects
allowContent
public boolean allowContent()
- true if Classes created with this ClassInfo allow content
contains
public boolean contains(FieldInfo fieldInfo)
Returns true if the given FieldInfo is contained within this ClassInfo
fieldInfo
- the FieldInfo to check
- true if the given FieldInfo is contained within this ClassInfo
getAttributeField
public FieldInfo getAttributeField(String nodeName)
Returns a fieldInfo that corresponds to an attribute with the given node name.
A ClassInfo cannot have 2 attributes with the same xml name.
nodeName
- the NodeName of the field to get.
- a fieldInfo that corresponds to an attribute with the given node name.
getAttributeFields
public FieldInfo[] getAttributeFields()
Returns an array of XML attribute associated fields.
- an array of XML attribute associated fields.
getBaseClass
public ClassInfo getBaseClass()
Returns the base class of this classInfo if any. A classInfo can indeed
extend another classInfo to reflect the extension mechanism used in the
XML Schema.
- the base class of this classInfo if any.
getElementField
public FieldInfo getElementField(String nodeName)
Returns a fieldInfo that corresponds to an element with the given node name.
A ClassInfo cannot have 2 elements with the same xml name.
nodeName
- the NodeName of the field to get.
- a fieldInfo that corresponds to an element with the given node name.
getElementFields
public FieldInfo[] getElementFields()
Returns an array of XML element associated fields.
- an array of XML element associated fields.
getFieldCount
public int getFieldCount()
Returns the number of FieldInfo definitions for this ClassInfo.
- the number of FieldInfo definitions for this ClassInfo.
getGroupInfo
public GroupInfo getGroupInfo()
Returns the GroupInfo for this ClassInfo
- the GroupInfo for this ClassInfo
getJClass
public JClass getJClass()
Returns the JClass described by this ClassInfo
- the JClass which is described by this ClassInfo
getTextField
public FieldInfo getTextField()
Returns the FieldInfo for the XML text associated field.
- the FieldInfo for the text content associated field, this may be
null.
isAbstract
public boolean isAbstract()
Returns true if the JClass represented by this ClassInfo is abstract
- true if the JClass represented by this ClassInfo is abstract
isChoice
public boolean isChoice()
Returns true if the compositor of this GroupInfo is a choice
- true if the compositor of this GroupInfo is a choice
isContainer
public boolean isContainer()
Returns true if this ClassInfo describes a container class. A container
class is a class which should not be marshalled as XML, but whose members
should be.
- true if this ClassInfo describes a container class.
isSequence
public boolean isSequence()
Returns true if the compositor of this GroupInfo is a sequence
- true if the compositor of this GroupInfo is a sequence
setAbstract
public void setAbstract(boolean abstractClass)
Sets the class of this ClassInfo to be abstract of
abstractClass
is true, false otherwise.
abstractClass
- true if the class represented by this ClassInfo is abstract
setBaseClass
public void setBaseClass(ClassInfo base)
Sets the base class of this classInfo. A classInfo can indeed extend
another classInfo to reflect the extension mechanism used in the XML
Schema
base
- the base class of this classInfo.
setContainer
public void setContainer(boolean isContainer)
Sets whether or not this ClassInfo describes a container class. A
container class is a class which should not be marshalled as XML, but
whose members should be. By default this is false.
isContainer
- the boolean value when true indicates this class should be a
container class.