Package org.zkoss.idom
Class ProcessingInstruction
- java.lang.Object
-
- org.zkoss.idom.impl.AbstractItem
-
- org.zkoss.idom.ProcessingInstruction
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.w3c.dom.Node
,org.w3c.dom.ProcessingInstruction
,Item
public class ProcessingInstruction extends AbstractItem implements org.w3c.dom.ProcessingInstruction
The iDOM processing instruction.- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_rawData
The raw data.protected java.lang.String
_target
The target.-
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProcessingInstruction()
Constructor.ProcessingInstruction(java.lang.String target, java.lang.String data)
Constructor.ProcessingInstruction(java.lang.String target, java.util.Map<java.lang.String,java.lang.String> data)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getData()
java.lang.String
getName()
Gets the name of the item.short
getNodeType()
java.lang.String
getTarget()
java.lang.String
getText()
java.util.Map<java.lang.String,java.lang.String>
parseData()
Returns the parsed data in the form of Map (never null).static java.util.Map<java.lang.String,java.lang.String>
parseToMap(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String rawData)
Parses the raw data into a map.void
setData(java.lang.String data)
void
setData(java.util.Map<java.lang.String,java.lang.String> data)
Sets the raw data with a data map.void
setName(java.lang.String name)
Sets the name of the item.void
setTarget(java.lang.String target)
void
setText(java.lang.String text)
Sets the text of this item.java.lang.String
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, 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, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Constructor Detail
-
ProcessingInstruction
public ProcessingInstruction(java.lang.String target, java.lang.String data)
Constructor.
-
ProcessingInstruction
public ProcessingInstruction(java.lang.String target, java.util.Map<java.lang.String,java.lang.String> data)
Constructor.
-
ProcessingInstruction
protected ProcessingInstruction()
Constructor.
-
-
Method Detail
-
getTarget
public final java.lang.String getTarget()
- Specified by:
getTarget
in interfaceorg.w3c.dom.ProcessingInstruction
-
setTarget
public final void setTarget(java.lang.String target)
-
getData
public final java.lang.String getData()
- Specified by:
getData
in interfaceorg.w3c.dom.ProcessingInstruction
-
setData
public final void setData(java.lang.String data)
- Specified by:
setData
in interfaceorg.w3c.dom.ProcessingInstruction
-
parseData
public final java.util.Map<java.lang.String,java.lang.String> parseData()
Returns the parsed data in the form of Map (never null).
-
setData
public final void setData(java.util.Map<java.lang.String,java.lang.String> data)
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
public static final java.util.Map<java.lang.String,java.lang.String> parseToMap(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String rawData)
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
public final java.lang.String getName()
Description copied from interface:Item
Gets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as getTagName.- Specified by:
getName
in interfaceItem
- See Also:
Namespaceable.getTagName()
-
setName
public final void setName(java.lang.String name)
Description copied from interface:Item
Sets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as setTagName.- Specified by:
setName
in interfaceItem
- Overrides:
setName
in classAbstractItem
- See Also:
Namespaceable.setTagName(java.lang.String)
-
getText
public final java.lang.String getText()
Description copied from interface:Item
Gets the text of this item, or null if it is neitherTextual
norElement
. 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:
getText
in interfaceItem
- Overrides:
getText
in classAbstractItem
-
setText
public final void setText(java.lang.String text)
Description copied from interface:Item
Sets the text of this item.- Specified by:
setText
in interfaceItem
- Overrides:
setText
in classAbstractItem
-
getNodeType
public final short getNodeType()
- Specified by:
getNodeType
in interfaceorg.w3c.dom.Node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-