public interface OdinRowReader
Modifier and Type | Method and Description |
---|---|
boolean |
hasRowNext()
Get if there is any remaining value inside the current row, this method simply test if a ':' separator if found on the stream before any other elements.
|
<T> T |
take()
Read value from the current object without any generic type, if no type definition is present before the value in the stream a simple Class<Object> is used as type, so only
null, primitives, Object, Object[] or recursive object can be return.
If a type definition is present the reader will use it |
boolean |
takeBoolean()
Read next element as a boolean
|
byte |
takeByte()
Read next element as a byte
|
char |
takeChar()
Read next element as a char
|
double |
takeDouble()
Read next element as a double
|
float |
takeFloat()
Read next element as a float
|
int |
takeInt()
Read next element as a int
|
long |
takeLong()
Read next element as a long
|
short |
takeShort()
Read next element as a short
|
java.lang.String |
takeString()
Read next element as a String
|
void |
takeSubContent(IOConsumer<OdinReader> subReader)
Use a consumer to read content of a sub object.
|
<T> T |
takeTo(T o)
Read value to a given object instance, if a type definition is present in the input stream it will be skip to use the given instance type.
This method is not recursive, so all object fields are set with a new object instances according to the stream content. If the object is null this method do the same as take() .If the field is a primitive, this method return his new value. If the object use a inline or a immutable adapter, this method return a new object instance |
<T> T |
takeTo(T o,
AnyType<T> type)
Read value to a given object instance, if a type definition is present in the input stream it will be skip to use the given instance type.
This method is not recursive, so all object fields are set with a new object instances according to the stream content. If the object is null this method do the same as takeTyped(AnyType) and use the given type.If the field is a primitive, this method return his new value. If the object use a inline or a immutable adapter, this method return a new object instance. |
<T> T |
takeTo(T o,
java.lang.reflect.Type type)
Read value to a given object instance, if a type definition is present in the input stream it will be skip to use the given instance type.
This method is not recursive, so all object fields are set with a new object instances according to the stream content. If the object is null this method do the same as takeTyped(Type) and use the given type.If the field is a primitive, this method return his new value. If the object use a inline or a immutable adapter, this method return a new object instance. |
<T> T |
takeTyped(AnyType<T> type)
Read value using given generic type, if a type definition is present it will be used as object type.
This method take a odin type to be use inside adapter by using ObjectType.getField(String) or all other field getter and
TypeField.getType() |
<T> T |
takeTyped(java.lang.reflect.Type type)
Read value using given generic type, if a type definition is present it will be used as object type.
Custom type can be created to add generic argument ( can be useful for collection ) using TypeBuilder . |
boolean hasRowNext() throws java.io.IOException
java.io.IOException
- if an IO exception occurboolean takeBoolean() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid booleanbyte takeByte() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid numbershort takeShort() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid numberint takeInt() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid numberlong takeLong() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid numberfloat takeFloat() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid numberdouble takeDouble() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid numberchar takeChar() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid charjava.lang.String takeString() throws java.io.IOException
java.io.IOException
- if an IO exception occurOdinFormatException
- if next element was not a valid String<T> T take() throws java.io.IOException
T
- object typejava.io.IOException
- if an IO exception occurOdinFormatException
- if the reader reach an invalid element delimiter or wrong element formatOdinTypeException
- if the type adapter can not be build for an objectOdinAdapterException
- if a runtime exception is throw by an adapter when reading the object<T> T takeTo(T o) throws java.io.IOException
take()
.T
- object typeo
- object instancejava.io.IOException
- if an IO exception occurOdinFormatException
- if the reader reach an invalid element delimiter or wrong element formatOdinTypeException
- if the type adapter can not be build for an objectOdinAdapterException
- if a runtime exception is throw by an adapter when reading the object<T> T takeTo(T o, AnyType<T> type) throws java.io.IOException
takeTyped(AnyType)
and use the given type.takeTo(Object)
by his security for null object case, if the given object is null and the input stream doesn't contains the type definition, the given type is
used instead of Object classT
- object typeo
- object instancetype
- object typejava.io.IOException
- if an IO exception occurOdinFormatException
- if the reader reach an invalid element delimiter or wrong element formatOdinTypeException
- if the type adapter can not be build for an objectOdinAdapterException
- if a runtime exception is throw by an adapter when reading the object<T> T takeTo(T o, java.lang.reflect.Type type) throws java.io.IOException
takeTyped(Type)
and use the given type.takeTo(Object)
by his security for null object case, if the given object is null and the input stream doesn't contains the type definition, the given type is
used instead of Object classT
- object typeo
- object instancetype
- object typejava.io.IOException
- if an IO exception occurOdinFormatException
- if the reader reach an invalid element delimiter or wrong element formatOdinTypeException
- if the type adapter can not be build for an objectOdinAdapterException
- if a runtime exception is throw by an adapter when reading the object<T> T takeTyped(AnyType<T> type) throws java.io.IOException
ObjectType.getField(String)
or all other field getter and
TypeField.getType()
T
- object typetype
- generic typejava.io.IOException
- if an IO exception occurOdinFormatException
- if the reader reach an invalid element delimiter or wrong element formatOdinTypeException
- if the type adapter can not be build for an objectOdinAdapterException
- if a runtime exception is throw by an adapter when reading the object<T> T takeTyped(java.lang.reflect.Type type) throws java.io.IOException
TypeBuilder
.T
- object typetype
- generic typejava.io.IOException
- if an IO exception occurOdinFormatException
- if the reader reach an invalid element delimiter or wrong element formatOdinTypeException
- if the type adapter can not be build for an objectOdinAdapterException
- if a runtime exception is throw by an adapter when reading the objectvoid takeSubContent(IOConsumer<OdinReader> subReader) throws java.io.IOException
subReader
- the sub reader consumerjava.io.IOException
- if an IO exception occur