public static final class Attribute.Type
extends 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.
Modifier and Type | Field and Description |
---|---|
static Attribute.Type | CDATA
The type of attributes declared to have type CDATA
in the DTD.
|
static Attribute.Type | ENTITIES
The type of attributes declared to have type ENTITIES
in the DTD.
|
static Attribute.Type | ENTITY
The type of attributes declared to have type ENTITY
in the DTD.
|
static Attribute.Type | ENUMERATION
The type of attributes declared by an enumeration
in the DTD.
|
static Attribute.Type | ID
The type of attributes declared to have type ID
in the DTD.
|
static Attribute.Type | IDREF
The type of attributes declared to have type IDREF
in the DTD.
|
static Attribute.Type | IDREFS
The type of attributes declared to have type IDREFS
in the DTD.
|
static Attribute.Type | NMTOKEN
The type of attributes declared to have type NMTOKEN
in the DTD.
|
static Attribute.Type | NMTOKENS
The type of attributes declared to have type NMTOKENS
in the DTD.
|
static Attribute.Type | NOTATION
The type of attributes declared to have type NOTATION
in the DTD.
|
static Attribute.Type | UNDECLARED
The type of attributes not declared in the DTD.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
public String getName()
Returns the string name of this type as might be used in a DTD; for example, "ID", "CDATA", etc.
public int hashCode()
Returns a unique identifier for this type.
hashCode
in class Object
Object.hashCode()
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.
equals
in class Object
o
- the object compared for equality to this typeo
represents
the same typeObject.equals(Object)
public String toString()
Returns a string representation of the type suitable for debugging and diagnosis.
toString
in class Object
Object.toString()
Copyright 2002-2023 Elliotte Rusty Harold
elharo@ibiblio.org