liquibase.util.csv.opencsv.bean
Class BeanField

java.lang.Object
  extended by liquibase.util.csv.opencsv.bean.BeanField

public class BeanField
extends Object

Used to extend the Field class to add a required flag. This flag determines if the field has to have information, or in the case of the String class cannot be an empty String.


Constructor Summary
BeanField(Field field, boolean required)
           
 
Method Summary
 Field getField()
           
 boolean isRequired()
           
<T> void
setFieldValue(T bean, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanField

public BeanField(Field field,
                 boolean required)
Parameters:
field - - A java.lang.reflect.Field object.
required - - true if the field is required to contain a value, false if it is allowed to be null or blank String.
Method Detail

getField

public Field getField()
Returns:
- a field object
See Also:
Field

isRequired

public boolean isRequired()
Returns:
- true if the field is required to be set (cannot be null or empty string), false otherwise.

setFieldValue

public <T> void setFieldValue(T bean,
                              String value)
                   throws IllegalAccessException
Type Parameters:
T - - Type of the bean.
Parameters:
bean - - Object containing the field to be set.
value - - String containing the value to set the field to.
Throws:
IllegalAccessException - - Thrown on reflection error.


Copyright © 2016 Liquibase.org. All rights reserved.