|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.internal.parser.format.json.JsonFieldFormat
public class JsonFieldFormat
A FieldFormat implementation for a field in a JSON formatted record.
| Field Summary |
|---|
| Fields inherited from interface org.beanio.internal.parser.format.json.JsonNode |
|---|
ARRAY, BOOLEAN, NUMBER, OBJECT, STRING |
| Constructor Summary | |
|---|---|
JsonFieldFormat()
Constructs a new JsonFieldFormat. |
|
| Method Summary | |
|---|---|
String |
extract(UnmarshallingContext context,
boolean reportErrors)
Extracts the field text from a record. |
int |
getJsonArrayIndex()
Returns the index of this node in its parent array, or -1 if not applicable (i.e. |
String |
getJsonName()
Returns the JSON field name. |
char |
getJsonType()
Returns the type of node. |
String |
getName()
Returns the field name. |
FieldPadding |
getPadding()
|
int |
getSize()
Returns the size of the field. |
void |
insertField(MarshallingContext context,
String text)
Inserts field text into a record. |
boolean |
insertValue(MarshallingContext context,
Object value)
Inserts a value into a record. |
boolean |
isBypassTypeHandler()
|
boolean |
isJsonArray()
Returns whether this node is a JSON array. |
boolean |
isLazy()
TODO rename isLazy to something better?? Returns whether this field is optionally present in the record. |
boolean |
isNillable()
Returns whether this field is nillable. |
void |
setBypassTypeHandler(boolean bypassTypeHandler)
|
void |
setJsonArray(boolean repeating)
|
void |
setJsonArrayIndex(int jsonArrayIndex)
|
void |
setJsonName(String jsonName)
|
void |
setJsonType(char jsonType)
|
void |
setLazy(boolean lazy)
|
void |
setName(String name)
|
void |
setNillable(boolean nillable)
|
void |
setPadding(FieldPadding padding)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JsonFieldFormat()
| Method Detail |
|---|
public String extract(UnmarshallingContext context,
boolean reportErrors)
FieldFormatMay return Value.INVALID if the field is invalid, or Value.NIL
if the field is explicitly set to nil or null such as in an XML or JSON formatted
stream.
Implementations should also remove any field padding before returning the text.
extract in interface FieldFormatcontext - the UnmarshallingContext holding the record
public boolean insertValue(MarshallingContext context,
Object value)
FieldFormatFieldFormat.insertField(MarshallingContext, String)
is called. If the method returns true, FieldFormat.insertField(MarshallingContext, String)
is not invoked.
insertValue in interface FieldFormatcontext - the MarshallingContextvalue - the value to insert into the record
FieldFormat.insertField(MarshallingContext, String)
must be invoked, false otherwise
public void insertField(MarshallingContext context,
String text)
FieldFormat
insertField in interface FieldFormatcontext - the MarshallingContext holding the recordtext - the field text to insert into the recordpublic String getName()
JsonNode
getName in interface JsonNodepublic void setName(String name)
name - public void setLazy(boolean lazy)
lazy - public int getSize()
FieldFormat
getSize in interface FieldFormatpublic void setNillable(boolean nillable)
nillable - public boolean isNillable()
FieldFormat
isNillable in interface FieldFormatisNillable in interface JsonNodepublic boolean isLazy()
FieldFormat
isLazy in interface FieldFormatpublic void setJsonName(String jsonName)
jsonName - public String getJsonName()
JsonNode
getJsonName in interface JsonNodepublic void setJsonType(char jsonType)
jsonType - public char getJsonType()
JsonNodeJsonNode.isJsonArray() is true, this method
returns the component type of the array.
getJsonType in interface JsonNodepublic void setJsonArray(boolean repeating)
public boolean isJsonArray()
JsonNode
isJsonArray in interface JsonNodepublic int getJsonArrayIndex()
JsonNode
getJsonArrayIndex in interface JsonNodepublic void setJsonArrayIndex(int jsonArrayIndex)
public FieldPadding getPadding()
public void setPadding(FieldPadding padding)
public boolean isBypassTypeHandler()
public void setBypassTypeHandler(boolean bypassTypeHandler)
public String toString()
toString in class Object
|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||