Class ProcessingInstruction

java.lang.Object
org.faceless.publisher.type.ProcessingInstruction

public class ProcessingInstruction extends Object
Represents a single XML processing-instruction, with a "type" and "data". Presumes that the "data" parameters is broken into parameters the same way as the "xml-stylesheet" processing instruction. Most are.
See Also:
  • Constructor Details

    • ProcessingInstruction

      public ProcessingInstruction()
      Create a new empty processing-instruction
    • ProcessingInstruction

      public ProcessingInstruction(ProcessingInstruction pi)
      Create a new empty processing-instruction that is a clone of that supplied
      Parameters:
      pi - the processing-instruction to clone
    • ProcessingInstruction

      public ProcessingInstruction(String type, String data)
      Create a new processing-instruction
      Parameters:
      type - the type, eg "link" or "xml-stylesheet"
      data - the data value of the processing instruction, which will ba parsed into individual key/value pairs
  • Method Details

    • setType

      public ProcessingInstruction setType(String type)
      Set the type of this processing-instruction
      Parameters:
      type - the type, eg "link" or "xml-stylesheet"
      Returns:
      this
    • getType

      public String getType()
      Return the type of this processing-instruction, as set by setType(java.lang.String)
      Returns:
      the type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • put

      public ProcessingInstruction put(String key, String value)
      Put a new parameter key/value pair into this processing-instruction
      Parameters:
      key - the key
      value - the value, or null to remoe the key
      Returns:
      this
    • get

      public String get(String key)
      Retrieve a parameter value from this processing-instruction
      Parameters:
      key - the key
      Returns:
      the value, or null if not found
    • getParameters

      public Map<String,String> getParameters()
      Return an unmodifiable map representing the key/value pairs on this processing-instruction
      Returns:
      the map
    • getData

      public String getData()
      Return a "data" string representing the encoded parameters returned by getParameters()
      Returns:
      the data string