|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.capml.dom.Node | +--org.capml.dom.Text
Untamed: This represents text that appears between a start-tag and end-tag, after all escapes and whitespace have been processed.
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. For this dom, the only kind of character-data is text, so we folded together the original superclass CharacterData into its subclass Text.
Original comment from CharacterData:
The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData , though Text and others do inherit the interface from it. All offsets in this interface start from 0.Original comment of Text:As explained in the DOMString interface, text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on CharacterData is done in 16-bit units.
The Text interface inherits from CharacterData and represents the textual content (termed character data in XML) of an Element or Attr . If there is no markup inside an element's content, the text is contained in a single object implementing the Text interface that is the only child of the element. If there is markup, it is parsed into the information items (elements, comments, etc.) and Text nodes that form the list of children of the element.When a document is first made available via the DOM, there is only one Text node for each block of text. Users may create adjacent Text nodes that represent the contents of a given element without any intervening markup, but should be aware that there is no way to represent the separations between these nodes in XML or HTML, so they will not (in general) persist between DOM editing sessions. The normalize() method on Element merges any such adjacent Text objects into a single node for each block of text.
Field Summary | |
private String |
myData
Deprecated. |
private static Node[] |
NO_NODES
Deprecated. |
(package private) static long |
serialVersionUID
Deprecated. |
static StaticMaker |
TextMaker
Deprecated. Enabled: |
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 | |
Text(String data)
Deprecated. Enabled: |
Method Summary | |
Astro |
build(AstroBuilder builder)
Deprecated. Enabled: Returns an Astro (eg, AstroToken or Term) consisting of this literal text (as a leaf) and zero arguments. |
ConstList |
getChildNodes()
Deprecated. Enabled: An empty list, since Text has no children |
String |
getData()
Deprecated. Enabled: The character data of the node that implements this interface. |
short |
getNodeType()
Deprecated. Enabled: |
Object[] |
getSpreadUncall()
Deprecated. Enabled: Uses 'TextMaker(myData)' |
(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: |
Object |
welcome(Object visitor)
Deprecated. Enabled: Does 'visitor viewText(myData)'. |
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 |
static final long serialVersionUID
public static final StaticMaker TextMaker
private static final Node[] NO_NODES
private final String myData
Constructor Detail |
public Text(String data)
Method Detail |
public Object[] getSpreadUncall()
public short getNodeType()
getNodeType
in class Node
public ConstList getChildNodes()
getChildNodes
in class Node
public String getData()
public Object welcome(Object visitor)
Called "view" rather than "visit" to keep it distinct from Element-tag-based visitation.
welcome
in class Node
public void prettyPrintOn(TextWriter out, boolean quasiFlag) throws IOException
prettyPrintOn
in class Node
IOException
public Astro build(AstroBuilder builder)
build
in class Node
Node[] minimize(Node optLeft)
Node
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.
minimize
in class Node
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |