|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.saxonica.schema.SchemaElement
|
+--com.saxonica.schema.AbstractParticle
|
+--com.saxonica.schema.ElementDecl
The object represents an element declaration in the schema. It may be a global element declaration, a local element declaration, or a reference to an element declaration (xs:element with a ref attribute)
| Field Summary |
| Fields inherited from class com.saxonica.schema.AbstractParticle |
UNBOUNDED |
| Fields inherited from class com.saxonica.schema.SchemaElement |
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, COMPOSITOR, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD_ATTRIBUTE, WILDCARD_ELEMENT |
| Constructor Summary | |
ElementDecl(Schema schema,
javax.xml.transform.SourceLocator locator)
Creates a new element declaration |
|
| Method Summary | |
void |
addIdentityConstraint(IdentityConstraint constraint)
Adds the given IdentityConstraint to this element definition. |
void |
addSubstitutionGroupMember(ElementDecl member)
Add a member of the substitution group that has this element as its head. |
boolean |
allowsDerivation(int derivation)
Determines whether derivation (of a particular kind) from this type is allowed, based on the "final" property |
void |
compile(Schema schema,
UserComplexType subjectType)
Compile this local element declaration, considered as a particle of some complex type, by compiling its own complex type definition. |
boolean |
fixup(Schema schema)
Fix up references. |
protected void |
fixupSubstitutionGroup(NamePool pool)
Fix up the reference to the head of the substitition group |
int |
getBlock()
Returns the value of the 'block' attribute for this element |
ValidationContext |
getContainedValidationContext()
Get the validation context for validating the children of this element. |
java.lang.String |
getDefaultValue()
Returns the default value defined for this element definition. |
int |
getFingerprint()
Get the fingerprint of the name of this element declation in the namePool |
java.lang.String |
getFixedValue()
Returns the 'fixed' value defined for this element declaration. |
java.lang.String |
getForm()
Returns the 'form' for this element definition. |
java.lang.String |
getId()
Returns the 'id' value for for this element definition. |
java.util.Iterator |
getIdentityConstraints()
Returns an Iterator over the identity constrains defined within this element definition. |
java.lang.String |
getLocalName()
Returns the local name of this Element declaration. |
java.lang.String |
getName(boolean ignoreRef)
Returns the name of this Element declaration. |
ElementDecl |
getReference()
If this is an element reference, returns the ElementDecl that this element definition references. |
Schema |
getSchema()
Returns the Schema to which this element declaration belongs. |
short |
getStructureType()
Returns the type of this SchemaElement |
int |
getSubstitutionGroupHead()
Returns the head of the substitutionGroup for this element declaration, or -1 if there is none. |
java.util.Set |
getSubstitutionGroupMembers()
Get the known members of the substitution group of this element, as a Set containing the ElementDecl objects. |
SchemaType |
getType()
Returns the Schema Type (ComplexType or SimpleType) of this Element Declaration. |
int |
getTypeFingerprint()
Get the namepool fingerprint of the name of the element's type. |
boolean |
isAbstract()
Returns true if this element definition is abstract |
boolean |
isEmptiable()
Determine if this particle can be empty |
boolean |
isNillable()
Determine whether or not instances of this element definition permit xsi:nil to be set to "yes". |
boolean |
isReference()
Determine whether this ElementDecl represents an element reference, that is, an xs:element element with a 'ref' attribute. |
java.util.Iterator |
iterateSubstitutionGroup()
Iterate over all the elements contained in the substitution group of which this element is the head. |
void |
registerComplexTypeUsingThisElement(UserComplexType type)
Register a complex type that contains this element as a particle. |
void |
setAbstract(boolean isAbstract)
Sets whether or not this element definition is abstract. |
void |
setBlock(int block)
Sets the value of the 'block' attribute for this element For internal use only. |
void |
setDefaultValue(java.lang.String value)
Sets the 'default' value for this element declaration. |
void |
setFinalProhibitions(int finalValue)
Sets the value of the 'final' property, indicating which types of derivation are not allowed. |
void |
setFingerprint(int fingerprint)
Set the fingerprint of the name of this element declaration in the namePool |
void |
setFixedValue(java.lang.String value)
Sets the fixed value for this element definition. |
void |
setForm(java.lang.String form)
Sets the 'form' for this element declaration. |
void |
setId(java.lang.String id)
Sets the id for this element definition. |
void |
setName(java.lang.String name)
Sets the name of the element that this Element definition defines. |
void |
setNillable(boolean nillable)
Sets whether or not instances of this element definition may set xsi:nil='true'. |
void |
setReference(java.lang.String reference)
Sets the value of the 'ref' attribute for this element reference. |
void |
setSubstitutionGroupHead(int substitutionGroupHead)
Sets the fingerprint of the name of the head of the substitutionGroup for this element definition. |
void |
setType(SchemaType type)
Sets the schema type for this element declaration. |
void |
setTypeFingerprint(int fingerprint)
Set the namepool fingerprint of the name of the element's type. |
boolean |
validate(Schema schema)
Check the validity (consistency) of this element definition. |
| Methods inherited from class com.saxonica.schema.AbstractParticle |
getMaxOccurs, getMinOccurs, getTerm, setMaxOccurs, setMinOccurs |
| Methods inherited from class com.saxonica.schema.SchemaElement |
getColumnNumber, getLineNumber, getPublicId, getSystemId, setLocator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ElementDecl(Schema schema,
javax.xml.transform.SourceLocator locator)
schema - the XML Schema to which this element declaration
belongslocator - identifies the location of the element declaration in the
source schema| Method Detail |
public void addIdentityConstraint(IdentityConstraint constraint)
constraint - the IdentityConstraint to add.public int getBlock()
SchemaType.DERIVE_BY_SUBSTITUTION, indicating
which kinds of derivation from this element declaration are blocked.public java.lang.String getDefaultValue()
public boolean allowsDerivation(int derivation)
derivation - the kind of derivation, e.g. SchemaType.DERIVE_BY_LIST
public java.lang.String getFixedValue()
public java.lang.String getForm()
public java.lang.String getId()
public java.util.Iterator getIdentityConstraints()
IdentityConstraint objects contained within
this element definition.public java.lang.String getLocalName()
public java.lang.String getName(boolean ignoreRef)
ignoreRef - if false the name of the referenced
element (if specified) is returned, otherwise the
localname (may be null).
public int getTypeFingerprint()
public void setTypeFingerprint(int fingerprint)
public SchemaType getType()
public ElementDecl getReference()
public Schema getSchema()
public int getSubstitutionGroupHead()
public java.util.Set getSubstitutionGroupMembers()
public void addSubstitutionGroupMember(ElementDecl member)
throws SchemaException
member - The element declaration to be added to the substitution group of which this
element declaration is the head. Elements are added to each ancestor in the substitution
group hierarchy.
SchemaExceptionpublic void registerComplexTypeUsingThisElement(UserComplexType type)
type - A complex type that contains this element as a particle.public boolean isAbstract()
public boolean isNillable()
public boolean isReference()
public void setAbstract(boolean isAbstract)
isAbstract - a boolean: when true indicates that this
element definition is abstractpublic void setBlock(int block)
block - the value of the block attribute for this
element definition, indicating the types of derivation that are not allowed,
as a bit-significant integer, using constants such as SchemaType.DERIVE_BY_EXTENSIONpublic void setDefaultValue(java.lang.String value)
value - the default value for this element declaration.public void setFinalProhibitions(int finalValue)
finalValue - the bit-significant code representing the final property,
made up of values such as SchemaType.DERIVE_BY_SUBSTITUTIONpublic void setFixedValue(java.lang.String value)
value - the fixed value for this element definition.public void setForm(java.lang.String form)
form - the form for this element declaration, as a string,
"qualified" or "unqualified". The caller is responsible for validating
the value.public void setId(java.lang.String id)
id - the id for this element definition.public void setName(java.lang.String name)
name - the name of the element declaration.public void setNillable(boolean nillable)
nillable - the flag when true indicates that instances
of this element definition may be nilledpublic void setReference(java.lang.String reference)
reference - the name of the element definition that this
definition references, as set in the 'ref' attributepublic void setFingerprint(int fingerprint)
fingerprint - the fingerprint of the element namepublic int getFingerprint()
public void setSubstitutionGroupHead(int substitutionGroupHead)
substitutionGroupHead - the fingerprint of the name of the head of the
substitutionGroup of this element definition.public java.util.Iterator iterateSubstitutionGroup()
public void setType(SchemaType type)
type - the schema type for this element declaration.public short getStructureType()
getStructureType in class SchemaElementSchemaElement.ELEMENT)public boolean isEmptiable()
isEmptiable in interface Particlepublic ValidationContext getContainedValidationContext()
public boolean fixup(Schema schema)
fixup in interface SchemaComponentschema - Not used
public boolean validate(Schema schema)
throws javax.xml.transform.TransformerException
validate in interface SchemaComponentschema - the containing schema - used for reporting errors. Any
errors will be reported to the error listener.
javax.xml.transform.TransformerException - if an error is found and the
error listener decides that the error is fatal
protected void fixupSubstitutionGroup(NamePool pool)
throws SchemaException
pool - the name pool
SchemaException - if any error occurs, for example a name that is referenced
but not declared
public void compile(Schema schema,
UserComplexType subjectType)
throws SchemaException
compile in interface Particleschema - The containing schema (used to generate error messages)subjectType - The containing complex type (used so that this can be registered with any
elements appearing as particles in the content model, so that the complex type can be recompiled
if the substitution group membership of the element declaration subsequently changes)
SchemaException - if compilation fails.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||