org.exolab.castor.xml.dtd

Class Attribute


public class Attribute
extends java.lang.Object

Implementation of DTD Attribute declaration specification.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:19 $
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

void
addValue(String value)
Adds the value to the set of possible values.
String
getDefaultValue()
Returns default value.
Element
getElement()
Returns Element owning this attribute.
String
getName()
Returns the name of the attribute.
Iterator
getValues()
Returns iterator of the set of possible values, if of NOTATION or Enumeration type, null otherwise.
boolean
isDEFAULT()
True if attribute's default value is specified, false otherwise.
boolean
isENTITIESType()
True if the attribute is of ENTITIES type, false otherwise.
boolean
isENTITYType()
True if the attribute is of ENTITY type, false otherwise.
boolean
isEnumerationType()
True if the attribute is of Enumeration type, false otherwise.
boolean
isFIXED()
True if the attribute has fixed value, false otherwise.
boolean
isIDREFSType()
True if the attribute is of IDREFS type, false otherwise.
boolean
isIDREFType()
True if the attribute is of IDREF type, false otherwise.
boolean
isIDType()
True if the attribute is of ID type, false otherwise.
boolean
isIMPLIED()
True if no default value for the attribute is provided ("IMPLIED" specification), false otherwise.
boolean
isNMTOKENSType()
True if the attribute is of NMTOKENS type, false otherwise.
boolean
isNMTOKENType()
True if the attribute is of NMTOKEN type, false otherwise.
boolean
isNOTATIONType()
True if the attribute is of NOTATION type, false otherwise.
boolean
isREQUIRED()
True if the attribute is required, false otherwise.
boolean
isStringType()
True if the attribute is of CDATA type, false otherwise.
void
setDEFAULT()
Sets occurance specification to DEFAULT.
void
setDefaultValue(String value)
Sets default value.
void
setENTITIESType()
Sets the type of the attribute to ENTITIES.
void
setENTITYType()
Sets the type of the attribute to ENTITY.
void
setEnumerationType()
Sets the type of the attribute to Enumeration.
void
setFIXED()
Sets occurance specification to FIXED.
void
setIDREFSType()
Sets the type of the attribute to IDREFS.
void
setIDREFType()
Sets the type of the attribute to IDREF.
void
setIDType()
Sets the type of the attribute to ID.
void
setIMPLIED()
Sets occurance specification to IMPLIED.
void
setNMTOKENSType()
Sets the type of the attribute to NMTOKENS.
void
setNMTOKENType()
Sets the type of the attribute to NMTOKEN.
void
setNOTATIONType()
Sets the type of the attribute to NOTATION.
void
setREQUIRED()
Sets occurance specification to REQUIRED.
void
setStringType()
Sets the type of the attribute to CDATA.

Constructor Details

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 Details

addValue

public void addValue(String value)
            throws DTDException
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 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.

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.

isEnumerationType

public boolean isEnumerationType()
True if the attribute is of Enumeration 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.

setDEFAULT

public void setDEFAULT()
Sets occurance specification to DEFAULT.

setDefaultValue

public void setDefaultValue(String value)
Sets default value.

setENTITIESType

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

setENTITYType

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

setEnumerationType

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

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-2003. All rights reserved http://www.intalio.com