|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.AttributeDecl
public final class AttributeDecl
An XML Schema Attribute Definition
Field Summary | |
---|---|
static java.lang.String |
USE_OPTIONAL
The use attribute value for optional |
static java.lang.String |
USE_PROHIBITED
The use attribute value for prohibited |
static java.lang.String |
USE_REQUIRED
The use attribute value for required |
Fields inherited from class org.exolab.castor.xml.schema.Structure |
---|
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD |
Constructor Summary | |
---|---|
AttributeDecl(Schema schema)
Creates a new AttrDecl in the given schema. |
|
AttributeDecl(Schema schema,
java.lang.String name)
Creates a new AttrDecl with the given name |
Method Summary | |
---|---|
java.lang.String |
getDefaultValue()
Returns the default value of this element definition. |
java.lang.String |
getFixedValue()
Returns the fixed value of this element definition. |
Form |
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 attributes defined by this AttributeDecl. |
java.lang.String |
getName(boolean ignoreRef)
Returns the name of this Attribute declaration. |
Structure |
getParent()
Returns the parent of this AttributeDecl, this value may be null if no parent has been set. |
AttributeDecl |
getReference()
Returns the AttributeDecl that this attribute definition references. |
java.lang.String |
getReferenceName()
Returns the actual reference name of this AttributeDecl, or null if this AttributeDecl is not a reference. |
Schema |
getSchema()
Returns the Schema that this AttributeGroupDecl belongs to. |
SimpleType |
getSimpleType()
Returns the data type associated with this AttributeDecl. |
short |
getStructureType()
Returns the type of this Schema Structure |
java.lang.String |
getUse()
Returns the value of the use attribute for this attribute declaration or attribute reference. |
boolean |
isDefault()
Returns true if the "default" flag is set. |
boolean |
isFixed()
Returns true if the use attribute is equal to "optional". |
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 |
setFixedValue(java.lang.String value)
Sets the FIXED value. |
void |
setForm(Form 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 |
protected void |
setParent(Structure parent)
Sets the parent for this AttributeDecl |
void |
setReference(AttributeDecl reference)
Sets the reference for this attribute definition |
void |
setReference(java.lang.String reference)
Sets the reference for this attribute definition |
protected void |
setSchema(Schema schema)
Set the parent schema of the current ElementDecl. |
void |
setSimpleType(SimpleType simpleType)
Sets the SimpleType for this attribute declaration |
void |
setSimpleTypeReference(java.lang.String name)
Sets the simple type of this attribute to be a reference. |
void |
setUse(java.lang.String value)
Sets the 'use' attribute of this attribute declaration Note: this should not be used to set the flag to FIXED or DEFAULT |
void |
validate()
Checks the validity of this Attribute declaration |
Methods inherited from class org.exolab.castor.xml.schema.Annotated |
---|
addAnnotation, getAnnotations, removeAnnotation |
Methods inherited from class org.exolab.castor.xml.schema.Structure |
---|
isValid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USE_OPTIONAL
public static final java.lang.String USE_PROHIBITED
public static final java.lang.String USE_REQUIRED
Constructor Detail |
---|
public AttributeDecl(Schema schema, java.lang.String name)
name
- of the Attribute defined by this attribute declarationschema
- the schema that contains the new attrDeclpublic AttributeDecl(Schema schema)
schema
- the schema that contains the new attrDeclMethod Detail |
---|
public Form getForm()
public java.lang.String getId()
public java.lang.String getName()
public java.lang.String getName(boolean ignoreRef)
ingoreRef
- a boolean that when false, indicates
that if this is an attribute reference to return the
reference name. Otherwise the only the local name is used.
public Structure getParent()
public SimpleType getSimpleType()
public AttributeDecl getReference()
public java.lang.String getReferenceName()
public Schema getSchema()
public java.lang.String getUse()
public java.lang.String getDefaultValue()
public java.lang.String getFixedValue()
public boolean isDefault()
public boolean isFixed()
public boolean isOptional()
public boolean isProhibited()
public boolean isRequired()
public boolean isReference()
public void setForm(Form form)
form
- the Form type for this attribute declaration.public void setId(java.lang.String id)
id
- the Id for this attribute declarationpublic void setName(java.lang.String name)
name
- the name of the this AttributeDecl. Must be a valid NCName.
java.lang.IllegalArgumentException
- when the name is not validprotected void setParent(Structure parent)
parent
- the parent Structure for this AttributeDeclpublic void setReference(AttributeDecl reference)
reference
- the Attribute definition that this definition referencespublic 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
declarationpublic void setSimpleTypeReference(java.lang.String name)
name
- the name of the simpleType being referenced, must
not be null.public void setUse(java.lang.String value)
value
- one of the following:
("prohibited" | "optional" | "required")USE_PROHIBITED
,
USE_OPTIONAL
,
USE_REQUIRED
public void setDefaultValue(java.lang.String value)
public void setFixedValue(java.lang.String value)
public short getStructureType()
getStructureType
in class Structure
public void validate() throws ValidationException
validate
in class Structure
ValidationException
- when this Attribute declaration
is invalidprotected void setSchema(Schema schema)
schema
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |