AttributeListpublic final class AttributeList extends Object implements Serializable, DTDConstantsThis class defines the attributes of an SGML element
as described in a DTD using the ATTLIST construct.
An AttributeList can be obtained from the Element
class using the getAttributes() method.
It is actually an element in a linked list. Use the
getNext() method repeatedly to enumerate all the attributes
of an element. |
Fields Summary |
---|
public String | name | public int | type | public Vector | values | public int | modifier | public String | value | public AttributeList | next | static Hashtable | attributeTypesCreate a hashtable of attribute types. |
Constructors Summary |
---|
AttributeList()
| public AttributeList(String name)Create an attribute list element.
this.name = name;
| public AttributeList(String name, int type, int modifier, String value, Vector values, AttributeList next)Create an attribute list element.
this.name = name;
this.type = type;
this.modifier = modifier;
this.value = value;
this.values = values;
this.next = next;
|
Methods Summary |
---|
static void | defineAttributeType(java.lang.String nm, int val)
Integer num = new Integer(val);
attributeTypes.put(nm, num);
attributeTypes.put(num, nm);
| public int | getModifier()
return modifier;
| public java.lang.String | getName()
return name;
| public javax.swing.text.html.parser.AttributeList | getNext()
return next;
| public int | getType()
return type;
| public java.lang.String | getValue()
return value;
| public java.util.Enumeration | getValues()
return (values != null) ? values.elements() : null;
| public static int | name2type(java.lang.String nm)
defineAttributeType("CDATA", CDATA);
defineAttributeType("ENTITY", ENTITY);
defineAttributeType("ENTITIES", ENTITIES);
defineAttributeType("ID", ID);
defineAttributeType("IDREF", IDREF);
defineAttributeType("IDREFS", IDREFS);
defineAttributeType("NAME", NAME);
defineAttributeType("NAMES", NAMES);
defineAttributeType("NMTOKEN", NMTOKEN);
defineAttributeType("NMTOKENS", NMTOKENS);
defineAttributeType("NOTATION", NOTATION);
defineAttributeType("NUMBER", NUMBER);
defineAttributeType("NUMBERS", NUMBERS);
defineAttributeType("NUTOKEN", NUTOKEN);
defineAttributeType("NUTOKENS", NUTOKENS);
attributeTypes.put("fixed", new Integer(FIXED));
attributeTypes.put("required", new Integer(REQUIRED));
attributeTypes.put("current", new Integer(CURRENT));
attributeTypes.put("conref", new Integer(CONREF));
attributeTypes.put("implied", new Integer(IMPLIED));
Integer i = (Integer)attributeTypes.get(nm);
return (i == null) ? CDATA : i.intValue();
| public java.lang.String | toString()
return name;
| public static java.lang.String | type2name(int tp)
return (String)attributeTypes.get(new Integer(tp));
|
|