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.
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 and Description |
---|
EXTRACTABLE
This is the state after two or more versions have been added.
|
INITIAL
This is the state after initializing a merge object.
|
RESET
This is the state after calling reset().
|
STARTED
This is the state after setting an ancestor.
|
Modifier and Type | Method and Description |
---|---|
static ConcurrentMergeState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ConcurrentMergeState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConcurrentMergeState INITIAL
This is the state after initializing a merge object.
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.
public static final ConcurrentMergeState STARTED
This is the state after setting an ancestor.
public static final ConcurrentMergeState EXTRACTABLE
This is the state after two or more versions have been added.
public static ConcurrentMergeState[] values()
for (ConcurrentMergeState c : ConcurrentMergeState.values()) System.out.println(c);
public static ConcurrentMergeState valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2023 Deltaman Group Ltd. All Rights Reserved.