public class Element
extends java.lang.Object
implements java.io.Serializable
Element class represents the SGML element. Refers to
"ISO 8879 -- Standard Generalized Markup Language (SGML)".| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected Set |
attributes
The names of the attributes of the element.
|
static int |
CDATA
The content model is #CDATA.
|
protected Set |
contentModel
The names of the sub-elements in the element.
|
protected int |
contentModelType
The content model type of the element.
|
static int |
EMPTY
The content model is EMPTY.
|
protected Set |
exclusions
The names of the exclusions (elements) of the element.
|
protected Set |
inclusions
The names of the inclusions (elements) of the element.
|
static int |
MODEL
The content model consists of sub-elements.
|
static int |
MODEL_PCDATA
The content model consists of sub-elements and #PCDATA.
|
protected java.lang.String |
name
The name of the element.
|
static int |
PCDATA
The content model is #PCDATA.
|
static int |
RCDATA
The content model is #RCDATA.
|
| コンストラクタと説明 |
|---|
Element(java.lang.String name,
java.lang.String[] attrs,
int type)
Constructs an element with the specified name, attributes and type.
|
Element(java.lang.String name,
java.lang.String[] attrs,
int type,
java.lang.String[] incs,
java.lang.String[] excs)
Constructs an element with the specified name, attributes, type,
inclusions and exclusions.
|
Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model)
Constructs an element with the specified name, attributes and
sub-elements.
|
Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model,
int type)
Constructs an element with the specified name, attributes,
sub-elements and type.
|
Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model,
int type,
java.lang.String[] incs,
java.lang.String[] excs)
Constructs an element with the specified name, attributes,
sub-elements, type, inclusions and exclusions.
|
Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model,
java.lang.String[] incs,
java.lang.String[] excs)
Constructs an element with the specified name, attributes,
sub-elements, inclusions and exclusions.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
boolean |
canAccept(Element element)
Tests if this element can accept the specified element.
|
protected Set |
createSet(java.lang.String[] strs) |
Set |
getAttributes()
Returns the names of the attributes of this element.
|
Set |
getContentModel()
Returns the names of the sub-elements in this element, as a set.
|
int |
getContentModelType()
Returns the content model type of this element.
|
Set |
getExclusions()
Returns the names of the exclusions of this element, as a set.
|
Set |
getInclusions()
Returns the names of the inclusions of this element, as a set.
|
java.lang.String |
getName()
Returns the name of this element.
|
boolean |
hasAttributeNamed(java.lang.String name)
Tests if this element has an attribute by the specified name.
|
void |
setAttributes(java.lang.String[] attrs)
Sets the name of the attributes of this element to be the
specified attribute names.
|
void |
setContentModel(java.lang.String[] model)
Sets the sub-elements of this element to be the specified
sub-elements.
|
void |
setContentModel(java.lang.String[] model,
int type)
Sets the sub-elements and the content model type of this element
to be the specified sub-elements and the specified type.
|
void |
setContentModelType(int type)
Sets the content model type of this element to be the
specified type.
|
void |
setExclusions(java.lang.String[] excs)
Sets the inclusions of this element to be the specified exclusions.
|
void |
setInclusions(java.lang.String[] incs)
Sets the inclusions of this element to be the specified inclusions.
|
void |
setName(java.lang.String name)
Sets the name of this element to be the specified name.
|
protected java.lang.String name
protected int contentModelType
protected Set contentModel
MODEL,
MODEL_PCDATAprotected Set attributes
protected Set inclusions
protected Set exclusions
public static final int PCDATA
public static final int CDATA
public static final int RCDATA
public static final int EMPTY
public static final int MODEL
public static final int MODEL_PCDATA
public Element(java.lang.String name,
java.lang.String[] attrs,
int type)
PCDATA, CDATA,
RCDATA or EMPTY.name - the specified name.attrs - the specified attribute names.type - the specified type.public Element(java.lang.String name,
java.lang.String[] attrs,
int type,
java.lang.String[] incs,
java.lang.String[] excs)
PCDATA,
CDATA, RCDATA or EMPTY.name - the specified name.attrs - the specified attribute names.type - the specified type.incs - the specified names of the inclusions.excs - the specified names of the exclusions.public Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model)
name - the specified name.attrs - the specified attribute names.model - the specified names of the sub-elements.public Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model,
java.lang.String[] incs,
java.lang.String[] excs)
name - the specified name.attrs - the specified attribute names.model - the specified names of the sub-elements.incs - the specified names of the inclusions.excs - the specified names of the exclusions.public Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model,
int type)
MODEL or
MODEL_PCDATA.name - the specified name.attrs - the specified attribute names.model - the specified names of the sub-elements.type - the specified type.public Element(java.lang.String name,
java.lang.String[] attrs,
java.lang.String[] model,
int type,
java.lang.String[] incs,
java.lang.String[] excs)
MODEL or MODEL_PCDATA.name - the specified name.attrs - the specified attribute names.model - the specified names of the sub-elements.type - the specified type.incs - the specified names of the inclusions.excs - the specified names of the exclusions.public boolean canAccept(Element element)
element - an element.true if this element can accept the
specified element; false otherwise.public java.lang.String getName()
public void setName(java.lang.String name)
name - the specified name.public Set getAttributes()
public void setAttributes(java.lang.String[] attrs)
attrs - the specified attribute names.public boolean hasAttributeNamed(java.lang.String name)
name - the specified attribute name.true if this element has an attribute by
the specified name; false otherwise.public int getContentModelType()
public Set getContentModel()
public void setContentModelType(int type)
type - the specified type.java.lang.IllegalArgumentException - if the specified type is not
a valid.public void setContentModel(java.lang.String[] model)
model - the specified names of the sub-elements.java.lang.IllegalArgumentException - if the specified type is not
a valid.public void setContentModel(java.lang.String[] model,
int type)
model - the specified names of the sub-elements.type - the specified type.java.lang.IllegalArgumentException - if the specified type is not
a valid.public Set getInclusions()
public void setInclusions(java.lang.String[] incs)
incs - the specified names of the inclusions.public Set getExclusions()
public void setExclusions(java.lang.String[] excs)
excs - the specified names of the exclusions.protected Set createSet(java.lang.String[] strs)