|
|||||||||
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
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, 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 | |
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. |
AttributeDecl |
getReference()
Returns the AttributeDecl that this attribute definition references. |
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. |
java.lang.String |
getValue()
Returns the default (or fixed) value of this Attribute declaration |
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 |
setDefault()
Sets the DEFAULT flag to true |
void |
setFixed()
Sets the FIXED flag to true. |
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 |
void |
setReference(AttributeDecl reference)
Sets the reference for 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 |
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 |
setValue(java.lang.String value)
Sets the default value (or fixed depending on the 'use' option) for this attribute declaration |
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)
public SimpleType getSimpleType()
public AttributeDecl getReference()
public Schema getSchema()
public java.lang.String getUse()
public java.lang.String getValue()
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
java.lang.IllegalArgumentException
- when the name is not validpublic 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 setDefault()
public void setFixed()
public void setValue(java.lang.String value)
value
- the default valuepublic short getStructureType()
getStructureType
in class Structure
public void validate() throws ValidationException
validate
in class Structure
ValidationException
- when this Attribute declaration
is invalid
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |