nu.xom
Class Attribute.Type
- Attribute
public static final class Attribute.Type
extends java.lang.Object
Uses the type-safe enumeration
design pattern to represent attribute types,
as specified by XML DTDs.
XOM enforces well-formedness, but it does not enforce
validity. Thus it is possible for a single element to have
multiple ID type attributes, or ID type attributes
on different elements to have the same value,
or NMTOKEN type attributes that don't contain legal
XML name tokens, and so forth.
boolean | equals(Object o) -
Tests for type equality.
|
String | getName() -
Returns the string name of this type as might
be used in a DTD; for example, "ID", "CDATA", etc.
|
int | hashCode() -
Returns a unique identifier for this type.
|
String | toString() -
Returns a string representation of the type
suitable for debugging and diagnosis.
|
CDATA
public static final Attribute.Type CDATA
The type of attributes declared to have type CDATA
in the DTD. The most general attribute type.
All well-formed attribute values are valid for
attributes of type CDATA.
ENTITIES
public static final Attribute.Type ENTITIES
The type of attributes declared to have type ENTITIES
in the DTD. In order to be valid, an ENTITIES type
attribute must contain a white space separated list of
names of unparsed entities declared in the DTD.
However, XOM does not enforce such validity constraints.
ENTITY
public static final Attribute.Type ENTITY
The type of attributes declared to have type ENTITY
in the DTD. In order to be valid, a ENTITY type attribute
must contain the name of an unparsed entity declared in
the DTD. However, XOM does not enforce such
validity constraints.
ENUMERATION
public static final Attribute.Type ENUMERATION
The type of attributes declared by an enumeration
in the DTD. In order to be valid, a enumeration type
attribute must contain exactly one of the names given
in the enumeration in the DTD. However, XOM does not
enforce such validity constraints.
Most parsers report attributes of type enumeration as
having type NMTOKEN. In this case, XOM will not
distinguish NMTOKEN and enumerated attributes.
ID
public static final Attribute.Type ID
The type of attributes declared to have type ID
in the DTD. In order to be valid, an ID type attribute
must contain an XML name which is unique among other
ID type attributes in the document.
Furthermore, each element may contain no more than one
ID type attribute. However, XOM does not enforce
such validity constraints.
IDREF
public static final Attribute.Type IDREF
The type of attributes declared to have type IDREF
in the DTD. In order to be valid, an IDREF type attribute
must contain an XML name which is also the value of
ID type attribute of some element in the document.
However, XOM does not enforce such validity constraints.
IDREFS
public static final Attribute.Type IDREFS
The type of attributes declared to have type IDREFS
in the DTD. In order to be valid, an IDREFS type attribute
must contain a white space separated list of
XML names, each of which is also the value of
ID type attribute of some element in the document.
However, XOM does not enforce such validity constraints.
NMTOKEN
public static final Attribute.Type NMTOKEN
The type of attributes declared to have type NMTOKEN
in the DTD. In order to be valid, a NMTOKEN type
attribute must contain a single XML name token. However,
XOM does not enforce such validity constraints.
NMTOKENS
public static final Attribute.Type NMTOKENS
The type of attributes declared to have type NMTOKENS
in the DTD. In order to be valid, a NMTOKENS type attribute
must contain a white space separated list of XML name
tokens. However, XOM does not enforce such validity
constraints.
NOTATION
public static final Attribute.Type NOTATION
The type of attributes declared to have type NOTATION
in the DTD. In order to be valid, a NOTATION type
attribute must contain the name of a notation declared
in the DTD. However, XOM does not enforce such
validity constraints.
UNDECLARED
public static final Attribute.Type UNDECLARED
The type of attributes not declared in the DTD.
This type only appears in invalid documents.
This is the default type for all attributes in
documents without DTDs.
Most parsers report attributes of undeclared
type as having type CDATA. In this case, XOM
will not distinguish CDATA and undeclared attributes.
equals
public boolean equals(Object o)
Tests for type equality. This is only necessary,
to handle the case where two Type
objects
are loaded by different class loaders.
o
- the object compared for equality to this type
- true if and only if
o
represents
the same type
java.lang.Object.equals(Object)
getName
public String getName()
Returns the string name of this type as might
be used in a DTD; for example, "ID", "CDATA", etc.
- an XML string representation of this type
hashCode
public int hashCode()
Returns a unique identifier for this type.
- a unique identifier for this type
java.lang.Object.hashCode()
toString
public String toString()
Returns a string representation of the type
suitable for debugging and diagnosis.
- a non-XML string representation of this type
java.lang.Object.toString()
Copyright 2002-2005 Elliotte Rusty Harold
elharo@metalab.unc.edu