Package org.zkoss.idom
Class Binary
- java.lang.Object
-
- org.zkoss.idom.impl.AbstractItem
-
- org.zkoss.idom.impl.AbstractTextual
-
- org.zkoss.idom.Binary
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.w3c.dom.CharacterData,org.w3c.dom.Node,org.w3c.dom.Text,Binable,Item,Textual
public class Binary extends AbstractTextual implements org.w3c.dom.Text, Binable
The binary item. It is iDOM's extension to W3C/DOM, which allows only String-type value. However, XML files doesn't convey the type information, so, when loading back an XML file, Binary vertices become CData vertices.To be compatible with W3C/DOM utility, it fakes as Text. Thus, getNodeName returns "#text", rather than getName ("#binary").
- Author:
- tomyeh
- See Also:
CData, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.idom.impl.AbstractTextual
_text
-
Fields inherited from interface org.zkoss.idom.Item
FIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVE
-
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckText(java.lang.String text)Checks whether the text is valid.java.lang.StringgetName()Gets the name of the item.java.lang.StringgetNodeName()shortgetNodeType()java.lang.StringgetText()Gets the text representation of the value.java.lang.ObjectgetValue()Gets the value of a item that accepts any type as its value.voidsetText(java.lang.String text)Sets the text of this item.voidsetValue(java.lang.Object o)Sets the value of a item that accepts any type as its value.java.lang.StringtoString()Gets the textual representation for debug.-
Methods inherited from class org.zkoss.idom.impl.AbstractTextual
appendData, deleteData, getData, getLength, getTextContent, getWholeText, insertData, isCoalesceable, isElementContentWhitespace, isPartOfParentText, replaceData, replaceWholeText, setData, split, splitText, substringData
-
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, 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.CharacterData
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Method Detail
-
checkText
protected void checkText(java.lang.String text)
Description copied from class:AbstractTextualChecks whether the text is valid. It is usually overridden by the deriving classes to check more specifically.- Overrides:
checkTextin classAbstractTextual
-
getValue
public final java.lang.Object getValue()
Description copied from interface:BinableGets the value of a item that accepts any type as its value.
-
setValue
public final void setValue(java.lang.Object o)
Description copied from interface:BinableSets the value of a item that accepts any type as its value.
-
getText
public final java.lang.String getText()
Gets the text representation of the value. Never null.- Specified by:
getTextin interfaceItem- Overrides:
getTextin classAbstractTextual
-
setText
public final void setText(java.lang.String text)
Description copied from interface:ItemSets the text of this item.- Specified by:
setTextin interfaceItem- Overrides:
setTextin classAbstractTextual
-
getName
public final java.lang.String getName()
Description copied from interface:ItemGets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as getTagName.- Specified by:
getNamein interfaceItem- See Also:
Namespaceable.getTagName()
-
getNodeName
public final java.lang.String getNodeName()
- Specified by:
getNodeNamein interfaceorg.w3c.dom.Node- Overrides:
getNodeNamein classAbstractItem
-
getNodeType
public final short getNodeType()
- Specified by:
getNodeTypein interfaceorg.w3c.dom.Node
-
toString
public java.lang.String toString()
Gets the textual representation for debug.- Overrides:
toStringin classAbstractTextual
-
-