Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.Particle
org.exolab.castor.xml.schema.ElementDecl
Field Summary |
Fields inherited from class org.exolab.castor.xml.schema.Structure | |
ANNOTATION , ANYTYPE , APPINFO , ATTRIBUTE , ATTRIBUTE_GROUP , COMPLEX_CONTENT , COMPLEX_TYPE , DOCUMENTATION , ELEMENT , FACET , GROUP , IDENTITY_FIELD , IDENTITY_SELECTOR , KEY , KEYREF , LIST , MODELGROUP , MODELGROUP_REF , REDEFINE , SCHEMA , SIMPLE_CONTENT , SIMPLE_TYPE , UNION , UNIQUE , UNKNOWN , WILDCARD |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
BlockList |
|
String |
|
FinalList |
|
String |
|
Form |
|
String |
|
Enumeration |
|
String |
|
String |
|
Structure |
|
ElementDecl |
|
String |
|
String |
|
Schema |
|
short |
|
String |
|
XMLType |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void | |
void |
|
void |
|
void | |
void |
|
void | |
void |
|
void |
|
void |
|
protected void | |
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
Methods inherited from class org.exolab.castor.xml.schema.Particle | |
getMaxOccurs , getMinOccurs , setMaxOccurs , setMinOccurs |
Methods inherited from class org.exolab.castor.xml.schema.Annotated | |
addAnnotation , getAnnotations , removeAnnotation |
Methods inherited from class org.exolab.castor.xml.schema.Structure | |
getStructureType , isValid , validate |
public ElementDecl(Schema schema, String name)
Creates a new default element definition
- Parameters:
name
- the name of the Element being declared
public void addIdentityConstraint(IdentityConstraint constraint)
Adds the given IdentityConstraint to this element definition.
- Parameters:
constraint
- the IdentityConstraint to add.
public BlockList getBlock()
Returns the value of the 'block' attribute for this element
- Returns:
- the value of the block attribute.
public String getDefaultValue()
Returns the default value of this element definition.
- Returns:
- the default value of this element definition, or null if no default was specified.
public FinalList getFinal()
Returns the value of the 'final' attribute for this element definition.
- Returns:
- the FinalList for this element definition.
public String getFixedValue()
Returns the fixed value of this element definition.
- Returns:
- the fixed value of this element definition, or null if no default was specified.
public Form getForm()
Returns the Form for this element definition. The Form object species whether or not names are qualified or unqualified in the scope of this element definition. If null, the Form should be obtained from the parent Schema.
- Returns:
- the Form for this element definition, or null if not set.
public String getId()
Returns the 'id' for this element definition.
- Returns:
- the 'id' for this element definition.
public Enumeration getIdentityConstraints()
Returns an Enumeration of IdentityConstraint objects contained within this element definition.
- Returns:
- an Enumeration of IdentityConstraint objects contained within this element definition.
public String getName()
Returns the name of this Element declaration. The name of the referenced element is returned if the 'ref' attribute was used. The name returned will be an NCName (no namespace prefix will be included with the name).
- Returns:
- the name of this element declaration
public String getName(boolean ignoreRef)
Returns the name of this Element declaration. The name returned, if not null, will be an NCName.
- Parameters:
- Returns:
- the name of this element declaration
public Structure getParent()
Returns the parent of this ElementDecl, this value may be null if no parent has been set.
- Returns:
- the parent Structure of this ElementDecl
public ElementDecl getReference()
Returns the ElementDecl that this element definition references. This will return null if this element definition does not reference a different element definition.
- Returns:
- the ElementDecl that this element definition references
public String getReferenceId()
Returns the Id used to Refer to this Object
- Specified by:
- getReferenceId in interface Referable
- Returns:
- the Id used to Refer to this Object
- See Also:
Referable
public String getReferenceName()
Returns the actual reference name of this AttributeDecl, or null if this AttributeDecl is not a reference. The name returned, if not null, will be a QName, possibly containing the namespace prefix.
- Returns:
- the reference name
public Schema getSchema()
Returns the XML Schema to which this element declaration belongs.
- Returns:
- the XML Schema to which this element declaration belongs.
public short getStructureType()
Returns the type of this Schema Structure
- Overrides:
- getStructureType in interface Structure
- Returns:
- the type of this Schema Structure
public String getSubstitutionGroup()
Returns the substitutionGroup for this element declaration, or null if it's absent.
- Returns:
- the substitutionGroup membership for this element declaration, or null if absent.
public XMLType getType()
Returns the XMLType (ComplexType or SimpleType) of this ElementDecl.
- Returns:
- the XMLType of this ElementDecl
public boolean hasChildren()
Returns true if this element has children (i.e if it holds attributes or elements).
public boolean isAbstract()
Returns true if this element definition is abstract
- Returns:
- true if this element definition is abstract
public boolean isNillable()
Returns whether or not instances of this element definition may appear with no content.
- Returns:
- true if instances of this element definition may appear with no content, otherwise false.
public boolean isReference()
Returns true if this element definition simply references another element Definition
- Returns:
- true if this element definition is a reference
public boolean removeIdentityConstraint(IdentityConstraint constraint)
Removes the given IdentityConstraint from this element definition.
- Parameters:
constraint
- the IdentityConstraint to remove.
- Returns:
- true if the IdentityConstraint was contained within this element defintion.
public void setAbstract(boolean isAbstract)
Sets whether or not this element definition is abstract
- Parameters:
public void setBlock(String block)
Sets the value of the 'block' attribute for this element
- Parameters:
block
- the value of the block attribute for this element definition.
public void setBlock(BlockList block)
Sets the value of the 'block' attribute for this element
- Parameters:
block
- the value of the block attribute for this element definition.
public void setDefaultValue(String value)
Sets the default value for this element definition.
- Parameters:
value
- the default value for this element definition.
public void setFinal(String finalValue)
Sets the value of the 'final' attribute for this element definition.
- Parameters:
finalValue
- the value of the final attribute for this element definition.
public void setFinal(FinalList finalList)
Sets the value of the 'final' attribute for this element definition.
- Parameters:
public void setFixedValue(String value)
Sets the fixed value for this element definition.
- Parameters:
value
- the fixed value for this element definition.
public void setForm(Form form)
Sets the Form for this element definition. The Form object species whether or not names are qualified or unqualified in the scope of this element definition. If null, the Form is to be obtained from the parent Schema.
- Parameters:
form
- the Form type for this element definition.
public void setId(String id)
Sets the Id for this element definition.
- Parameters:
id
- the Id for this element definition.
public void setName(String name)
Sets the name of the element that this Element definition defines.
- Parameters:
name
- the name of the defined element
public void setNillable(boolean nillable)
Sets whether or not instances of this element definition may contain empty content
- Parameters:
nillable
- the flag when true indicates that instances of this element definition may appear with empty content
protected void setParent(Structure parent)
Sets the parent for this ElementDecl.
- Parameters:
parent
- the parent Structure for this ElementDecl
public void setReference(String reference)
Sets the reference for this element definition
- Parameters:
reference
- the name of the element definition that this definition references
public void setReference(ElementDecl reference)
Sets the reference for this element definition
- Parameters:
reference
- the Element definition that this definition references
public void setSubstitutionGroup(String substitutionGroup)
Sets the substitutionGroup for this element definition.
- Parameters:
substitutionGroup
- the substitutionGroup for this element definition.
public void setType(XMLType type)
Sets the XMLType for this Element declaration.
- Parameters:
type
- the XMLType for this element declaration.
Note: This method is mutually exclusive with #setTypeReference, if a reference has previously been set it will be ignored.
public void setTypeReference(String name)
Sets the type of this element to be a reference.
public void validate() throws ValidationException
Checks the validity of this element definition.
- Throws:
ValidationException
- when this element definition is invalid.