public class MinXMLBuilderJSONBuilder extends JSONBuildCounter implements JSONBuilder<MinXML>
Modifier and Type | Field and Description |
---|---|
protected MinXMLBuilder |
builder |
protected java.lang.String |
field_name |
protected JSONKeywords |
keywords |
Constructor and Description |
---|
MinXMLBuilderJSONBuilder()
A convenience constructor that specialises the translation table to a
standard set of keywords and the MinXML builder to a FlexiMinXML builder.
|
MinXMLBuilderJSONBuilder(MinXMLBuilder builder)
A convenience constructor that specialises the translation table to a
standard set of keywords.
|
MinXMLBuilderJSONBuilder(MinXMLBuilder builder,
JSONKeywords keys)
Creates a JSONBuilder from a MinXML builder and a translation
table.
|
Modifier and Type | Method and Description |
---|---|
void |
addBoolean(boolean value)
This method should be invoked when the parser consumes a
JSON expression 'true' or 'false'.
|
void |
addFloat(double value)
This method should be invoked when the parser consumes a
JSON floating point value.
|
void |
addInteger(java.math.BigInteger value)
This method should preferably be invoked when the parser consumes
a JSON integer value that is too large to fit in a long.
|
void |
addInteger(long value)
This method should be invoked when the parser consumes a
JSON integer value.
|
void |
addNull()
This method should be invoked when the parser consumes a
JSON expression 'null'.
|
void |
addString(java.lang.String value)
This method should be invoked when the parser consumes a
JSON string.
|
MinXML |
build()
This method will return a value representing the JSON tree
consumed so far by the parser.
|
void |
endArray()
This method should be invoked when the parser consumes the
end of an array i.e.
|
void |
endObject()
This method should be invoked when the parser consumes the
end of an object i.e.
|
void |
field(java.lang.String field)
This method should be invoked when the parser consumes the
field name of an object ahead of a ':'.
|
void |
startArray()
This method should be invoked when the parser consumes the
start of an array i.e.
|
void |
startObject()
This method should be invoked when the parser consumes the
start of an object i.e.
|
buildCheck, decrement, increment
protected MinXMLBuilder builder
protected java.lang.String field_name
protected final JSONKeywords keywords
public MinXMLBuilderJSONBuilder()
public MinXMLBuilderJSONBuilder(MinXMLBuilder builder)
builder
- the MinXML builder used to construct the internal treepublic MinXMLBuilderJSONBuilder(MinXMLBuilder builder, JSONKeywords keys)
builder
- the MinXML builder used to construct the internal treekeys
- the set of strings to embed in the final MinXMLpublic void addNull()
JSONBuilder
addNull
in interface JSONBuilder<MinXML>
public void addBoolean(boolean value)
JSONBuilder
addBoolean
in interface JSONBuilder<MinXML>
value
- true if the expression was 'true', else false.public void addInteger(long value)
JSONBuilder
addInteger
in interface JSONBuilder<MinXML>
value
- the integer value as a signed 64-bit integer.public void addInteger(java.math.BigInteger value)
JSONBuilder
addInteger
in interface JSONBuilder<MinXML>
value
- the value as a big-integerpublic void addFloat(double value)
JSONBuilder
addFloat
in interface JSONBuilder<MinXML>
value
- the floating point valuepublic void addString(java.lang.String value)
JSONBuilder
addString
in interface JSONBuilder<MinXML>
value
- the stringpublic void startArray()
JSONBuilder
startArray
in interface JSONBuilder<MinXML>
public void endArray()
JSONBuilder
endArray
in interface JSONBuilder<MinXML>
public void field(java.lang.String field)
JSONBuilder
field
in interface JSONBuilder<MinXML>
field
- name of the fieldpublic void startObject()
JSONBuilder
startObject
in interface JSONBuilder<MinXML>
public void endObject()
JSONBuilder
endObject
in interface JSONBuilder<MinXML>
public MinXML build()
JSONBuilder
JSONBuildFailedException
.build
in interface JSONBuilder<MinXML>