org.capml.dom
Class Element

java.lang.Object
  |
  +--org.capml.dom.Node
        |
        +--org.capml.dom.Element
All Implemented Interfaces:
DeepPassByCopy, Iteratable, Marker, PassByConstruction, Persistent, Selfless, Serializable

Deprecated. Use Term trees instead.

public class Element
extends Node

Untamed: Represents everything in a Minimal-XML document from a start tag to an end tag, inclusive.

This is a substantial revision by ERights.org of the file as released by the w3c, as is allowed by the license. See the package comment. The original class comment:

The Element interface represents an element in an HTML or XML document. Elements may have attributes associated with them; since the Element interface inherits from Node , the generic Node interface attribute attributes may be used to retrieve the set of all attributes for an element. There are methods on the Element interface to retrieve either an Attr object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an Attr object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience. In DOM Level 2, the method normalize is inherited from the Node interface where it was moved.

See Also:
Serialized Form

Field Summary
static StaticMaker ElementMaker
          Deprecated. Enabled:
private  ConstList myChildren
          Deprecated.  
private  String myTagName
          Deprecated.  
(package private) static long serialVersionUID
          Deprecated.  
 
Fields inherited from class org.capml.dom.Node
ELEMENT_NODE, TEXT_NODE
 
Fields inherited from interface org.erights.e.elib.serial.Persistent
HONORARY, HONORED_NAMES
 
Fields inherited from interface org.erights.e.elib.serial.DeepPassByCopy
HONORARY, HONORED_NAMES
 
Constructor Summary
Element(String tagName, ConstList children)
          Deprecated. Enabled:
 
Method Summary
 Astro build(AstroBuilder builder)
          Deprecated. Enabled: Converts to a Astro (eg, Term or AST) whose functor has this tag name and whose args are my converted children in order.
 ConstList getChildNodes()
          Deprecated. Enabled:
 short getNodeType()
          Deprecated. Enabled:
 Object[] getSpreadUncall()
          Deprecated. Enabled: Uses 'ElementMaker(myTagName, myChildren)'
 String getTagName()
          Deprecated. Enabled: The name of the element.
(package private)  Node[] minimize(Node optLeft)
          Deprecated. Asks this Node to return a minimal form of the optional node to the left of itself and itself.
 void prettyPrintOn(TextWriter out, boolean quasiFlag)
          Deprecated. Enabled:
private  String verb()
          Deprecated. Turns the tagName "foo" into the verb "visitFoo".
 Object welcome(Object visitor)
          Deprecated. Enabled: Does 'visitor visit<TagName>(children...)', where the first letter of tagName is upperCased.
 
Methods inherited from class org.capml.dom.Node
__printOn, iterate, minimize, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Deprecated. 

ElementMaker

public static final StaticMaker ElementMaker
Deprecated. 
Enabled:


myTagName

private final String myTagName
Deprecated. 

myChildren

private final ConstList myChildren
Deprecated. 
Constructor Detail

Element

public Element(String tagName,
               ConstList children)
Deprecated. 
Enabled:

Method Detail

getSpreadUncall

public Object[] getSpreadUncall()
Deprecated. 
Enabled: Uses 'ElementMaker(myTagName, myChildren)'


getNodeType

public short getNodeType()
Deprecated. 
Enabled:

Specified by:
getNodeType in class Node

getTagName

public String getTagName()
Deprecated. 
Enabled: The name of the element. For example, in:
 <elementExample id="demo">
         ...
 </elementExample> ,
tagName has the value "elementExample" . Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns the tagName of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.


getChildNodes

public ConstList getChildNodes()
Deprecated. 
Enabled:

Specified by:
getChildNodes in class Node

welcome

public Object welcome(Object visitor)
Deprecated. 
Enabled: Does 'visitor visit<TagName>(children...)', where the first letter of tagName is upperCased.

For example, if the tag name is "foo", then the visitor will be called as 'visitor visitFoo(children...)'

Specified by:
welcome in class Node

verb

private String verb()
Deprecated. 
Turns the tagName "foo" into the verb "visitFoo".


prettyPrintOn

public void prettyPrintOn(TextWriter out,
                          boolean quasiFlag)
                   throws IOException
Deprecated. 
Enabled:

Specified by:
prettyPrintOn in class Node
IOException

build

public Astro build(AstroBuilder builder)
Deprecated. 
Enabled: Converts to a Astro (eg, Term or AST) whose functor has this tag name and whose args are my converted children in order.

Specified by:
build in class Node

minimize

Node[] minimize(Node optLeft)
Deprecated. 
Description copied from class: Node
Asks this Node to return a minimal form of the optional node to the left of itself and itself.

If the node to the left is provided (ie, if 'optLeft' isn't null), then this node may safely assume that this provided sibling has already been minimized.

The minimization is much like XML canonicalization, but depends on an assumption specific to Minimal-XML: That for an Element that contains sub-Elements, all pure-whitespace Texts that it also contains may be gotten rid of.

The number of nodes returned cannot exceed the number examined. In other words, if 'optLeft' is null, only zero or one node may be returned. If 'optLeft' isn't null, the number returned may only be zero, one, or two.

Specified by:
minimize in class Node
Returns:
A list of nodes to replace 'optLeft' and itself.


comments?