public final class AttributeDecl extends SchemaStructure implements UserSchemaComponent, SerializableSchemaComponent, SchemaDeclaration
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING| Constructor and Description |
|---|
AttributeDecl(EnterpriseConfiguration config,
boolean global)
Creates a new AttrDecl in the given schema.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components
|
FunctionItem |
getComponentAsFunction()
Get the schema component in the form of a function item.
|
AttributeGroupDecl |
getContainingAttributeGroup()
Get the containing attribute group.
|
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
|
AtomicSequence |
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()
Deprecated.
since 9.0: use the renamed method getTargetNamespace()
|
SimpleType |
getSimpleType()
Get the type associated with this Attribute Declaration.
|
String |
getTargetNamespace()
Get the namespace URI of this element declaration.
|
SimpleType |
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 |
isInheritable()
Ask whether this attribute is inheritable
|
boolean |
isNillable()
Determine, in the case of an Element Declaration, whether it is nillable.
|
boolean |
isSameDeclaration(AttributeDecl other)
Test whether this is the same declaration as another attribute declaration.
|
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(SchemaModelSerializer serializer)
Serialize the schema component
|
void |
setContainingAttributeGroup(AttributeGroupDecl type)
Sets the containing attribute group definition.
|
void |
setContainingComplexType(UserComplexType type)
Sets the containing complex type definition.
|
void |
setDefaultValue(String value)
Sets the default value.
|
void |
setFixedValue(AtomicSequence value)
Sets the fixed value.
|
void |
setInheritable(boolean inherit)
Say whether this attribute is inheritable
|
void |
setNameCode(int nameCode)
Set the name code 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 |
setTypeReference(TypeReference type)
Sets the schema type for this attribute declaration.
|
boolean |
testFixedValue(CharSequence value,
NamespaceResolver resolver)
Test a value against the fixed value.
|
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this Attribute declaration
|
elaborate, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, lookForCycles, makeXPathExpressionPropertyRecord, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitelaborate, lookForCyclesgetRedefinitionLevel, getValidationStatuspublic AttributeDecl(EnterpriseConfiguration config, boolean global)
config - the configuration that contains the new attrDeclglobal - true if the attribute declaration is globalpublic boolean isGlobal()
public void setContainingComplexType(UserComplexType type)
type - the containing complex typepublic UserComplexType getContainingComplexType()
public void setContainingAttributeGroup(AttributeGroupDecl type)
type - the containing attribute grouppublic AttributeGroupDecl getContainingAttributeGroup()
public String getName()
public String getNamespace()
public String getTargetNamespace()
public String getDisplayName()
public void setNameCode(int nameCode)
nameCode - the nameCode, as allocated from the name pool.public void setTypeReference(TypeReference type)
type - the schema type for this element declaration.public int getFingerprint()
getFingerprint in interface SchemaDeclarationpublic int getNameCode()
public SimpleType getSimpleType() throws UnresolvedReferenceException
UnresolvedReferenceException - if the reference from
the attribute declaration to its type has not been resolvedpublic SimpleType getType() throws UnresolvedReferenceException
getType in interface SchemaDeclarationSimpleTypeUnresolvedReferenceExceptionpublic String getDefaultValue()
public AtomicSequence getFixedValue()
public void setSimpleType(SimpleType simpleType)
simpleType - the SimpleType for this attribute
declarationpublic void setDefaultValue(String value)
value - the default valuepublic void setFixedValue(AtomicSequence value)
value - the fixed value. This will initially be saved as an UntypedAtomicValue; later, when the type
is known, it will be converted to the correct typepublic void setNamespaceResolver(NamespaceResolver resolver)
resolver - the namespace resolverpublic NodeTest makeSchemaNodeTest()
makeSchemaNodeTest in interface SchemaDeclarationpublic void setInheritable(boolean inherit)
inherit - true if it is inheritablepublic boolean isInheritable()
public boolean fixup(SchemaCompiler compiler) throws SchemaException, UnresolvedReferenceException
fixup in interface UserSchemaComponentfixup in class SchemaStructurecompiler - used for error reportingSchemaExceptionUnresolvedReferenceExceptionpublic boolean validate(SchemaCompiler compiler) throws SchemaException
validate in interface UserSchemaComponentSchemaException - if the error listener decides an error is fatalpublic boolean testFixedValue(CharSequence value, NamespaceResolver resolver) throws ValidationException
value - the value to be testedresolver - Namespace resolver for use if the value is namespace-sensitive (QName or NOTATION)ValidationException - if the value is not valid for this typepublic boolean isSameDeclaration(AttributeDecl other)
other - the other attribute declarationpublic boolean isNillable()
isNillable in interface SchemaDeclarationpublic boolean isAbstract()
isAbstract in interface SchemaDeclarationpublic void serialize(SchemaModelSerializer serializer) throws XPathException
serialize in interface SerializableSchemaComponentserializer - the object responsible for performing the serializationXPathException - if serialization failspublic FunctionItem getComponentAsFunction()
SchemaComponentgetComponentAsFunction in interface SchemaComponentCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.