|
|||||||||||
| 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.AttributeDecl
An XML Schema Attribute Declaration. This includes global attribute declarations, local attribute declarations, and "attribute uses".
| Field Summary | |
static short |
OPTIONAL
Value representing use="optional" |
static short |
PROHIBITED
Value representing use="prohibited" |
static short |
REQUIRED
Value representing use="required" |
| 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 | |
AttributeDecl(Schema schema)
Creates a new AttrDecl in the given schema. |
|
| Method Summary | |
boolean |
fixup(Schema schema)
Fix up references to other elements in the schema. |
java.lang.String |
getDefaultValue()
Returns the default value of this attribute declaration. |
int |
getFingerprint()
Gets the fingerprint of this attribute name |
Value |
getFixedValue()
Returns the fixed value of this attribute declaration. |
java.lang.String |
getForm()
Returns the 'form' for this attribute declaration. |
java.lang.String |
getId()
Returns the Id for this attribute declaration |
java.lang.String |
getName()
Returns the name of the attribute defined by this AttributeDecl. |
AttributeDecl |
getReference()
If this is an attribute reference, returns the AttributeDecl that this attribute definition references. |
Schema |
getSchema()
Get the Schema that this AttributeDecl belongs to. |
SimpleType |
getSimpleType()
Get the type associated with this Attribute Declaration. |
short |
getStructureType()
Returns the type of this Schema Structure |
java.lang.String |
getUse()
Get the value of the 'use' attribute for this attribute declaration or attribute reference. |
boolean |
isOptional()
Returns true if the use attribute is equal to "optional". |
boolean |
isProhibited()
Returns true if the use attribute is equal to "prohibited". |
boolean |
isReference()
Returns true if this attribute definition simply references another attribute Definition |
boolean |
isRequired()
Returns true if the 'use' attribute is equal to REQUIRED and there is no specified value. |
void |
setDefaultValue(java.lang.String value)
Sets the DEFAULT value. |
void |
setFingerprint(int fingerprint)
Set the fingerprint for this attribute name. |
void |
setFixedValue(Value value)
Sets the FIXED value. |
void |
setForm(java.lang.String form)
Sets the Form for this attribute declaration. |
void |
setId(java.lang.String id)
Sets the Id for this attribute declaration. |
void |
setName(java.lang.String name)
Sets the name of attributes defined by this attribute definition. |
void |
setReference(java.lang.String reference)
Sets the reference for this attribute definition. |
void |
setSimpleType(SimpleType simpleType)
Sets the SimpleType for this attribute declaration. |
void |
setTypeFingerprint(int fingerprint)
Set the namepool fingerprint of the name of the element's type. |
void |
setUse(short value)
Sets the 'use' attribute of this attribute declaration. |
boolean |
testFixedValue(java.lang.CharSequence value)
Test a value against the fixed value. |
boolean |
validate(Schema schema)
Checks the validity of this Attribute declaration |
| 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 |
| Field Detail |
public static final short OPTIONAL
public static final short PROHIBITED
public static final short REQUIRED
| Constructor Detail |
public AttributeDecl(Schema schema)
schema - the schema that contains the new attrDecl| Method Detail |
public java.lang.String getForm()
public java.lang.String getId()
public java.lang.String getName()
public void setFingerprint(int fingerprint)
public int getFingerprint()
public SimpleType getSimpleType()
public AttributeDecl getReference()
public void setTypeFingerprint(int fingerprint)
public Schema getSchema()
public java.lang.String getUse()
public java.lang.String getDefaultValue()
public Value getFixedValue()
public boolean testFixedValue(java.lang.CharSequence value)
throws ValidationException
value - the value to be tested
ValidationException - if the value is not valid for this typepublic boolean isOptional()
public boolean isProhibited()
public boolean isRequired()
public boolean isReference()
public void setForm(java.lang.String form)
form - the form for this attribute 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 attribute declarationpublic void setName(java.lang.String name)
name - the local name of the this AttributeDecl. Must be a valid NCName. It
is the caller's responsibility to validate the name.public void setReference(java.lang.String reference)
reference - the name of the attribute definition that this
definition referencespublic void setSimpleType(SimpleType simpleType)
simpleType - the SimpleType for this attribute
declaration
public void setUse(short value)
throws SchemaException
value - one of the following:
("prohibited" | "optional" | "required")
SchemaException
public void setDefaultValue(java.lang.String value)
throws SchemaException
SchemaException
public void setFixedValue(Value value)
throws SchemaException
SchemaExceptionpublic short getStructureType()
getStructureType in class SchemaElementSchemaElement.ATTRIBUTEpublic boolean fixup(Schema schema)
fixup in interface SchemaComponentschema - The schema.
public boolean validate(Schema schema)
throws javax.xml.transform.TransformerException
validate in interface SchemaComponentschema - if this is not null, any errors that are detected should
be reported using the error() method of this schema.
javax.xml.transform.TransformerException - if the error listener decides an error is fatal
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||