Class TransformedHeader
- java.lang.Object
-
- com.univocity.parsers.annotations.helpers.TransformedHeader
-
public class TransformedHeader extends java.lang.Object
A pair associating a Field of an annotated class to an optionalHeaderTransformer
obtained fromNested.headerTransformer()
when nested classes are used to process beans.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Field
field
private int
index
private java.lang.reflect.Method
method
private java.lang.reflect.AnnotatedElement
target
private HeaderTransformer
transformer
-
Constructor Summary
Constructors Constructor Description TransformedHeader(java.lang.reflect.AnnotatedElement target, HeaderTransformer transformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
describe()
int
getHeaderIndex()
Returns the index that determines which column the current field represents, as specified byParsed.index()
java.lang.String
getHeaderName()
Returns the name to be used as a header based on a given field and itsParsed
annotation.java.lang.reflect.AnnotatedElement
getTarget()
Returns theAnnotatedElement
used to read/write values from/to.java.lang.String
getTargetName()
Returns the original attribute name of the field in its containing class.boolean
isReadOly()
Returnstrue
if thisAnnotatedElement
is aMethod
with no parameters and a return type which can only be used for reading values from the java bean.boolean
isWriteOnly()
Returnstrue
if thisAnnotatedElement
is aMethod
with parameters and can only be used for writing values into the java bean.
-
-
-
Field Detail
-
target
private final java.lang.reflect.AnnotatedElement target
-
field
private final java.lang.reflect.Field field
-
method
private final java.lang.reflect.Method method
-
transformer
private final HeaderTransformer transformer
-
index
private int index
-
-
Constructor Detail
-
TransformedHeader
public TransformedHeader(java.lang.reflect.AnnotatedElement target, HeaderTransformer transformer)
-
-
Method Detail
-
getHeaderName
public java.lang.String getHeaderName()
Returns the name to be used as a header based on a given field and itsParsed
annotation.- Returns:
- the header name to be used for the given field.
-
getHeaderIndex
public int getHeaderIndex()
Returns the index that determines which column the current field represents, as specified byParsed.index()
- Returns:
- the current header index.
-
getTargetName
public java.lang.String getTargetName()
Returns the original attribute name of the field in its containing class.- Returns:
- the original attribute name of the field
-
getTarget
public java.lang.reflect.AnnotatedElement getTarget()
Returns theAnnotatedElement
used to read/write values from/to.- Returns:
- the field or method being manipulated by the parser/writer when processing java beans
-
isWriteOnly
public boolean isWriteOnly()
Returnstrue
if thisAnnotatedElement
is aMethod
with parameters and can only be used for writing values into the java bean.- Returns:
- a flag indicating whether this is a method that allows writing values only.
-
isReadOly
public boolean isReadOly()
Returnstrue
if thisAnnotatedElement
is aMethod
with no parameters and a return type which can only be used for reading values from the java bean.- Returns:
- a flag indicating whether this is a method that allows reading values only.
-
describe
public java.lang.String describe()
-
-