java.io.Serializable
public final class AttributeDecl extends Annotated
Modifier and Type | Field | Description |
---|---|---|
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
|
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 | Description |
---|---|
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
|
Modifier and Type | Method | Description |
---|---|---|
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 |
hasXMLType() |
Indicates whether a type is set for this element definiion.
|
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(java.lang.String reference) |
Sets the reference for this attribute definition
|
void |
setReference(AttributeDecl 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
|
addAnnotation, getAnnotations, removeAnnotation
public static final java.lang.String USE_OPTIONAL
public static final java.lang.String USE_PROHIBITED
public static final java.lang.String USE_REQUIRED
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 attrDeclpublic Form getForm()
public java.lang.String getId()
public java.lang.String getName()
public java.lang.String getName(boolean ignoreRef)
ignoreRef
- 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
- public boolean hasXMLType()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com