All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.sgml.Element
java.lang.Object
|
+----jp.kyasu.sgml.Element
- public class Element
- extends Object
- implements Serializable
The Element
class represents the SGML element. Refers to
"ISO 8879 -- Standard Generalized Markup Language (SGML)".
- Version:
- 23 Sep 1997
- Author:
- Kazuki YASUMATSU
-
CDATA
- The content model is #CDATA.
-
EMPTY
- The content model is EMPTY.
-
MODEL
- The content model consists of sub-elements.
-
MODEL_PCDATA
- The content model consists of sub-elements and #PCDATA.
-
PCDATA
- The content model is #PCDATA.
-
RCDATA
- The content model is #RCDATA.
-
Element(String, String[], int)
- Constructs an element with the specified name, attributes and type.
-
Element(String, String[], int, String[], String[])
- Constructs an element with the specified name, attributes, type,
inclusions and exclusions.
-
Element(String, String[], String[])
- Constructs an element with the specified name, attributes and
sub-elements.
-
Element(String, String[], String[], int)
- Constructs an element with the specified name, attributes,
sub-elements and type.
-
Element(String, String[], String[], int, String[], String[])
- Constructs an element with the specified name, attributes,
sub-elements, type, inclusions and exclusions.
-
Element(String, String[], String[], String[], String[])
- Constructs an element with the specified name, attributes,
sub-elements, inclusions and exclusions.
-
canAccept(Element)
- Tests if this element can accept the specified element.
-
getAttributes()
- Returns the names of the attributes of this element.
-
getContentModel()
- Returns the names of the sub-elements in this element, as a set.
-
getContentModelType()
- Returns the content model type of this element.
-
getExclusions()
- Returns the names of the exclusions of this element, as a set.
-
getInclusions()
- Returns the names of the inclusions of this element, as a set.
-
getName()
- Returns the name of this element.
-
hasAttributeNamed(String)
- Tests if this element has an attribute by the specified name.
-
setAttributes(String[])
- Sets the name of the attributes of this element to be the
specified attribute names.
-
setContentModel(String[])
- Sets the sub-elements of this element to be the specified
sub-elements.
-
setContentModel(String[], int)
- Sets the sub-elements and the content model type of this element
to be the specified sub-elements and the specified type.
-
setContentModelType(int)
- Sets the content model type of this element to be the
specified type.
-
setExclusions(String[])
- Sets the inclusions of this element to be the specified exclusions.
-
setInclusions(String[])
- Sets the inclusions of this element to be the specified inclusions.
-
setName(String)
- Sets the name of this element to be the specified name.
PCDATA
public static final int PCDATA
- The content model is #PCDATA.
CDATA
public static final int CDATA
- The content model is #CDATA.
RCDATA
public static final int RCDATA
- The content model is #RCDATA.
EMPTY
public static final int EMPTY
- The content model is EMPTY.
MODEL
public static final int MODEL
- The content model consists of sub-elements.
MODEL_PCDATA
public static final int MODEL_PCDATA
- The content model consists of sub-elements and #PCDATA.
Element
public Element(String name,
String attrs[],
int type)
- Constructs an element with the specified name, attributes and type.
The type should be
PCDATA
, CDATA
,
RCDATA
or EMPTY
.
- Parameters:
- name - the specified name.
- attrs - the specified attribute names.
- type - the specified type.
Element
public Element(String name,
String attrs[],
int type,
String incs[],
String excs[])
- Constructs an element with the specified name, attributes, type,
inclusions and exclusions. The type should be
PCDATA
,
CDATA
, RCDATA
or EMPTY
.
- Parameters:
- 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.
Element
public Element(String name,
String attrs[],
String model[])
- Constructs an element with the specified name, attributes and
sub-elements.
- Parameters:
- name - the specified name.
- attrs - the specified attribute names.
- model - the specified names of the sub-elements.
Element
public Element(String name,
String attrs[],
String model[],
String incs[],
String excs[])
- Constructs an element with the specified name, attributes,
sub-elements, inclusions and exclusions.
- Parameters:
- 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.
Element
public Element(String name,
String attrs[],
String model[],
int type)
- Constructs an element with the specified name, attributes,
sub-elements and type. The type should be
MODEL
or
MODEL_PCDATA
.
- Parameters:
- name - the specified name.
- attrs - the specified attribute names.
- model - the specified names of the sub-elements.
- type - the specified type.
Element
public Element(String name,
String attrs[],
String model[],
int type,
String incs[],
String excs[])
- Constructs an element with the specified name, attributes,
sub-elements, type, inclusions and exclusions. The type should be
MODEL
or MODEL_PCDATA
.
- Parameters:
- 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.
canAccept
public boolean canAccept(Element element)
- Tests if this element can accept the specified element.
- Parameters:
- element - an element.
- Returns:
-
true
if this element can accept the
specified element; false
otherwise.
getName
public String getName()
- Returns the name of this element.
- Returns:
- the name of this element.
setName
public void setName(String name)
- Sets the name of this element to be the specified name.
- Parameters:
- name - the specified name.
getAttributes
public Set getAttributes()
- Returns the names of the attributes of this element.
- Returns:
- the names of the attributes of this element.
setAttributes
public void setAttributes(String attrs[])
- Sets the name of the attributes of this element to be the
specified attribute names.
- Parameters:
- attrs - the specified attribute names.
hasAttributeNamed
public boolean hasAttributeNamed(String name)
- Tests if this element has an attribute by the specified name.
- Parameters:
- name - the specified attribute name.
- Returns:
-
true
if this element has an attribute by
the specified name; false
otherwise.
getContentModelType
public int getContentModelType()
- Returns the content model type of this element.
- Returns:
- the content model type of this element.
getContentModel
public Set getContentModel()
- Returns the names of the sub-elements in this element, as a set.
- Returns:
- the names of the sub-elements in this element, as a set
setContentModelType
public void setContentModelType(int type)
- Sets the content model type of this element to be the
specified type.
- Parameters:
- type - the specified type.
- Throws: IllegalArgumentException
- if the specified type is not
a valid.
setContentModel
public void setContentModel(String model[])
- Sets the sub-elements of this element to be the specified
sub-elements.
- Parameters:
- model - the specified names of the sub-elements.
- Throws: IllegalArgumentException
- if the specified type is not
a valid.
setContentModel
public void setContentModel(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.
- Parameters:
- model - the specified names of the sub-elements.
- type - the specified type.
- Throws: IllegalArgumentException
- if the specified type is not
a valid.
getInclusions
public Set getInclusions()
- Returns the names of the inclusions of this element, as a set.
- Returns:
- the names of the inclusions of this element, as a set
setInclusions
public void setInclusions(String incs[])
- Sets the inclusions of this element to be the specified inclusions.
- Parameters:
- incs - the specified names of the inclusions.
getExclusions
public Set getExclusions()
- Returns the names of the exclusions of this element, as a set.
- Returns:
- the names of the exclusions of this element, as a set
setExclusions
public void setExclusions(String excs[])
- Sets the inclusions of this element to be the specified exclusions.
- Parameters:
- excs - the specified names of the exclusions.
All Packages Class Hierarchy This Package Previous Next Index