Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java
PREV | NEXT | SHOW LISTS | HIDE LISTS |

# Class com.ibm.xml.parser.AttDef

    java.lang.Object
        |
        +----com.ibm.xml.parser.Child
                |
                +----com.ibm.xml.parser.AttDef

Subclasses:
  TreeFactory.TreeAttDef

public class AttDef
extends Child
implements AttributeDefinition

The `AttDef` class implements the `AttributeDefinition` interface as defined by the Document Object Model (DOM).

This class provides support for a single attribute object that is declared as part of an Element's attribute list declaration in the DTD. Refer to Attlist for a detailed description.

Version:
  1.1
See Also:
  AttributeDefinition, Attlist, Child

Field Summary
static int | NOFIXED
static java.lang.String[] | S_TYPESTR
static int | UNKNOWN

Fields inherited from class com.ibm.xml.parser.Child
ATTDEF, ATTLIST, DOCUMENTTYPE, ELEMENTDEFINITION, ENTITY, GENERALREFERENCE, NOTATION, PSEUDONODE

Constructor Summary
AttDef(java.lang.String name) Constructor.

Method Summary
boolean | addElement(java.lang.String token) Adds the specified token to the end of the list of tokens that can be used as values for this enumerated attribute type; the specified token has no meaning for other attribute types.
java.lang.Object | clone() Clone this attribute definition using the appropriate factory.
boolean | contains(java.lang.String token) Returns whether the specified token is in the list of tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types.
java.lang.String | elementAt(int index) Returns the token at the specified index in the list of tokens that can be used as values for this enumerated attribute type; the returned token has no meaning for other attribute types.
java.util.Enumeration | elements() Returns a list of all tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types.
java.lang.String | getAllowedTokens() Returns a list of all tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types.
int | getDeclaredType() Returns the declared type of this attribute in the DTD definition.
java.lang.String | getDefaultStringValue() Returns the default value of this attribute in the DTD definition.
int | getDefaultType() Returns the default type of this attribute's value in the DTD definition.
Node | getDefaultValue() Returns a Node whose children make up the default value of this attribute in the DTD definition.
java.lang.String | getName() Returns the name of this attribute in the DTD definition.
int | getNodeType() Returns that this object is an attribute definition Node.
void | setAllowedTokens(java.lang.String tokens) Sets a list of all tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types.
void | setDeclaredType(int declaredValueType) Sets the declared type of this attribute in the DTD definition.
void | setDefaultStringValue(java.lang.String value) Sets the default value of this attribute in the DTD definition.
void | setDefaultType(int defaultValueType) Sets the default type of this attribute's value in the DTD definition.
void | setDefaultValue(Node node) Sets a Node whose children make up the default value of this attribute in the DTD definition.
void | setName(java.lang.String name) Sets the name of this attribute in the DTD definition.
int | size() Returns the number of tokens in the list of tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types.

Methods inherited from class com.ibm.xml.parser.Child
clearDigest, clone, getChildNodes, getDigest, getFactory, getFirstChild, getNextSibling, getParentNode, getPreviousSibling, getText, hasChildNodes, insertBefore, makeXPointer, print, print, removeChild, replaceChild, searchAncestors, searchAncestors, setFactory, toString, toString

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

### NOFIXED

    public static final int NOFIXED

### UNKNOWN

    public static final int UNKNOWN

### S_TYPESTR

    public static final java.lang.String[] S_TYPESTR

Constructor Detail

### AttDef

    public AttDef(java.lang.String name)

  Constructor.
  Parameters:
    `name` - Name of this attribute as defined by the DTD.

Method Detail

### clone

    public java.lang.Object clone()

  Clone this attribute definition using the appropriate factory.

  This method is defined by Child.

  Returns:
    Cloned attribute definition.
  Overrides:
    clone in class Child
  See Also:
    clone

### getNodeType

    public int getNodeType()

  Returns that this object is an attribute definition Node.

  This method is defined by DOM.

  Returns:
    Attribute definition Node indicator.

### getName

    public java.lang.String getName()

  Returns the name of this attribute in the DTD definition.

  This method is defined by DOM.

  Implements:
    getName in interface AttributeDefinition
  Returns:
    Name of this attribute in the DTD definition.
  See Also:
    setName

### setName

    public void setName(java.lang.String name)

  Sets the name of this attribute in the DTD definition.

  This method is defined by DOM.

  Implements:
    setName in interface AttributeDefinition
  Parameters:
    `name` - Name of this attribute in the DTD definition.
  See Also:
    getName

### getDeclaredType

    public int getDeclaredType()

  Returns the declared type of this attribute in the DTD definition.

  This method is defined by DOM.

  Implements:
    getDeclaredType in interface AttributeDefinition
  Returns:
    Declared type of this attribute in the DTD definition. Must be one of org.w3c.dom.AttributeDefinition#DeclaredValueType
  See Also:
    AttributeDefinition, setDeclaredType

### setDeclaredType

    public void setDeclaredType(int declaredValueType)

  Sets the declared type of this attribute in the DTD definition.

  This method is defined by DOM.

  Implements:
    setDeclaredType in interface AttributeDefinition
  Parameters:
    `declaredValueType` - Declared type of this attribute in the DTD definition. Must be one of org.w3c.dom.AttributeDefinition#DeclaredValueType
  See Also:
    AttributeDefinition, getDeclaredType

### getDefaultValue

    public Node getDefaultValue()

  Returns a Node whose children make up the default value of this attribute in the DTD definition. This is useful if this attribute was not given an explicit value in the document instance.

  This method is defined by DOM.

  This method is CURRENTLY NOT IMPLEMENTED.

  Implements:
    getDefaultValue in interface AttributeDefinition
  Returns:
    The Child Node whose children make up the default value of this attribute.
  See Also:
    setDefaultValue, getDefaultStringValue

### setDefaultValue

    public void setDefaultValue(Node node)

  Sets a Node whose children make up the default value of this attribute in the DTD definition. This is useful if this attribute was not given an explicit value in the document instance.

  This method is defined by DOM.

  This method is CURRENTLY NOT IMPLEMENTED.

  Implements:
    setDefaultValue in interface AttributeDefinition
  Parameters:
    `name` - The Child Node whose children make up the default value of this attribute.
  See Also:
    getDefaultValue, setDefaultStringValue

### getDefaultStringValue

    public java.lang.String getDefaultStringValue()

  Returns the default value of this attribute in the DTD definition. This is useful if this attribute was not given an explicit value in the document instance. The returned value is only meaningful for attribute types defined as FIXED or NOFIXED.
  Returns:
    The default value of the attribute, or null if none specified.
  See Also:
    getDefaultValue, setDefaultStringValue

### setDefaultStringValue

    public void setDefaultStringValue(java.lang.String value)

  Sets the default value of this attribute in the DTD definition. This is useful if this attribute was not given an explicit value in the document instance. The specified value is only meaningful for attribute types defined as FIXED or NOFIXED.
  Parameters:
    `value` - The default value of the attribute in the DTD definition.
  See Also:
    setDefaultValue, getDefaultStringValue

### getAllowedTokens

    public java.lang.String getAllowedTokens()

  Returns a list of all tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.

  This method is defined by DOM.

  This method is CURRENTLY NOT IMPLEMENTED.

  Implements:
    getAllowedTokens in interface AttributeDefinition
  Returns:
    The list of allowed tokens for the attribute value as defined by the DTD definition, or null if none specified.
  See Also:
    elements, elementAt, size, contains, setAllowedTokens

### setAllowedTokens

    public void setAllowedTokens(java.lang.String tokens)

  Sets a list of all tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.

  This method is defined by DOM.

  This method is CURRENTLY NOT IMPLEMENTED.

  Implements:
    setAllowedTokens in interface AttributeDefinition
  Parameters:
    `tokens` - The list of allowed tokens for the attribute value as defined by the DTD definition.
  See Also:
    addElement, getAllowedTokens

### addElement

    public boolean addElement(java.lang.String token)

  Adds the specified token to the end of the list of tokens that can be used as values for this enumerated attribute type; the specified token has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.
  Parameters:
    `token` - Value to add to the list of valid tokens for this enumerated attribute.
  Returns:
    =true if the token does not already exist in this token list; otherwise, =false.
  See Also:
    elementAt, contains, size, elements

### elementAt

    public java.lang.String elementAt(int index)

  Returns the token at the specified index in the list of tokens that can be used as values for this enumerated attribute type; the returned token has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.
  Parameters:
    `index` - Index into the list of tokens that can be used as values for this enumerated attribute type.
  Returns:
    Token at the specified index, or null if an invalid index.
  See Also:
    addElement, contains, size, elements

### contains

    public boolean contains(java.lang.String token)

  Returns whether the specified token is in the list of tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.
  Parameters:
    `token` - Value to check in the list of valid tokens for this enumerated attribute.
  Returns:
    =true if token is defined; otherwise, =false.
  See Also:
    addElement, elementAt, size, elements

### size

    public int size()

  Returns the number of tokens in the list of tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.
  Returns:
    Number of tokens, or null if no tokens defined.
  See Also:
    addElement, elementAt, contains, elements

### elements

    public java.util.Enumeration elements()

  Returns a list of all tokens that can be used as values for this enumerated attribute type; the returned value has no meaning for other attribute types. Enumerated attribute types are: NOTATION and NAME_TOKEN_GROUP.
  Returns:
    The list of allowed tokens for the attribute value as defined by the DTD definition, or null if none specified.
  See Also:
    addElement, elementAt, size, contains

### getDefaultType

    public int getDefaultType()

  Returns the default type of this attribute's value in the DTD definition.

  This method is defined by DOM.

  Implements:
    getDefaultType in interface AttributeDefinition
  Returns:
    The default type of this attribute in the DTD definition. Must be one of org.w3c.dom.AttributeDefinition#DefaultValueType
  See Also:
    AttributeDefinition, setDefaultType

### setDefaultType

    public void setDefaultType(int defaultValueType)

  Sets the default type of this attribute's value in the DTD definition.

  This method is defined by DOM.

  Implements:
    setDefaultType in interface AttributeDefinition
  Parameters:
    `defaultValueType` - The default type of this attribute in the DTD definition. Must be one of org.w3c.dom.AttributeDefinition#DefaultValueType
  See Also:
    AttributeDefinition, getDefaultType

Contents | Package | Class | Tree | Deprecated | Index | Help |
PREV | NEXT | SHOW LISTS | HIDE LISTS |