Top Description Fields Constructors Methods
javax.swing.text.html.parser

public final Class Element

extends Object
implements DTDConstants, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.text.html.parser.DTDConstants
Annotations
@SuppressWarnings:serial
Imports
java.util.Hashtable, .BitSet, java.io.*, sun.awt.AppContext

An element as described in a DTD using the ELEMENT construct. This is essential the description of a tag. It describes the type, content model, attributes, attribute types etc. It is used to correctly parse a document by the Parser.
Author
Arthur van Hoff
See Also
DTD, AttributeList

Field Summary

Modifier and TypeField and Description
public AttributeList
atts

The attributes

public ContentModel
content

The content model

pack-priv static Hashtable<String, Integer>
public Object
data

A field to store user data.

public BitSet
exclusions

The set of elements that must not occur inside the element

public BitSet
inclusions

The set of elements that can occur inside the element

public int
index

The element index

private static final Object
public String
name

The name of the element

public boolean
oEnd

true if the end tag can be omitted

public boolean
oStart

true if the start tag can be omitted

public int
type

The element type

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
Element(String
the name of the element
name
,
int
the index
index
)

Create a new element.

Method Summary

Modifier and TypeMethod and Description
public AttributeList

Returns:

the AttributeList for the given name
getAttribute
(String
the attribute name
name
)

Get an attribute by name.

public AttributeList

Returns:

the AttributeList for the given value
getAttributeByValue
(String
the string representation of value
value
)

Get an attribute by value.

public AttributeList

Returns:

the AttributeList specifying the element
getAttributes
()

Get the attributes.

public ContentModel

Returns:

the content model
getContent
()

Get content model

public int

Returns:

the element index
getIndex
()

Get index.

pack-priv static int
public String

Returns:

the name of the element
getName
()

Get the name of the element.

public int

Returns:

the type of the element
getType
()

Get type.

public boolean

Returns:

true if the current element is empty
isEmpty
()

Check if empty

public static int

Returns:

appropriate DTDConstants if the nm is equal to CDATA, RCDATA, EMPTY or ANY, 0 otherwise.
name2type
(String
a name
nm
)

Converts nm to type.

public boolean

Returns:

true if the end tag can be omitted
omitEnd
()

Return true if the end tag can be omitted.

public boolean

Returns:

true if the start tag can be omitted
omitStart
()

Return true if the start tag can be omitted.

public String

Returns:

a string representation for the given Element instance
toString
()

Overrides java.lang.Object.toString.

Convert to a string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attsback to summary
public AttributeList atts

The attributes

contentback to summary
public ContentModel content

The content model

contentTypesback to summary
pack-priv static Hashtable<String, Integer> contentTypes
databack to summary
public Object data

A field to store user data. Mostly used to store style sheets.

exclusionsback to summary
public BitSet exclusions

The set of elements that must not occur inside the element

inclusionsback to summary
public BitSet inclusions

The set of elements that can occur inside the element

indexback to summary
public int index

The element index

MAX_INDEX_KEYback to summary
private static final Object MAX_INDEX_KEY
nameback to summary
public String name

The name of the element

oEndback to summary
public boolean oEnd

true if the end tag can be omitted

oStartback to summary
public boolean oStart

true if the start tag can be omitted

typeback to summary
public int type

The element type

Constructor Detail

Elementback to summary
pack-priv Element()
Elementback to summary
pack-priv Element(String name, int index)

Create a new element.

Parameters
name:String

the name of the element

index:int

the index

Method Detail

getAttributeback to summary
public AttributeList getAttribute(String name)

Get an attribute by name.

Parameters
name:String

the attribute name

Returns:AttributeList

the AttributeList for the given name

getAttributeByValueback to summary
public AttributeList getAttributeByValue(String value)

Get an attribute by value.

Parameters
value:String

the string representation of value

Returns:AttributeList

the AttributeList for the given value

getAttributesback to summary
public AttributeList getAttributes()

Get the attributes.

Returns:AttributeList

the AttributeList specifying the element

getContentback to summary
public ContentModel getContent()

Get content model

Returns:ContentModel

the content model

getIndexback to summary
public int getIndex()

Get index.

Returns:int

the element index

getMaxIndexback to summary
pack-priv static int getMaxIndex()
getNameback to summary
public String getName()

Get the name of the element.

Returns:String

the name of the element

getTypeback to summary
public int getType()

Get type.

Returns:int

the type of the element

isEmptyback to summary
public boolean isEmpty()

Check if empty

Returns:boolean

true if the current element is empty

name2typeback to summary
public static int name2type(String nm)

Converts nm to type. Returns appropriate DTDConstants if the nm is equal to CDATA, RCDATA, EMPTY or ANY, 0 otherwise.

Parameters
nm:String

a name

Returns:int

appropriate DTDConstants if the nm is equal to CDATA, RCDATA, EMPTY or ANY, 0 otherwise.

omitEndback to summary
public boolean omitEnd()

Return true if the end tag can be omitted.

Returns:boolean

true if the end tag can be omitted

omitStartback to summary
public boolean omitStart()

Return true if the start tag can be omitted.

Returns:boolean

true if the start tag can be omitted

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Convert to a string.

Returns:String

a string representation for the given Element instance