com.conradroche.matra.decl
Class Attribute

java.lang.Object
  |
  +--com.conradroche.matra.decl.Attribute

public class Attribute
extends java.lang.Object

Class to hold the Attribute definition details.

Author:
Conrad Roche

Field Summary
static java.lang.String CDATA
           
static java.lang.String NOTATION
           
static java.lang.String OPTIONALITY_STR_FIXED
           
static java.lang.String OPTIONALITY_STR_IMPLIED
           
static java.lang.String OPTIONALITY_STR_REQUIRED
           
static int TYPE_ENUMERATION
          Value of getAttType() if the Attribute defined is an Enumeration.
static int TYPE_NOTATION
          Value of getAttType() if the Attribute defined is of Notation Type.
 
Constructor Summary
Attribute()
          Attribute constructor.
Attribute(java.lang.String elementName, java.lang.String attrName, int attributeType, java.lang.String dataType, java.lang.String defaultDecl)
          Attribute constructor.
Attribute(java.lang.String elementName, java.lang.String attrName, java.lang.String[] enums, java.lang.String defaultDecl)
          Attribute Constructor for attributes of type Enumeration.
 
Method Summary
 java.lang.String getAttributeName()
          Get the name of the attribute.
 int getAttType()
          Return the type of the Attribute.
 java.lang.String getDataType()
          Get the data type of the Attribute.
 java.lang.String getDefaultValue()
          Get the Default declaration of the Attribute.
 java.lang.String[] getEnumeratedValues()
          If the Attribute is of Enumerated type, get the list of permitted values.
 java.lang.String getFixedValue()
          Add javadoc for Attribute::getFixedValue
 int getOptionality()
          Get the optionality of the attribute.
 java.lang.String getOptionalityString()
          Get the optionality of the attribute.
 boolean isEnumeration()
          Add javadoc for Attribute::isEnumeration
 boolean isIDType()
           
 boolean isNotationType()
          Check if the Attribute is of NOTATION type.
 boolean isStringType()
          Check if the Attribute is of STRING type (i.e.
 void readNextAttribute(DTDData AttDef)
          Read the attribute details from the given data.
 void setAttributeName(java.lang.String newName)
          Set the name of the attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NOTATION

public static final int TYPE_NOTATION
Value of getAttType() if the Attribute defined is of Notation Type.

TYPE_ENUMERATION

public static final int TYPE_ENUMERATION
Value of getAttType() if the Attribute defined is an Enumeration.

OPTIONALITY_STR_REQUIRED

public static final java.lang.String OPTIONALITY_STR_REQUIRED

OPTIONALITY_STR_IMPLIED

public static final java.lang.String OPTIONALITY_STR_IMPLIED

OPTIONALITY_STR_FIXED

public static final java.lang.String OPTIONALITY_STR_FIXED

NOTATION

public static final java.lang.String NOTATION

CDATA

public static final java.lang.String CDATA
Constructor Detail

Attribute

public Attribute()
Attribute constructor.

Attribute

public Attribute(java.lang.String elementName,
                 java.lang.String attrName,
                 java.lang.String[] enums,
                 java.lang.String defaultDecl)
Attribute Constructor for attributes of type Enumeration.
Parameters:
eleName - The Element name.
attrName - The name of the attribute.
enums - The enumeration for the attribute.
defaultValue - The default declaration for the attribute.

Attribute

public Attribute(java.lang.String elementName,
                 java.lang.String attrName,
                 int attributeType,
                 java.lang.String dataType,
                 java.lang.String defaultDecl)
Attribute constructor.
Parameters:
eleName - The Element name.
attrName - The name of the attribute.
attributeType - The type of the attribute.
dataType -  
defaultValue - The default declaration for the attribute.
Method Detail

getAttType

public int getAttType()
Return the type of the Attribute.
Returns:
The attribute type.

getDataType

public java.lang.String getDataType()
Get the data type of the Attribute.
Returns:
The attribute datatype.

getDefaultValue

public java.lang.String getDefaultValue()
Get the Default declaration of the Attribute.
Returns:
The attribute default declaration.

getFixedValue

public java.lang.String getFixedValue()
Add javadoc for Attribute::getFixedValue
Returns:
 

getEnumeratedValues

public java.lang.String[] getEnumeratedValues()
If the Attribute is of Enumerated type, get the list of permitted values.
Returns:
The list of permintted values.

getAttributeName

public java.lang.String getAttributeName()
Get the name of the attribute.
Returns:
The attribute name.

getOptionality

public int getOptionality()
Get the optionality of the attribute.
Returns:
The attribute optionality.

getOptionalityString

public java.lang.String getOptionalityString()
Get the optionality of the attribute.
Returns:
The attribute optionality.

isNotationType

public boolean isNotationType()
Check if the Attribute is of NOTATION type.
Parameters:
token - java.lang.String
Returns:
true if the attribute is a Notation type. false if the attribute is not.

isStringType

public boolean isStringType()
Check if the Attribute is of STRING type (i.e. CDATA).
Parameters:
token - java.lang.String
Returns:
boolean

isEnumeration

public boolean isEnumeration()
Add javadoc for Attribute::isEnumeration
Returns:
 

readNextAttribute

public void readNextAttribute(DTDData AttDef)
Read the attribute details from the given data.
Parameters:
AttDef - java.lang.String
Returns:
com.conradroche.matra.decl.Attribute

isIDType

public boolean isIDType()

setAttributeName

public void setAttributeName(java.lang.String newName)
Set the name of the attribute.
Parameters:
newName - java.lang.String