Enum Class Mode

java.lang.Object
java.lang.Enum<Mode>
de.wwu.scdh.annotation.selection.Mode
All Implemented Interfaces:
Serializable, Comparable<Mode>, Constable

public enum Mode extends Enum<Mode>
The Mode is an enum type for selecting an algorithm for the first stage of the normalization.

For corner cases, normalization is ambiguous.

Case 1: For the simple, but well-formed XML document <r>Sol<t>ar</t>!</r> the normalization of the XPath pointer `/r` refined by the character scheme `char=3` is ambiguous:

              <r>|S|o|l|<t>|a|r|</t>|!|</r>
 /r;char=        0 1 2 3   3 4 5    5 6
 /r/t[1];char=             0 1 2
 
Valid normalization results would be /r[1]/text()[1} refined by char=3, and also /r[1]/t[1]/text()[1] refined by char=0.

Case 2: For the XML document <r>Sol<t>ar</t><g>pan</g>el!</r>, the selector /r;char=5 may select the position after the character r in the node /r/t[1]/text()[1] or the position before the character p in the node /r/g[1]/text()[1].

  • Enum Constant Details

    • FIRST

      public static final Mode FIRST
      Always take the first text node with the position, i.e., the first one in document order.

      If the selector selects the first/last position in a subtree, this algorithm checks for the first text node on the preceding/following axis of the node selected by the XPath component.

    • SECOND

      public static final Mode SECOND
      Always take the second text node with the position, i.e., the second in document order.

      If the selector selects the first/last position in a subtree, this algorithm checks for the first text node on the preceding/following axis of the node selected by the XPath component.

    • DEEP_NODE_STOP_AT_END

      public static final Mode DEEP_NODE_STOP_AT_END
      Descend to the deepest text node. In corner cases, stop at the first text node, that contains the position.

      This will return /r;char3 for the first corner case described in Mode.

    • DEEP_NODE_STEP_OVER_END

      public static final Mode DEEP_NODE_STEP_OVER_END
      Descend to the deepest text node. In corner cases, step over the end of a text node and try to get the position from the next text node.

      This will return /r/t[1];char=0 for the first corner case described in Mode.

    • FIRST_OF_DEEPEST_NODES

      public static final Mode FIRST_OF_DEEPEST_NODES
      Descend to the deepest text node. In corner cases, take the deepest text node. If there are equally deep text nodes, take the first one in document order.

      This will return /r/t[1];char=0 for the first corner case described in Mode. For case 2, it selects the text node in the t element.

    • LAST_OF_DEEPEST_NODES

      public static final Mode LAST_OF_DEEPEST_NODES
      Descend to the deepest text node. In corner cases, take the deepest text node. If there are equally deep text nodes, take the last one in document order.

      This will return /r/t[1];char=0 for the first corner case described in Mode. For case 2, it selects the text node in the g element.

  • Method Details

    • values

      public static Mode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Mode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null