Enum Class ConcurrentMergeState

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

public enum ConcurrentMergeState extends Enum<ConcurrentMergeState>

This enum represents the current state of the merge object. Methods within a merge object can only be invoked in certain states, otherwise IllegalStateException 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
setAncestor(java.io.File, String)
setAncestor(java.io.InputStream, String, String)
setAncestor(java.io.Reader, String, String)
setAncestor(java.net.URL, String)
STARTED
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 ConcurrentMergeState INITIAL

      This is the state after initializing a merge object.

    • RESET

      public static final ConcurrentMergeState 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 ConcurrentMergeState STARTED

      This is the state after setting an ancestor.

    • EXTRACTABLE

      public static final ConcurrentMergeState EXTRACTABLE

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

  • Method Details

    • values

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