Class SpaceEvent

All Implemented Interfaces:
DiffXEvent, TextEvent, XMLFormattable, XMLWritable

public final class SpaceEvent extends CharactersEventBase implements TextEvent
A particular type of event reserved for white spaces.
Version:
27 March 2010
  • Field Details

    • SINGLE_WHITESPACE

      public static final SpaceEvent SINGLE_WHITESPACE
      A static instance for the single white spaces.

      Use this constant instead of creating new instances

    • DOUBLE_WHITESPACE

      public static final SpaceEvent DOUBLE_WHITESPACE
      A static instance for the double white spaces.

      Use this constant instead of creating new instances

    • NEW_LINE

      public static final SpaceEvent NEW_LINE
      A static instance for the new lines.

      Use this constant instead of creating new instances

    • TAB

      public static final SpaceEvent TAB
      A static instance for tabs.

      Use this constant instead of creating new instances

  • Constructor Details

  • Method Details

    • toString

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

      public static SpaceEvent getInstance(CharSequence space)
      Returns the white space event corresponding to the given string.
      Parameters:
      space - The string for the white space event.
      Returns:
      A readable string.
    • getInstance

      public static SpaceEvent getInstance(char c)
      Returns the white space event corresponding to the given string.
      Parameters:
      c - The string for the white space event.
      Returns:
      A readable string.
    • toString

      private static String toString(char[] chars)
      Returns the white space characters as a readable string.
      Parameters:
      chars - The whitespace characters
      Returns:
      A readable string.