|
XML for Java Compatibility API 2.0.11 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.parser.Child | +--com.ibm.xml.parser.Attlist
The Attlist class provides services in support of DTD attribute list declarations.
We will use the following example to illustrate the capabilities of attribute lists within a PERSON Element:
<!ATTLIST PERSON EMPLOYEETYPE CDATA "PERMANENT" LASTNAME CDATA #REQUIRED PHONE ENTITY #IMPLIED COMPANY CDATA #FIXED "IBM" >
In this example, the attributes EMPLOYEETYPE
and COMPANY
have
been assigned default values; EMPLOYEETYPE
's default value may be changed, but
COMPANY
's value is fixed and may not be changed.
The LASTNAME
attribute must be specified with each PERSON
Element
because this attribute is defined as REQUIRED
.
Just because an attribute is not defined by the attribute list definition, it does not
mean that the attribute can not be defined in the document. These attributes are known
as IMPLIED
attributes. However, you will need to explicitly define IMPLIED
attributes if you want them to have a value type other than CDATA
.
Value types are defined as follows:
IDREF
except multiple pointers may be provided.
ENTITY
except multiple pointers may be provided.
NMTOKEN
except multiple names may be provided.
NMTOKEN
tokens.
AttDef
,
Child
,
EntityDecl
,
ExternalID
,
TXNotation
, Serialized FormFields inherited from class com.ibm.xml.parser.Child |
ATTDEF,
ATTLIST,
ELEMENT_DECL,
NAME_ATTDEF,
NAME_ATTLIST,
NAME_CDATA,
NAME_COMMENT,
NAME_DOCFRAGMENT,
NAME_DOCUMENT,
NAME_ELEMENT_DECL,
NAME_PSEUDONODE,
NAME_TEXT,
PSEUDONODE |
Constructor Summary | |
Attlist(java.lang.String name)
Constructor. |
Method Summary | |
void |
acceptPost(Visitor visitor)
Implements the accept operation of the visitor design pattern when the end of an Attlist Node is recognized when traversing the document object tree. |
void |
acceptPre(Visitor visitor)
Implements the accept operation of the visitor design pattern when the start of an Attlist Node is recognized when traversing the document object tree. |
boolean |
addElement(AttDef attDef)
Adds the specified attribute definition to the end of this attribute list . |
java.lang.Object |
clone()
Clone this attribute list Node and its children (AttDefs) using the appropriate factory. |
boolean |
contains(java.lang.String attDefName)
Returns whether the specified attribute definition name is currently defined in this attribute list. |
AttDef |
elementAt(int index)
Returns the attribute definition at the specified index in this attribute list |
java.util.Enumeration |
elements()
Returns an enumeration of all attribute definitions in this attribute list. |
boolean |
equals(org.w3c.dom.Node arg,
boolean deep)
|
AttDef |
getAttDef(java.lang.String attDefName)
Returns the attribute definition that matches the specified attribute definition name in this attribute list. |
java.lang.String |
getName()
Returns this attribute list's name; this value is also known as the Element type. |
java.lang.String |
getNodeName()
|
short |
getNodeType()
Returns that this object is an attribute list Node. |
int |
size()
Returns the number of attribute definitions in this attribute list. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Attlist(java.lang.String name)
name
- This attribute list's name; this value is also known as the Element type.Method Detail |
public java.lang.Object clone()
public boolean equals(org.w3c.dom.Node arg, boolean deep)
deep
- ignored.public short getNodeType()
This method is defined by DOM.
public java.lang.String getNodeName()
public java.lang.String getName()
public boolean addElement(AttDef attDef)
attDef
- Attribute definition to add to this atribute list.elementAt(int)
,
getAttDef(java.lang.String)
,
contains(java.lang.String)
,
size()
public AttDef elementAt(int index)
index
- Index into this list of attribute definitions.addElement(com.ibm.xml.parser.AttDef)
,
getAttDef(java.lang.String)
,
contains(java.lang.String)
,
size()
public AttDef getAttDef(java.lang.String attDefName)
attDefName
- Attribute definition name to match in this attribute list.addElement(com.ibm.xml.parser.AttDef)
,
elementAt(int)
,
contains(java.lang.String)
,
size()
,
elements()
public boolean contains(java.lang.String attDefName)
attDefName
- Attribute definition name to match in this attribute list.addElement(com.ibm.xml.parser.AttDef)
,
elementAt(int)
,
getAttDef(java.lang.String)
,
size()
,
elements()
public int size()
addElement(com.ibm.xml.parser.AttDef)
,
elementAt(int)
,
getAttDef(java.lang.String)
,
contains(java.lang.String)
public java.util.Enumeration elements()
addElement(com.ibm.xml.parser.AttDef)
,
elementAt(int)
,
getAttDef(java.lang.String)
,
contains(java.lang.String)
,
size()
public void acceptPre(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
public void acceptPost(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
|
XML for Java Compatibility API 2.0.11 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |