|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.inria.ns.reflex.util.json.JSONConfiguration
public class JSONConfiguration
Embeds the behaviour of the JSON parser regarding the conformance to JSON (see section 4 in RFC 4627) and convenient options.
| Constructor Summary | |
|---|---|
JSONConfiguration()
|
|
| Method Summary | |
|---|---|
boolean |
areCommentsEnabled()
Indicates whether the comments are enabled or not. |
boolean |
areCommentsIgnored()
Indicates whether the comments are ignored or not. |
boolean |
areNamesUnique()
Indicates whether the parser have to check names uniqueness or not. |
boolean |
areStringNamesStrict()
Indicates whether the parser can process the name of objects as unquoted strings (not strict) or not (strict). |
JSONConfiguration |
disableComments()
Indicates to the parser that the comments are disabled. |
JSONConfiguration |
enableComments(boolean ignore)
Indicates to the parser that the comments are enabled. |
boolean |
hasToTrackPosition()
Indicates whether the parser has to track informations about the position. |
boolean |
isAllowingMissingValues()
Indicates whether the parser has to be tolerant regarding missing values that are expected. |
boolean |
isRootStrict()
Indicates whether the parser can process any item on the root or only a single array or object. |
JSONConfiguration |
setAllowingMissingValues(boolean allowMissingValues)
Indicates whether the parser has to be tolerant regarding missing values that are expected. |
JSONConfiguration |
setNamesUniqueness(boolean uniqueness)
Indicates to the parser whether the names of object items must be unique within the host object or can appear several times. |
JSONConfiguration |
setRootStrictness(boolean strictness)
Indicates to the parser whether the root can be any values or must be a single object or array. |
JSONConfiguration |
setStringNamesStrictness(boolean strictness)
Indicates to the parser whether the name of object items can be unquoted strings (not strict) or must be quoted strings (strict). |
JSONConfiguration |
setTrackability(boolean trackability)
Indicates whether the parser has to track informations about the position. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSONConfiguration()
| Method Detail |
|---|
public JSONConfiguration enableComments(boolean ignore)
ignore - Indicates whether or not the comments have
to be notified to the handler.
JSONFactory#comment(String)public JSONConfiguration disableComments()
JSONExceptionpublic boolean areCommentsEnabled()
Default is false.
true if the parser have to process
comments safely, false if the parser
have to report an error.areCommentsIgnored(),
JSONFactory#comment(String)public boolean areCommentsIgnored()
Default is true.
true if the parser have to process
comments safely, false if the parser
have to ignore them.areCommentsEnabled()(),
JSONFactory#comment(String)public JSONConfiguration setStringNamesStrictness(boolean strictness)
If the names have to be quoted strings and the parser encounter unquoted strings, an error will be reported.
strictness - true if the string names
have to be quoted, false otherwise.
JSONFactory#startItem(String, boolean)public boolean areStringNamesStrict()
Default is true.
true if the names must be quoted,
false otherwise.public JSONConfiguration setNamesUniqueness(boolean uniqueness)
If the names must be unique and the parser encounter several identical names, an error will be reported.
uniqueness - true if the string names
have to be unique, false otherwise.
JSONFactory#startItem(String, boolean)public boolean areNamesUnique()
Default is false.
true if the names must be unique,
false otherwise.public JSONConfiguration setRootStrictness(boolean strictness)
If the root value is neither an array not an object, or if there are several values on the root, and that the parser is configured to be strict, an error will be reported.
strictness - true if the first value
must be a single object or array, false otherwise.
public boolean isRootStrict()
Default is true.
true if the root must be a single JSON array
or JSON object, false otherwise.public JSONConfiguration setTrackability(boolean trackability)
trackability - true to indicate to the
parser that it has to track informations about
the position of the characters read in the source,
false otherwise.
public boolean hasToTrackPosition()
Useful for locating errors.
Default is false.
true if the position
have to be tracked, false
otherwise.public JSONConfiguration setAllowingMissingValues(boolean allowMissingValues)
allowMissingValues - true to indicate to the
parser that it has to be tolerant regarding missing values
false if it has to raise an error.
public boolean isAllowingMissingValues()
Default is false.
true if missing values are
accepted (and discarded) if missing values are rejected.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||