org.capml.dom
Class Node

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

public abstract class Node
extends Object
implements Persistent, DeepPassByCopy, Iteratable

Untamed:

See Also:
Serialized Form

Field Summary
static short ELEMENT_NODE
          Enabled:
(package private) static long serialVersionUID
           
static short TEXT_NODE
          Enabled:
 
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
(package private) Node()
          All the subclasses are in this package
 
Method Summary
 void __printOn(TextWriter out)
          Enabled: Prints as "sml`...`", where pretty printed XML appears between the backquotes
abstract  Astro build(AstroBuilder builder)
          Enabled: Used to convert from a Node tree to an Astro (eg, AST or Term) tree.
abstract  ConstList getChildNodes()
          Enabled: Modified to return an ConstList of Nodes rather than a NodeList.
abstract  short getNodeType()
          Enabled: A code representing the type of the underlying object, as defined above.
 void iterate(AssocFunc body)
          Enabled: A node iterates its children
 Node minimize()
          Enabled:
(package private) abstract  Node[] minimize(Node optLeft)
          Asks this Node to return a minimal form of the optional node to the left of itself and itself.
abstract  void prettyPrintOn(TextWriter out, boolean quasiFlag)
          Enabled: Prints pretty printed XML
 boolean supports(String feature, String version)
          Enabled: Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
abstract  Object welcome(Object visitor)
          Enabled: The classic visitor pattern from the patterns literature, except that we don't dispatch on the type of the node, but, for Elements, on a verb generated from the tag name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.erights.e.elib.tables.Selfless
getSpreadUncall
 

Field Detail

serialVersionUID

static final long serialVersionUID

ELEMENT_NODE

public static final short ELEMENT_NODE
Enabled:


TEXT_NODE

public static final short TEXT_NODE
Enabled:

Constructor Detail

Node

Node()
All the subclasses are in this package

Method Detail

getNodeType

public abstract short getNodeType()
Enabled: A code representing the type of the underlying object, as defined above.


getChildNodes

public abstract ConstList getChildNodes()
Enabled: Modified to return an ConstList of Nodes rather than a NodeList. The original documantation:

A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes. The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. This is true for every NodeList , including the ones returned by the getElementsByTagName method.


iterate

public void iterate(AssocFunc body)
Enabled: A node iterates its children

Specified by:
iterate in interface Iteratable

welcome

public abstract Object welcome(Object visitor)
Enabled: The classic visitor pattern from the patterns literature, except that we don't dispatch on the type of the node, but, for Elements, on a verb generated from the tag name.

In order to call the visitor with generated names, we call the visitor with E.call().


supports

public boolean supports(String feature,
                        String version)
Enabled: Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.

Parameters:
feature - The name of the feature to test. This is the same name which can be passed to the method hasFeature on DOMImplementation .
version - This is the version number of the feature to test. In Level 2, version 1, this is the string "2.0". If the version is not specified, supporting any version of the feature will cause the method to return true .
Returns:
Returns true if the specified feature is supported on this node, false otherwise.
Since:
DOM Level 2

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled: Prints as "sml`...`", where pretty printed XML appears between the backquotes

IOException

prettyPrintOn

public abstract void prettyPrintOn(TextWriter out,
                                   boolean quasiFlag)
                            throws IOException
Enabled: Prints pretty printed XML

IOException

build

public abstract Astro build(AstroBuilder builder)
Enabled: Used to convert from a Node tree to an Astro (eg, AST or Term) tree.


minimize

abstract Node[] minimize(Node optLeft)
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.

Returns:
A list of nodes to replace 'optLeft' and itself.

minimize

public Node minimize()
Enabled:



comments?