|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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)
FieldFormat
May 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 FieldFormat
context
- the UnmarshallingContext
holding the record
public boolean insertValue(MarshallingContext context, Object value)
FieldFormat
FieldFormat.insertField(MarshallingContext, String)
is called. If the method returns true, FieldFormat.insertField(MarshallingContext, String)
is not invoked.
insertValue
in interface FieldFormat
context
- the MarshallingContext
value
- the value to insert into the record
FieldFormat.insertField(MarshallingContext, String)
must be invoked, false otherwisepublic void insertField(MarshallingContext context, String text)
FieldFormat
insertField
in interface FieldFormat
context
- the MarshallingContext
holding the recordtext
- the field text to insert into the recordpublic String getName()
JsonNode
getName
in interface JsonNode
public void setName(String name)
name
- public void setLazy(boolean lazy)
lazy
- public int getSize()
FieldFormat
getSize
in interface FieldFormat
public void setNillable(boolean nillable)
nillable
- public boolean isNillable()
FieldFormat
isNillable
in interface FieldFormat
isNillable
in interface JsonNode
public boolean isLazy()
FieldFormat
isLazy
in interface FieldFormat
public void setJsonName(String jsonName)
jsonName
- public String getJsonName()
JsonNode
getJsonName
in interface JsonNode
public void setJsonType(char jsonType)
jsonType
- public char getJsonType()
JsonNode
JsonNode.isJsonArray()
is true, this method
returns the component type of the array.
getJsonType
in interface JsonNode
public void setJsonArray(boolean repeating)
public boolean isJsonArray()
JsonNode
isJsonArray
in interface JsonNode
public int getJsonArrayIndex()
JsonNode
getJsonArrayIndex
in interface JsonNode
public 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 |