public final class AttributeDecl extends SchemaStructure implements ComponentWithValueConstraint, UserSchemaComponent, SerializableSchemaComponent, SchemaDeclaration
SchemaComponent.ValidationStatus
COMPONENT_FUNCTION_TYPE
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
|
Function |
getComponentAsFunction()
Get the schema component in the form of a function item.
|
StructuredQName |
getComponentName()
Get the attribute name
|
AttributeGroupDecl |
getContainingAttributeGroup()
Get the containing attribute group.
|
UserComplexType |
getContainingComplexType()
Get the containing complex type.
|
java.lang.String |
getDisplayName()
Returns the name of the attribute defined by this AttributeDecl.
|
int |
getFingerprint()
Gets the fingerprint of this attribute name
|
java.lang.String |
getName()
Get the local name of this Attribute Declaration.
|
NamespaceResolver |
getNamespaceResolver()
Get the namespace resolver used when the fixed or value constraints include lexical QNames
|
SimpleType |
getSimpleType()
Get the type associated with this Attribute Declaration.
|
java.lang.String |
getTargetNamespace()
Get the namespace URI of this element declaration.
|
SimpleType |
getType()
Get the type of this attribute declaration.
|
ValueConstraint |
getValueConstraint()
Get the value constraint (fixed or default value) that applies to this element declaration,
if any
|
boolean |
hasTypeAlternatives()
Determine, in the case of an Element Declaration, whether there are type alternatives defined
|
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 |
setAttributeName(StructuredQName attributeName)
Set the attribute name.
|
void |
setAttributeName(StructuredQName attributeName,
int fingerprint)
Set the attribute name.
|
void |
setContainingAttributeGroup(AttributeGroupDecl type)
Sets the containing attribute group definition.
|
void |
setContainingComplexType(UserComplexType type)
Sets the containing complex type definition.
|
void |
setInheritable(boolean inherit)
Say whether this attribute is inheritable
|
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.
|
void |
setValueConstraint(ValueConstraint vc)
Set the value constraint (fixed or default value) that applies to this element
declaration
|
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this Attribute declaration
|
elaborate, getColumnNumber, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, isValidationNeeded, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setGeneratedId, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefaultValue, getDefaultValueConstraint, getDefaultValueLexicalForm, getFixedValue, getFixedValueConstraint, getFixedValueLexicalForm, getValueConstraintAsFunction
elaborate, lookForCycles
getRedefinitionLevel, getValidationStatus
public 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 java.lang.String getName()
public java.lang.String getTargetNamespace()
public java.lang.String getDisplayName()
public void setAttributeName(StructuredQName attributeName, int fingerprint)
attributeName
- the attribute name.fingerprint
- the fingerprint of the attribute namepublic void setAttributeName(StructuredQName attributeName)
attributeName
- the attribute name.public StructuredQName getComponentName()
getComponentName
in interface SchemaDeclaration
public NamespaceResolver getNamespaceResolver()
ComponentWithValueConstraint
getNamespaceResolver
in interface ComponentWithValueConstraint
public void setTypeReference(TypeReference type)
type
- the schema type for this element declaration.public int getFingerprint()
getFingerprint
in interface SchemaDeclaration
public SimpleType getSimpleType() throws MissingComponentException
MissingComponentException
- if the reference from
the attribute declaration to its type has not been resolvedpublic SimpleType getType() throws MissingComponentException
getType
in interface SchemaDeclaration
SimpleType
MissingComponentException
public ValueConstraint getValueConstraint()
getValueConstraint
in interface ComponentWithValueConstraint
public void setSimpleType(SimpleType simpleType)
simpleType
- the SimpleType for this attribute
declarationpublic void setValueConstraint(ValueConstraint vc)
setValueConstraint
in interface ComponentWithValueConstraint
vc
- the value constraintpublic void setNamespaceResolver(NamespaceResolver resolver)
resolver
- the namespace resolverpublic NodeTest makeSchemaNodeTest() throws MissingComponentException
makeSchemaNodeTest
in interface SchemaDeclaration
MissingComponentException
- if the type of the declaration is not present in the schema.public void setInheritable(boolean inherit)
inherit
- true if it is inheritablepublic boolean isInheritable()
public boolean hasTypeAlternatives()
hasTypeAlternatives
in interface SchemaDeclaration
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
fixup
in class SchemaStructure
compiler
- used for error reportingSchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
SchemaException
- if the error listener decides an error is fatalpublic boolean isSameDeclaration(AttributeDecl other)
other
- the other attribute declarationpublic boolean isNillable()
isNillable
in interface SchemaDeclaration
public boolean isAbstract()
isAbstract
in interface SchemaDeclaration
public void serialize(SchemaModelSerializer serializer) throws XPathException
serialize
in interface SerializableSchemaComponent
serializer
- the object responsible for performing the serializationMissingComponentException
- if the component cannot be serialized because it contains dangling referencesXPathException
- if serialization failspublic Function getComponentAsFunction()
SchemaComponent
getComponentAsFunction
in interface SchemaComponent
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.