Enum Class PresetPreservationMode

java.lang.Object
java.lang.Enum<PresetPreservationMode>
com.deltaxml.core.config.PresetPreservationMode
All Implemented Interfaces:
Serializable, Comparable<PresetPreservationMode>, Constable

public enum PresetPreservationMode extends Enum<PresetPreservationMode>
The preset lexical preservation modes. For convenience some preset modes of preservation have been provided.
Since:
7.0
See Also:
  • Enum Constant Details

    • BASE

      public static final PresetPreservationMode BASE

      The base level of preservation, which has almost everything disabled. The only preservation item to be enabled is the PI_ENTITY_REPLACEMENT_TEXT. Its string representation is 'base' (without the quotes).

      Note that if neither entity references nor their replacement texts are preserved, then entity references will be removed from the output altogether. This is why we have introduced a base class, which can be used in preference to setting all preserve items to disabled. It is this pre-defined set that most of the preservation item specific samples extend.

    • NESTED_ENTITY_REF

      public static final PresetPreservationMode NESTED_ENTITY_REF
      Preserve round trip information and data that can be used to identify differences in both an entity's and nested entity's value. This mode adds INNER_ENTITY_APP preservation item to the PI_ENTITY_REF preservation set. Note this mode, currently, preserves as much information as possible. Its string representation is 'nestedEntityRef' (without the quotes).
    • ENTITY_REF

      public static final PresetPreservationMode ENTITY_REF
      Preserve round trip information and data that can be used to identify differences in an entity's value. This mode adds ENTITY_REPLACEMENT_TEXT preservation item to the PI_ROUND_TRIP preservation set. To identify differences in the way the entities are defined, then the nested entity application information is also required. Its string representation is 'entityRef' (without the quotes).
    • ROUND_TRIP

      public static final PresetPreservationMode ROUND_TRIP
      The minimum amount of information required for round trip processing. That is the internal subset, XML declaration, entity reference, original attribute, and CDATA element preservation. This is the default setting. Its string representation is 'roundTrip' (without the quotes).
    • DOC_AND_ATTRIB

      public static final PresetPreservationMode DOC_AND_ATTRIB
      Preserve the XML document and attribute information. This extends the DOCUMENT option with mark-up for recording which attributes of an element have been expanded. Note, that the expanded default attributes can be removed by the DefaultAttributeRemovalFilter filter. Its string representation is 'docAndAttrib' (without the quotes).
    • DOCUMENT

      public static final PresetPreservationMode DOCUMENT
      Preserve the XML document information. This adds internal subset and XML declaration preservation to that of the normal preservation data. Its string representation is 'document' (without the quotes).
    • ATTRIBUTE

      public static final PresetPreservationMode ATTRIBUTE
      Make a note of which attributes have been expanded to their default values, during parsing. This extends the XML_PARSER option with mark-up for recording which attributes of an element have been expanded. Note, that the expanded default attributes can be removed by the DefaultAttributeRemovalFilter filter. Its string representation is 'attribute' (without the quotes).
    • XML_PARSER

      public static final PresetPreservationMode XML_PARSER
      Preserve the normal amount of information (as expected by normal XML processing). This is equivalent to preserving only the entity application bodies, comments and processing instructions. Its string representation is 'xmlParser' (without the quotes).
  • Method Details

    • values

      public static PresetPreservationMode[] 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 PresetPreservationMode 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
    • getPresetPreservationMode

      public static PresetPreservationMode getPresetPreservationMode(String val)

      Returns a ProcessingItem object from the supplied String value if appropriate.

      This method should not be used under normal circumstances, enum instance values should be used instead.

      Parameters:
      val - a String representation of a ProcessingItem value or null for the default value
      Returns:
      the ProcessingItem instance corresponding to the parameter, or null if the value is invalid
    • toString

      public String toString()
      The string representation of the enumerated value.
      Overrides:
      toString in class Enum<PresetPreservationMode>
      Returns:
      the string representation of the enumerated value.