|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.idom.impl.AbstractItem
org.zkoss.idom.impl.AbstractTextual
public abstract class AbstractTextual
Represents a textual item.
Note: any deriving class's getText shall not return null.
Element.getText uses this class's isPartOfParentText to know whether a child's text shall be catenated.
Element,
Serialized Form| Field Summary | |
|---|---|
protected String |
_text
The text. |
| Fields inherited from interface org.zkoss.idom.Item |
|---|
FIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVE |
| Constructor Summary | |
|---|---|
protected |
AbstractTextual()
Constructor. |
protected |
AbstractTextual(String text)
Constructor. |
| Method Summary | |
|---|---|
void |
appendData(String newData)
|
protected void |
checkText(String text)
Checks whether the text is valid. |
void |
deleteData(int offset,
int count)
|
String |
getData()
|
int |
getLength()
|
String |
getText()
Gets the text of this item, or null if it is neither Textual
nor Element. |
String |
getTextContent()
|
String |
getWholeText()
|
void |
insertData(int offset,
String arg)
|
boolean |
isCoalesceable()
Returns true if this textual object is allowed to be coalesced with its siblings with the same type (class). |
boolean |
isElementContentWhitespace()
|
boolean |
isPartOfParentText()
Returns true if this text object is part of the parent's text. |
void |
replaceData(int offset,
int count,
String arg)
|
Text |
replaceWholeText(String content)
|
void |
setData(String data)
|
void |
setText(String text)
Sets the text of this item. |
Textual |
split(int offset)
Splits at the specified offset into two Textual objects. |
Text |
splitText(int offset)
|
String |
substringData(int offset,
int count)
|
String |
toString()
Gets the textual representation for debug. |
| Methods inherited from class org.zkoss.idom.impl.AbstractItem |
|---|
appendChild, clone, cloneNode, compareDocumentPosition, detach, equals, getAttributes, getBaseURI, getChildNodes, getDocument, getFeature, getFirstChild, getLastChild, getLocalName, getLocator, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, hashCode, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, match, normalize, removeChild, replaceChild, setLocator, setName, setNodeValue, setParent, setPrefix, setTextContent, setUserData |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| Methods inherited from interface org.zkoss.idom.Item |
|---|
getName |
| Field Detail |
|---|
protected String _text
| Constructor Detail |
|---|
protected AbstractTextual(String text)
protected AbstractTextual()
| Method Detail |
|---|
public boolean isPartOfParentText()
isPartOfParentText in interface Textualpublic boolean isCoalesceable()
Default: false. Right now only Text override it to true.
isCoalesceable in interface Textualpublic Textual split(int offset)
Textual
split in interface Textualprotected void checkText(String text)
public String getText()
ItemTextual
nor Element.
For Element, the text is the catenation of all its textual
children, including Text, CDATA, and Binary.
Besides String-type value, some item, e.g., Binary, allows any type of objects. Caller could test whether a item implements the Binable interface, and use Binable.getValue instead. For binable vertices, getText is actually getValue().toString().
The returned value is neither trimmed nor normalized.
getText in interface ItemgetText in class AbstractItempublic void setText(String text)
Item
setText in interface ItemsetText in class AbstractItempublic final int getLength()
getLength in interface CharacterDatapublic final String getData()
getData in interface CharacterDatapublic final void setData(String data)
setData in interface CharacterData
public final String substringData(int offset,
int count)
substringData in interface CharacterDatapublic final void appendData(String newData)
appendData in interface CharacterData
public final void insertData(int offset,
String arg)
insertData in interface CharacterData
public final void deleteData(int offset,
int count)
deleteData in interface CharacterData
public final void replaceData(int offset,
int count,
String arg)
replaceData in interface CharacterDatapublic final Text splitText(int offset)
public boolean isElementContentWhitespace()
public String getWholeText()
public Text replaceWholeText(String content)
throws DOMException
DOMExceptionpublic String getTextContent()
getTextContent in interface NodegetTextContent in class AbstractItempublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||