public class ProcessingInstruction extends AbstractItem implements ProcessingInstruction
| Modifier and Type | Field and Description |
|---|---|
protected String |
_rawData
The raw data.
|
protected String |
_target
The target.
|
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_NODEFIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVE| Modifier | Constructor and Description |
|---|---|
protected |
ProcessingInstruction()
Constructor.
|
|
ProcessingInstruction(String target,
Map<String,String> data)
Constructor.
|
|
ProcessingInstruction(String target,
String data)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getData() |
String |
getName()
Gets the name of the item.
|
short |
getNodeType() |
String |
getTarget() |
String |
getText()
|
Map<String,String> |
parseData()
Returns the parsed data in the form of Map (never null).
|
static Map<String,String> |
parseToMap(Map<String,String> map,
String rawData)
Parses the raw data into a map.
|
void |
setData(Map<String,String> data)
Sets the raw data with a data map.
|
void |
setData(String data) |
void |
setName(String name)
Sets the name of the item.
|
void |
setTarget(String target) |
void |
setText(String text)
Sets the text of this item.
|
String |
toString() |
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, setUserDatafinalize, getClass, notify, notifyAll, wait, wait, waitappendChild, 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, setUserDataprotected String _target
protected String _rawData
public ProcessingInstruction(String target, Map<String,String> data)
protected ProcessingInstruction()
public final String getTarget()
getTarget in interface ProcessingInstructionpublic final void setTarget(String target)
public final String getData()
getData in interface ProcessingInstructionpublic final void setData(String data)
setData in interface ProcessingInstructionpublic final Map<String,String> parseData()
public final void setData(Map<String,String> data)
IllegalSyntaxException - if name contains
an invalid character: '=', ' ', '\'', '"'public static final Map<String,String> parseToMap(Map<String,String> map, String rawData)
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'
IllegalSyntaxException - if syntax errospublic final String getName()
ItemgetName in interface ItemNamespaceable.getTagName()public final void setName(String name)
ItemsetName in interface ItemsetName in class AbstractItemNamespaceable.setTagName(java.lang.String)public final String getText()
ItemTextual
nor Element.
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.
getText in interface ItemgetText in class AbstractItempublic final void setText(String text)
ItemsetText in interface ItemsetText in class AbstractItempublic final short getNodeType()
getNodeType in interface NodeCopyright © 2018. All rights reserved.