|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.saxonica.schema.SchemaStructure
com.saxonica.schema.AttributeDecl
public final class AttributeDecl
An XML Schema Attribute Declaration. This includes global attribute declarations, local attribute declarations, and "attribute uses". It corresponds to either (a) an attribute declaration schema component for a global attribute, or (b) an attribute declaration schema component for a local attribute, plus an attribute use referencing that attribute declaration, or (c) an attribute use referencing a global attribute declaration.
Field Summary |
---|
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Fields inherited from interface com.saxonica.schema.SerializableSchemaComponent |
---|
ALL_COMPOSITOR, ATOMIC_TYPE, ATTRIBUTE_DECL, ATTRIBUTE_GROUP, ATTRIBUTE_GROUP_REF, ATTRIBUTE_USE, ATTRIBUTE_WILDCARD, CHOICE_COMPOSITOR, COMPLEX_TYPE, ELEMENT_DECL, ELEMENT_PARTICLE, ELEMENT_WILDCARD, FACET, KEY, KEYREF, LIST_TYPE, MODEL_GROUP, MODEL_GROUP_REF, NOTATION, SEQUENCE_COMPOSITOR, UNION_TYPE, UNIQUE |
Constructor Summary | |
---|---|
AttributeDecl(PreparedSchema schema,
boolean global)
Creates a new AttrDecl in the given schema. |
Method Summary | |
---|---|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components |
int |
getComponentTypeCode()
Get a unique number identifying the type of component |
UserComplexType |
getContainingComplexType()
Get the containing complex type. |
String |
getDefaultValue()
Returns the default value of this attribute declaration. |
String |
getDisplayName()
Returns the name of the attribute defined by this AttributeDecl. |
int |
getFingerprint()
Gets the fingerprint of this attribute name |
Value |
getFixedValue()
Returns the fixed value of this attribute declaration. |
String |
getName()
Get the local name of this Attribute Declaration. |
int |
getNameCode()
Get the nameCode of the name of this attribute declaration in the namePool |
String |
getNamespace()
Get the namespace part of the name of this Attribute Declaration. |
SimpleType |
getSimpleType()
Get the type associated with this Attribute Declaration. |
SchemaType |
getType()
Get the type of this attribute declaration. |
boolean |
isAbstract()
Determine, in the case of an Element Declaration, whether it is nillable. |
boolean |
isGlobal()
Determine whether this attribute declaration is global. |
boolean |
isNillable()
Determine, in the case of an Element Declaration, whether it is nillable. |
boolean |
isSameDeclaration(AttributeDecl other)
Test whether this is the same type as another type. |
NodeTest |
makeSchemaNodeTest()
Create a NodeTest that implements the semantics of schema-element(name) or schema-attribute(name) applied to this element or attribute declaration. |
void |
serialize(SchemaSerializer serializer)
Serialize the schema component |
void |
setContainingComplexType(UserComplexType type)
Sets the containing complex type definition. |
void |
setDefaultValue(String value)
Sets the DEFAULT value. |
void |
setFixedValue(Value value)
Sets the FIXED value. |
void |
setNameCode(int nameCode)
Set the fingerprint for this attribute name. |
void |
setNamespaceResolver(NamespaceResolver resolver)
Set the namespace resolver for resolving QName-valued fixed and default values |
void |
setSimpleType(SimpleType simpleType)
Sets the SimpleType for this attribute declaration. |
void |
setTypeFingerprint(int fingerprint)
Set the namepool fingerprint of the name of the attribute's type. |
boolean |
testFixedValue(CharSequence value,
NamespaceResolver resolver)
Test a value against the fixed value. |
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this Attribute declaration |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
---|
lookForCycles |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Constructor Detail |
---|
public AttributeDecl(PreparedSchema schema, boolean global)
schema
- the schema that contains the new attrDeclglobal
- true if the attribute declaration is globalMethod Detail |
---|
public boolean isGlobal()
public void setContainingComplexType(UserComplexType type)
public UserComplexType getContainingComplexType()
public String getName()
public String getNamespace()
public String getDisplayName()
public void setNameCode(int nameCode)
public int getFingerprint()
public int getNameCode()
public SimpleType getSimpleType() throws UnresolvedReferenceException
UnresolvedReferenceException
public SchemaType getType() throws UnresolvedReferenceException
getType
in interface SchemaDeclaration
SimpleType
UnresolvedReferenceException
public void setTypeFingerprint(int fingerprint)
public String getDefaultValue()
public Value getFixedValue()
public void setSimpleType(SimpleType simpleType)
simpleType
- the SimpleType for this attribute
declarationpublic void setDefaultValue(String value)
public void setFixedValue(Value value)
public void setNamespaceResolver(NamespaceResolver resolver)
public NodeTest makeSchemaNodeTest()
makeSchemaNodeTest
in interface SchemaDeclaration
public boolean fixup(SchemaCompiler compiler) throws SchemaException, UnresolvedReferenceException
fixup
in interface UserSchemaComponent
compiler
-
SchemaException
UnresolvedReferenceException
public boolean validate(SchemaCompiler compiler) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
SchemaException
- if the error listener decides an error is fatal
ValidationException
public boolean testFixedValue(CharSequence value, NamespaceResolver resolver) throws ValidationException
value
- the value to be tested
ValidationException
- if the value is not valid for this typepublic boolean isSameDeclaration(AttributeDecl other)
public boolean isNillable()
isNillable
in interface SchemaDeclaration
public boolean isAbstract()
isAbstract
in interface SchemaDeclaration
public void serialize(SchemaSerializer serializer) throws IOException
serialize
in interface SerializableSchemaComponent
IOException
public int getComponentTypeCode()
getComponentTypeCode
in interface SerializableSchemaComponent
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |