|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openexi.proc.common.GrammarOptions
public final class GrammarOptions
GrammarOptions computes a short integer that represents settings in the EXI Grammar settings
that determine how an EXI file will be encoded or decoded.
Values are set using binary switch values (represented as short integers).
If no options have been set, the value is 0 (this is an temporary internal
value, rather than a valid setting).
If an XSD is available, and the file to be processed is 100% compatible with the XSD, choosing
STRICT_OPTIONS (1) provides the best performance. No other options can be set
when files are encoded or decoded in strict mode.
The DEFAULT_OPTIONS setting is 2. The following table lists all of the options and their values.
Constant | Value |
---|---|
STRICT_OPTIONS | 1 |
DEFAULT_OPTIONS | 2 |
ADD_NS | 4 |
ADD_SC | N/A* |
ADD_DTD | 16 |
ADD_CM | 32 |
ADD_PI | 64 |
*The self-contained option is not supported in this release. |
GrammarCache gc = new GrammarCache((EXISchema)null,98);Be careful to use the correct numeric value, to avoid unexpected results.
Field Summary | |
---|---|
static short |
DEFAULT_OPTIONS
Indicates that undeclared elements and attributes will be processed when the XML stream is encoded and decoded. |
static short |
OPTIONS_UNUSED
OPTIONS_UNUSED is an internal value. |
static short |
STRICT_OPTIONS
Indicates that undeclared elements and attributes will throw an exception when the XML stream is encoded and decoded. |
Method Summary | |
---|---|
static short |
addCM(short options)
Sets Preserve Comments to true. |
static short |
addDTD(short options)
Sets Preserve Document Type Definition to true. |
static short |
addNS(short options)
Sets Preserve Namespaces to true. |
static short |
addPI(short options)
Sets Preserve Processing Instructions to true. |
static boolean |
hasCM(short options)
Returns true if Preserve Comments is true. |
static boolean |
hasDTD(short options)
Returns true if Preserve Document Type Definition is true. |
static boolean |
hasNS(short options)
Returns true if Preserve Namespaces is true. |
static boolean |
hasPI(short options)
Returns true if Preserve Processing Instructions is true. |
static boolean |
isPermitDeviation(short options)
Returns true if DEFAULT_OPTIONS is set to true. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short OPTIONS_UNUSED
public static final short DEFAULT_OPTIONS
public static final short STRICT_OPTIONS
Method Detail |
---|
public static boolean isPermitDeviation(short options)
public static boolean hasNS(short options)
public static boolean hasDTD(short options)
public static boolean hasCM(short options)
public static boolean hasPI(short options)
public static short addNS(short options)
public static short addDTD(short options)
public static short addCM(short options)
public static short addPI(short options)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |