Enum Class SequentialMergeState

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

public enum SequentialMergeState extends Enum<SequentialMergeState>

This enum represents the current state of the sequential merge object. Methods within a merge object can only be invoked in certain states, otherwise IllegalStateExceptions will be thrown. The table below documents which methods can be thrown in each state, and what effect those methods have on the state.

State Table
Method Callable in State Subsequent State
INITIAL RESET STARTED EXTRACTABLE
While adding first version: addVersion(java.io.File, String)
addVersion(java.io.InputStream, String, String)
addVersion(java.io.Reader, String, String)
addVersion(java.net.URL, String)
STARTED
While adding subsequent versions : addVersion(java.io.File, String)
addVersion(java.io.InputStream, String, String)
addVersion(java.io.Reader, String, String)
addVersion(java.net.URL, String)
EXTRACTABLE
extractAll(java.io.File)
extractAll(java.io.OutputStream)
extractAll(java.io.Writer)
reset() RESET
setEntityResolver(org.xml.sax.EntityResolver, boolean)
setWordByWord(boolean) setDoctypePreservationMode(DoctypePreservationMode)
setEntityReferencePreservationMode(EntityReferencePreservationMode)

The change of state is demonstrated in the following state-diagram:

The current state of the merge object can be accessed via getCurrentState().

  • Enum Constant Details

    • INITIAL

      public static final SequentialMergeState INITIAL

      This is the state after initializing a merge object.

    • RESET

      public static final SequentialMergeState RESET

      This is the state after calling reset(). This state is similar to INITIAL, however setEntityResolver(org.xml.sax.EntityResolver, boolean), setWordByWord(boolean), setDoctypePreservationMode(DoctypePreservationMode) and setEntityReferencePreservationMode(EntityReferencePreservationMode) do not need to be re-called.

    • STARTED

      public static final SequentialMergeState STARTED

      This is the state after setting the first version.

    • EXTRACTABLE

      public static final SequentialMergeState EXTRACTABLE

      This is the state after two or more versions have been added.

  • Method Details

    • values

      public static SequentialMergeState[] 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 SequentialMergeState 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