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.
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 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 the first version.
|
Modifier and Type | Method and Description |
---|---|
static SequentialMergeState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SequentialMergeState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SequentialMergeState INITIAL
This is the state after initializing a merge object.
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.
public static final SequentialMergeState STARTED
This is the state after setting the first version.
public static final SequentialMergeState EXTRACTABLE
This is the state after two or more versions have been added.
public static SequentialMergeState[] values()
for (SequentialMergeState c : SequentialMergeState.values()) System.out.println(c);
public static SequentialMergeState 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.