org.exolab.castor.xml.dtd

Class Attribute

public class Attribute extends Object

Implementation of DTD Attribute declaration specification.

Version: $Revision: 5951 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $

Author: Alexander Totok

Constructor Summary
Attribute(Element element, String name)
Constructor, setting name, owning element of the attribute and occurance specification to DEFAULT.
Method Summary
voidaddValue(String value)
Adds the value to the set of possible values.
StringgetDefaultValue()
Returns default value.
ElementgetElement()
Returns Element owning this attribute.
StringgetName()
Returns the name of the attribute.
IteratorgetValues()
Returns java.util.Iterator iterator of the set of possible values, if of NOTATION or Enumeration type, null otherwise.
booleanisDEFAULT()
True if attribute's default value is specified, false otherwise.
booleanisEnumerationType()
True if the attribute is of Enumeration type, false otherwise.
booleanisENTITIESType()
True if the attribute is of ENTITIES type, false otherwise.
booleanisENTITYType()
True if the attribute is of ENTITY type, false otherwise.
booleanisFIXED()
True if the attribute has fixed value, false otherwise.
booleanisIDREFSType()
True if the attribute is of IDREFS type, false otherwise.
booleanisIDREFType()
True if the attribute is of IDREF type, false otherwise.
booleanisIDType()
True if the attribute is of ID type, false otherwise.
booleanisIMPLIED()
True if no default value for the attribute is provided ("IMPLIED" specification), false otherwise.
booleanisNMTOKENSType()
True if the attribute is of NMTOKENS type, false otherwise.
booleanisNMTOKENType()
True if the attribute is of NMTOKEN type, false otherwise.
booleanisNOTATIONType()
True if the attribute is of NOTATION type, false otherwise.
booleanisREQUIRED()
True if the attribute is required, false otherwise.
booleanisStringType()
True if the attribute is of CDATA type, false otherwise.
voidsetDefaultValue(String value)
Sets default value.
voidsetDEFAULT()
Sets occurance specification to DEFAULT.
voidsetEnumerationType()
Sets the type of the attribute to Enumeration.
voidsetENTITIESType()
Sets the type of the attribute to ENTITIES.
voidsetENTITYType()
Sets the type of the attribute to ENTITY.
voidsetFIXED()
Sets occurance specification to FIXED.
voidsetIDREFSType()
Sets the type of the attribute to IDREFS.
voidsetIDREFType()
Sets the type of the attribute to IDREF.
voidsetIDType()
Sets the type of the attribute to ID.
voidsetIMPLIED()
Sets occurance specification to IMPLIED.
voidsetNMTOKENSType()
Sets the type of the attribute to NMTOKENS.
voidsetNMTOKENType()
Sets the type of the attribute to NMTOKEN.
voidsetNOTATIONType()
Sets the type of the attribute to NOTATION.
voidsetREQUIRED()
Sets occurance specification to REQUIRED.
voidsetStringType()
Sets the type of the attribute to CDATA.

Constructor Detail

Attribute

public Attribute(Element element, String name)
Constructor, setting name, owning element of the attribute and occurance specification to DEFAULT.

Parameters: element must not be null. name must not be null or equal to empty String.

Method Detail

addValue

public void addValue(String value)
Adds the value to the set of possible values.

Throws: DTDException if the value is already contained in the set of possible values.

getDefaultValue

public String getDefaultValue()
Returns default value.

getElement

public Element getElement()
Returns Element owning this attribute.

getName

public String getName()
Returns the name of the attribute.

getValues

public Iterator getValues()
Returns java.util.Iterator iterator of the set of possible values, if of NOTATION or Enumeration type, null otherwise.

isDEFAULT

public boolean isDEFAULT()
True if attribute's default value is specified, false otherwise.

isEnumerationType

public boolean isEnumerationType()
True if the attribute is of Enumeration type, false otherwise.

isENTITIESType

public boolean isENTITIESType()
True if the attribute is of ENTITIES type, false otherwise.

isENTITYType

public boolean isENTITYType()
True if the attribute is of ENTITY type, false otherwise.

isFIXED

public boolean isFIXED()
True if the attribute has fixed value, false otherwise.

isIDREFSType

public boolean isIDREFSType()
True if the attribute is of IDREFS type, false otherwise.

isIDREFType

public boolean isIDREFType()
True if the attribute is of IDREF type, false otherwise.

isIDType

public boolean isIDType()
True if the attribute is of ID type, false otherwise.

isIMPLIED

public boolean isIMPLIED()
True if no default value for the attribute is provided ("IMPLIED" specification), false otherwise.

isNMTOKENSType

public boolean isNMTOKENSType()
True if the attribute is of NMTOKENS type, false otherwise.

isNMTOKENType

public boolean isNMTOKENType()
True if the attribute is of NMTOKEN type, false otherwise.

isNOTATIONType

public boolean isNOTATIONType()
True if the attribute is of NOTATION type, false otherwise.

isREQUIRED

public boolean isREQUIRED()
True if the attribute is required, false otherwise.

isStringType

public boolean isStringType()
True if the attribute is of CDATA type, false otherwise.

setDefaultValue

public void setDefaultValue(String value)
Sets default value.

setDEFAULT

public void setDEFAULT()
Sets occurance specification to DEFAULT.

setEnumerationType

public void setEnumerationType()
Sets the type of the attribute to Enumeration.

setENTITIESType

public void setENTITIESType()
Sets the type of the attribute to ENTITIES.

setENTITYType

public void setENTITYType()
Sets the type of the attribute to ENTITY.

setFIXED

public void setFIXED()
Sets occurance specification to FIXED.

setIDREFSType

public void setIDREFSType()
Sets the type of the attribute to IDREFS.

setIDREFType

public void setIDREFType()
Sets the type of the attribute to IDREF.

setIDType

public void setIDType()
Sets the type of the attribute to ID.

setIMPLIED

public void setIMPLIED()
Sets occurance specification to IMPLIED.

setNMTOKENSType

public void setNMTOKENSType()
Sets the type of the attribute to NMTOKENS.

setNMTOKENType

public void setNMTOKENType()
Sets the type of the attribute to NMTOKEN.

setNOTATIONType

public void setNOTATIONType()
Sets the type of the attribute to NOTATION.

setREQUIRED

public void setREQUIRED()
Sets occurance specification to REQUIRED.

setStringType

public void setStringType()
Sets the type of the attribute to CDATA.
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com