Package org.exolab.castor.xml.dtd
Class Attribute
- java.lang.Object
-
- org.exolab.castor.xml.dtd.Attribute
-
public class Attribute extends java.lang.ObjectImplementation of DTD Attribute declaration specification.- Version:
- $Revision: 5951 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Alexander Totok
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(java.lang.String value)Adds the value to the set of possible values.java.lang.StringgetDefaultValue()Returns default value.ElementgetElement()Returns Element owning this attribute.java.lang.StringgetName()Returns the name of the attribute.java.util.IteratorgetValues()Returnsiteratorof the set of possible values, if of NOTATION or Enumeration type, null otherwise.booleanisDEFAULT()True if attribute's default value is specified, false otherwise.booleanisENTITIESType()True if the attribute is of ENTITIES type, false otherwise.booleanisENTITYType()True if the attribute is of ENTITY type, false otherwise.booleanisEnumerationType()True if the attribute is of Enumeration 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.voidsetDEFAULT()Sets occurance specification to DEFAULT.voidsetDefaultValue(java.lang.String value)Sets default value.voidsetENTITIESType()Sets the type of the attribute to ENTITIES.voidsetENTITYType()Sets the type of the attribute to ENTITY.voidsetEnumerationType()Sets the type of the attribute to Enumeration.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, java.lang.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
-
getName
public java.lang.String getName()
Returns the name of the attribute.
-
getElement
public Element getElement()
Returns Element owning this attribute.
-
getValues
public java.util.Iterator getValues()
Returnsiteratorof the set of possible values, if of NOTATION or Enumeration type, null otherwise.
-
setStringType
public void setStringType()
Sets the type of the attribute to CDATA.
-
isStringType
public boolean isStringType()
True if the attribute is of CDATA type, false otherwise.
-
setIDType
public void setIDType()
Sets the type of the attribute to ID.
-
isIDType
public boolean isIDType()
True if the attribute is of ID type, false otherwise.
-
setIDREFType
public void setIDREFType()
Sets the type of the attribute to IDREF.
-
isIDREFType
public boolean isIDREFType()
True if the attribute is of IDREF type, false otherwise.
-
setIDREFSType
public void setIDREFSType()
Sets the type of the attribute to IDREFS.
-
isIDREFSType
public boolean isIDREFSType()
True if the attribute is of IDREFS type, false otherwise.
-
setENTITYType
public void setENTITYType()
Sets the type of the attribute to ENTITY.
-
isENTITYType
public boolean isENTITYType()
True if the attribute is of ENTITY type, false otherwise.
-
setENTITIESType
public void setENTITIESType()
Sets the type of the attribute to ENTITIES.
-
isENTITIESType
public boolean isENTITIESType()
True if the attribute is of ENTITIES type, false otherwise.
-
setNMTOKENType
public void setNMTOKENType()
Sets the type of the attribute to NMTOKEN.
-
isNMTOKENType
public boolean isNMTOKENType()
True if the attribute is of NMTOKEN type, false otherwise.
-
setNMTOKENSType
public void setNMTOKENSType()
Sets the type of the attribute to NMTOKENS.
-
isNMTOKENSType
public boolean isNMTOKENSType()
True if the attribute is of NMTOKENS type, false otherwise.
-
setNOTATIONType
public void setNOTATIONType()
Sets the type of the attribute to NOTATION.
-
isNOTATIONType
public boolean isNOTATIONType()
True if the attribute is of NOTATION type, false otherwise.
-
setEnumerationType
public void setEnumerationType()
Sets the type of the attribute to Enumeration.
-
isEnumerationType
public boolean isEnumerationType()
True if the attribute is of Enumeration type, false otherwise.
-
setDEFAULT
public void setDEFAULT()
Sets occurance specification to DEFAULT.
-
isDEFAULT
public boolean isDEFAULT()
True if attribute's default value is specified, false otherwise.
-
setREQUIRED
public void setREQUIRED()
Sets occurance specification to REQUIRED.
-
isREQUIRED
public boolean isREQUIRED()
True if the attribute is required, false otherwise.
-
setIMPLIED
public void setIMPLIED()
Sets occurance specification to IMPLIED.
-
isIMPLIED
public boolean isIMPLIED()
True if no default value for the attribute is provided ("IMPLIED" specification), false otherwise.
-
setFIXED
public void setFIXED()
Sets occurance specification to FIXED.
-
isFIXED
public boolean isFIXED()
True if the attribute has fixed value, false otherwise.
-
setDefaultValue
public void setDefaultValue(java.lang.String value)
Sets default value.
-
getDefaultValue
public java.lang.String getDefaultValue()
Returns default value.
-
addValue
public void addValue(java.lang.String value) throws DTDExceptionAdds the value to the set of possible values.- Throws:
DTDException- if the value is already contained in the set of possible values.
-
-