Class ProcessingInstruction

java.lang.Object
org.zkoss.idom.impl.AbstractItem
org.zkoss.idom.ProcessingInstruction
All Implemented Interfaces:
Serializable, Cloneable, Node, ProcessingInstruction, Item

public class ProcessingInstruction extends AbstractItem implements ProcessingInstruction
The iDOM processing instruction.
Author:
tomyeh
See Also:
  • Field Details

    • _target

      protected String _target
      The target.
    • _rawData

      protected String _rawData
      The raw data.
  • Constructor Details

    • ProcessingInstruction

      public ProcessingInstruction(String target, String data)
      Constructor.
    • ProcessingInstruction

      public ProcessingInstruction(String target, Map<String,String> data)
      Constructor.
    • ProcessingInstruction

      protected ProcessingInstruction()
      Constructor.
  • Method Details

    • getTarget

      public final String getTarget()
      Specified by:
      getTarget in interface ProcessingInstruction
    • setTarget

      public final void setTarget(String target)
    • getData

      public final String getData()
      Specified by:
      getData in interface ProcessingInstruction
    • setData

      public final void setData(String data)
      Specified by:
      setData in interface ProcessingInstruction
    • parseData

      public final Map<String,String> parseData()
      Returns the parsed data in the form of Map (never null).
    • setData

      public final void setData(Map<String,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 Map<String,String> parseToMap(Map<String,String> map, 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 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 interface Item
      See Also:
    • setName

      public final void setName(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 interface Item
      Overrides:
      setName in class AbstractItem
      See Also:
    • getText

      public final String getText()
      Description copied from interface: Item
      Gets the text of this item, or null if it is neither Textual 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.

      Specified by:
      getText in interface Item
      Overrides:
      getText in class AbstractItem
    • setText

      public final void setText(String text)
      Description copied from interface: Item
      Sets the text of this item.
      Specified by:
      setText in interface Item
      Overrides:
      setText in class AbstractItem
    • getNodeType

      public final short getNodeType()
      Specified by:
      getNodeType in interface Node
    • toString

      public String toString()
      Overrides:
      toString in class Object