Class InputSettings

java.lang.Object
org.libxmq.InputSettings

public class InputSettings extends Object
Used to configure the parser behaviour when parsing XMQ.

Example:


 InputSettings is = new InputSettings().setImplicitRoot("config").setTrimNone();
 
  • Constructor Details

    • InputSettings

      public InputSettings()
      Construct an default input settings.
  • Method Details

    • setImplicitRoot

      public InputSettings setImplicitRoot(String r)
      Set the implicit root when parsing XMQ. Normally XML requires an explicit root element. However when loading an expected configuration file in XMQ the root can be explicit (eg "config"). This means that an XMQ config file can be as simple as a list of key=value pairs.

      Example:

      
       speed=123
       type=car
       
      Parameters:
      r - The implicit root to add, eg "config".
      Returns:
      this InputSettings instance, for method chaining
    • getImplicitRoot

      public String getImplicitRoot()
      Returns the previously set trim none.
      Returns:
      the trim none status
    • setTrimNone

      public InputSettings setTrimNone(boolean b)
      Disable whitespace trimming using the xmq heuristic when loading xml/html.
      Parameters:
      b - True means keep all whitespace as-is.
      Returns:
      this OutputSettings instance, for method chaining
    • getTrimNone

      public boolean getTrimNone()
      Returns the previously set trim none.
      Returns:
      the trim none status
    • setNoMerge

      public InputSettings setNoMerge(boolean b)
      Disable automatic merging of text noes when loading document.
      Parameters:
      b - True means keep text nodes separate when loading from xmq.
      Returns:
      this OutputSettings instance, for method chaining
    • getNoMerge

      public boolean getNoMerge()
      Returns the previously set no merge.
      Returns:
      the no merge status