Package org.zkoss.idom
Class ProcessingInstruction
java.lang.Object
org.zkoss.idom.impl.AbstractItem
org.zkoss.idom.ProcessingInstruction
- All Implemented Interfaces:
Serializable,Cloneable,Node,ProcessingInstruction,Item
The iDOM processing instruction.
- Author:
- tomyeh
- See Also:
-
Field Summary
FieldsFields inherited from interface org.zkoss.idom.Item
FIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVEFields 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.ProcessingInstruction(String target, String data) Constructor.ProcessingInstruction(String target, Map<String, String> data) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetData()final StringgetName()Gets the name of the item.final shortfinal Stringfinal StringgetText()Returns the parsed data in the form of Map (never null).parseToMap(Map<String, String> map, String rawData) Parses the raw data into a map.final voidfinal voidSets the raw data with a data map.final voidSets the name of the item.final voidfinal voidSets the text of this item.toString()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, getTextContent, getUserData, hasAttributes, hasChildNodes, hashCode, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, match, normalize, removeChild, replaceChild, setLocator, setNodeValue, setParent, setPrefix, setTextContent, setUserDataMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Field Details
-
_target
The target. -
_rawData
The raw data.
-
-
Constructor Details
-
ProcessingInstruction
Constructor. -
ProcessingInstruction
Constructor. -
ProcessingInstruction
protected ProcessingInstruction()Constructor.
-
-
Method Details
-
getTarget
- Specified by:
getTargetin interfaceProcessingInstruction
-
setTarget
-
getData
- Specified by:
getDatain interfaceProcessingInstruction
-
setData
- Specified by:
setDatain interfaceProcessingInstruction
-
parseData
Returns the parsed data in the form of Map (never null). -
setData
Sets the raw data with a data map. Each entry in the data map is a (name, value) pair.- Throws:
IllegalSyntaxException- if name contains an invalid character: '=', ' ', '\'', '"'
-
parseToMap
Parses the raw data into a map. Each entry in the data map is a (name, value) pair. This method will convert a value to a number, either Integer or Double, if appropriate.Most of characters are considered as ordinary (like 'a'), exception '"', '='
For example, the string will cause ("a12", Intger(12)), ("b+3", null), ("345", null), ("c6", "abc=125&3?5"):
a12 =12 b+3 345 c6=\t'abc=125&3?5'- Returns:
- the map (never null)
- Throws:
IllegalSyntaxException- if syntax erros
-
getName
Description copied from interface:ItemGets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as getTagName. -
setName
Description copied from interface:ItemSets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as setTagName.- Specified by:
setNamein interfaceItem- Overrides:
setNamein classAbstractItem- See Also:
-
getText
Description copied from interface:ItemGets the text of this item, or null if it is neitherTextualnorElement. For Element, the text is the concatenation 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.
- Specified by:
getTextin interfaceItem- Overrides:
getTextin classAbstractItem
-
setText
Description copied from interface:ItemSets the text of this item.- Specified by:
setTextin interfaceItem- Overrides:
setTextin classAbstractItem
-
getNodeType
public final short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
toString
-