|
ModeShape Distribution 3.0.0.CR1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.schematic.internal.document.JsonReader.Parser
@NotThreadSafe public static class JsonReader.Parser
The component that parses a tokenized JSON stream.
| Nested Class Summary | |
|---|---|
protected static class |
JsonReader.Parser.FunctionCall
|
protected static class |
JsonReader.Parser.FunctionParameter
|
| Constructor Summary | |
|---|---|
JsonReader.Parser(JsonReader.Tokenizer tokenizer,
DocumentValueFactory values,
JsonReader.ValueMatcher valueMatcher)
Create a new JsonReader that uses the supplied JsonReader.Tokenizer instance. |
|
| Method Summary | |
|---|---|
Object |
evaluateFunction(JsonReader.Parser.FunctionCall function)
Method that is called to evaluate the supplied function. |
protected Object |
evaluateUnknownFunction(JsonReader.Parser.FunctionCall function)
Method that is called when the function call described by the parameter could not be evaluated. |
protected boolean |
isReservedFieldName(String fieldName)
|
protected BasicDocument |
newDocument()
|
BasicArray |
parseArray()
Parse the JSON array on the stream, beginning with the '[' character until the ']' character, which is consumed. |
Document |
parseDocument()
Parse the stream for the next JSON document. |
protected Document |
parseDocument(AtomicBoolean hasReservedFieldNames)
Parse the stream for the next JSON document. |
Object |
parseFunction()
Parse a function call on the stream. |
protected Number |
parseNumber(String value)
Parse the number represented by the supplied value. |
protected Object |
parseUnknownValue(String value,
int lineNumber,
int columnNumber)
Override this method if custom value types are expected. |
Object |
parseValue()
Parse the stream for the next field value, which can be one of the following values: a nested document an array of values a string literal, surrounded by single-quote characters a string literal, surrounded by double-quote characters a string literal date of the form "yyyy-MM-ddTHH:mm:ss"
where T is a literal character
a string literal date of the form "yyyy-MM-ddTHH:mm:ssZ"
where T and Z are literal characters
a string literal date of the form
"yyyy-MM-ddTHH:mm:ssGMT+00:00" where
T, and GMT are literal characters
a string literal date of the form "/Date(millisOrIso)/"
a string literal date of the form "\/Date(millisOrIso)\/"
a date literal of the form new Date(millisOrIso)
a date literal of the form Date(millisOrIso)
a function of the form new functionName(parameters) where parameters
consists of one or more values as parsed by this method
Note that in the date forms listed above, millisOrIso is either a long value representing the
number of milliseconds since epoch or a string literal in ISO-8601 format representing a date and time. |
Object |
parseValue(String value,
int lineNumber,
int columnNumber)
Parse the value given by the supplied string located at the supplied line and column numbers. |
protected Object |
processDocumentWithReservedFieldNames(Document doc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonReader.Parser(JsonReader.Tokenizer tokenizer,
DocumentValueFactory values,
JsonReader.ValueMatcher valueMatcher)
JsonReader.Tokenizer instance.
tokenizer - the tokenizer that tokenizes the stream of JSON content; may not be nullvalues - the factory for creating value objects; may not be nullvalueMatcher - the component that looks for patterns within string values to create alternative objects; may not
be null| Method Detail |
|---|
public Document parseDocument()
throws ParsingException
ParsingException - if there is a problem parsing the valueprotected BasicDocument newDocument()
protected Document parseDocument(AtomicBoolean hasReservedFieldNames)
throws ParsingException
hasReservedFieldNames - the flag that should be set if this document contains field names that are reserved
ParsingException - if there is a problem parsing the valueprotected final boolean isReservedFieldName(String fieldName)
public BasicArray parseArray()
throws ParsingException
ParsingException - if there is a problem parsing the value
public Object parseValue()
throws ParsingException
"yyyy-MM-ddTHH:mm:ss"
where T is a literal character"yyyy-MM-ddTHH:mm:ssZ"
where T and Z are literal characters"yyyy-MM-ddTHH:mm:ssGMT+00:00" where
T, and GMT are literal characters"/Date(millisOrIso)/""\/Date(millisOrIso)\/"new Date(millisOrIso)Date(millisOrIso)new functionName(parameters) where parameters
consists of one or more values as parsed by this method
millisOrIso is either a long value representing the
number of milliseconds since epoch or a string literal in ISO-8601 format representing a date and time.
ParsingException - if there is a problem parsing the value
public Object parseValue(String value,
int lineNumber,
int columnNumber)
throws ParsingException
parseUnknownValue(String, int, int).
value - the string representation of the valuelineNumber - the line number for the beginning of the valuecolumnNumber - the column number for the beginning of the value
ParsingException - if there is a problem parsing the valueprotected Number parseNumber(String value)
parseValue(String, int, int)
method.
value - the string representation of the value
protected Object parseUnknownValue(String value,
int lineNumber,
int columnNumber)
throws ParsingException
value - the string representation of the valuelineNumber - the line number at which the value startscolumnNumber - the column number at which the value starts
ParsingException - if there is a problem parsing the value
public Object parseFunction()
throws ParsingException
ParsingException - if there is a problem parsing the value
public Object evaluateFunction(JsonReader.Parser.FunctionCall function)
throws ParsingException
function - the function definition
ParsingException - if there is a problem parsing the value
protected Object evaluateUnknownFunction(JsonReader.Parser.FunctionCall function)
throws ParsingException
function - the function definition
ParsingException - if there is a problem parsing the valueprotected Object processDocumentWithReservedFieldNames(Document doc)
|
ModeShape Distribution 3.0.0.CR1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||