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

Variable Index

 o CDATA
The content model is #CDATA.
 o EMPTY
The content model is EMPTY.
 o MODEL
The content model consists of sub-elements.
 o MODEL_PCDATA
The content model consists of sub-elements and #PCDATA.
 o PCDATA
The content model is #PCDATA.
 o RCDATA
The content model is #RCDATA.

Constructor Index

 o Element(String, String[], int)
Constructs an element with the specified name, attributes and type.
 o Element(String, String[], int, String[], String[])
Constructs an element with the specified name, attributes, type, inclusions and exclusions.
 o Element(String, String[], String[])
Constructs an element with the specified name, attributes and sub-elements.
 o Element(String, String[], String[], int)
Constructs an element with the specified name, attributes, sub-elements and type.
 o Element(String, String[], String[], int, String[], String[])
Constructs an element with the specified name, attributes, sub-elements, type, inclusions and exclusions.
 o Element(String, String[], String[], String[], String[])
Constructs an element with the specified name, attributes, sub-elements, inclusions and exclusions.

Method Index

 o canAccept(Element)
Tests if this element can accept the specified element.
 o getAttributes()
Returns the names of the attributes of this element.
 o getContentModel()
Returns the names of the sub-elements in this element, as a set.
 o getContentModelType()
Returns the content model type of this element.
 o getExclusions()
Returns the names of the exclusions of this element, as a set.
 o getInclusions()
Returns the names of the inclusions of this element, as a set.
 o getName()
Returns the name of this element.
 o hasAttributeNamed(String)
Tests if this element has an attribute by the specified name.
 o setAttributes(String[])
Sets the name of the attributes of this element to be the specified attribute names.
 o setContentModel(String[])
Sets the sub-elements of this element to be the specified sub-elements.
 o 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.
 o setContentModelType(int)
Sets the content model type of this element to be the specified type.
 o setExclusions(String[])
Sets the inclusions of this element to be the specified exclusions.
 o setInclusions(String[])
Sets the inclusions of this element to be the specified inclusions.
 o setName(String)
Sets the name of this element to be the specified name.

Variables

 o PCDATA
 public static final int PCDATA
The content model is #PCDATA.

 o CDATA
 public static final int CDATA
The content model is #CDATA.

 o RCDATA
 public static final int RCDATA
The content model is #RCDATA.

 o EMPTY
 public static final int EMPTY
The content model is EMPTY.

 o MODEL
 public static final int MODEL
The content model consists of sub-elements.

 o MODEL_PCDATA
 public static final int MODEL_PCDATA
The content model consists of sub-elements and #PCDATA.

Constructors

 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.

Methods

 o 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.
 o getName
 public String getName()
Returns the name of this element.

Returns:
the name of this element.
 o setName
 public void setName(String name)
Sets the name of this element to be the specified name.

Parameters:
name - the specified name.
 o getAttributes
 public Set getAttributes()
Returns the names of the attributes of this element.

Returns:
the names of the attributes of this element.
 o 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.
 o 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.
 o getContentModelType
 public int getContentModelType()
Returns the content model type of this element.

Returns:
the content model type of this element.
 o 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
 o 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.
 o 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.
 o 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.
 o 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
 o 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.
 o 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
 o 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