|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.parser.PropertyDefinition org.beanio.parser.BeanDefinition
public abstract class BeanDefinition
Property definition that defines a bean class and holds its own list of properties for setting on the bean class.
Field Summary |
---|
Fields inherited from class org.beanio.parser.PropertyDefinition |
---|
INVALID, MISSING |
Constructor Summary | |
---|---|
BeanDefinition()
Creates a new BeanDefinition. |
Method Summary | |
---|---|
void |
addProperty(PropertyDefinition f)
Adds a property definition to this bean definition. |
boolean |
defines(Object bean)
Tests whether this definition is used to map the given bean or property value. |
abstract Object |
formatRecord(Object bean)
Formats a Java bean into a record (whose class type will depend on the type of stream and record writer being used). |
List<FieldDefinition> |
getAllFields()
Returns a list of all field definition descendants of this bean. |
Object |
getBeanProperty(PropertyDefinition definition,
Object bean)
Retrieves a property from a bean object created by this definition. |
PropertyDefinition |
getProperty(int index)
Returns the property definition. |
int |
getPropertyCount()
Returns the number of properties that make up this bean. |
List<PropertyDefinition> |
getPropertyList()
Returns the list of properties that make up this bean. |
boolean |
isBean()
Returns true indicating this property definition defines a bean object. |
boolean |
isBeanExistenceKnown()
Returns true if a bean is known to exist before parsing its child fields. |
boolean |
isDefinitionFor(Object bean)
Deprecated. use defines(Object) |
boolean |
isPropertyTypeMap()
Returns true if the property type of this bean object is assignable to java.util.Map. |
boolean |
isRecordIdentifer()
Deprecated. use PropertyDefinition.isRecordIdentifier() |
boolean |
matches(Record record)
Test if a record matches this record definition. |
protected Object |
parsePropertyValue(Record record)
Validates and parses a record into a Java bean. |
void |
setBeanProperty(PropertyDefinition property,
Object bean,
Object value)
Sets a property on a bean object created by this definition. |
void |
setPropertyList(List<PropertyDefinition> list)
Sets the list of properties that make up this bean. |
void |
setPropertyType(Class<?> type)
Sets the property type of this bean, or if this bean is a collection, the property type of the collection value. |
void |
setRecordIdentifer(boolean recordIdentifer)
Deprecated. use PropertyDefinition.setRecordIdentifier(boolean) |
Methods inherited from class org.beanio.parser.PropertyDefinition |
---|
getCollectionType, getLength, getMaxOccurs, getMinOccurs, getName, getParent, getPropertyDescriptor, getPropertyType, isArray, isCollection, isConstant, isField, isLazy, isProperty, isRecordIdentifier, parseValue, setCollectionType, setLazy, setLength, setMaxOccurs, setMinOccurs, setName, setParent, setProperty, setPropertyDescriptor, setRecordIdentifier |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanDefinition()
Method Detail |
---|
public final boolean isBean()
isBean
in class PropertyDefinition
public boolean matches(Record record)
matches
in class PropertyDefinition
record
- the record to test
protected Object parsePropertyValue(Record record) throws InvalidRecordException
parsePropertyValue
in class PropertyDefinition
record
- the record to parse
InvalidRecordException
public boolean isBeanExistenceKnown()
public void setBeanProperty(PropertyDefinition property, Object bean, Object value)
property
- the property definitionbean
- the bean to set the property onvalue
- the property value to setpublic Object getBeanProperty(PropertyDefinition definition, Object bean)
definition
- the property definitionbean
- the bean to get the property from
public boolean defines(Object bean)
PropertyDefinition
defines
in class PropertyDefinition
bean
- the bean or property value to test
public boolean isDefinitionFor(Object bean)
defines(Object)
bean
- the bean object to test
public List<FieldDefinition> getAllFields()
public abstract Object formatRecord(Object bean)
bean
- the bean to format
public void addProperty(PropertyDefinition f)
f
- the property definition to addpublic PropertyDefinition getProperty(int index)
index
- the index of the property definition
IndexOutOfBoundsException
- if there is no property definition for the
given indexpublic List<PropertyDefinition> getPropertyList()
public int getPropertyCount()
public void setPropertyList(List<PropertyDefinition> list)
list
- the list of properties that make up this beanpublic void setPropertyType(Class<?> type)
setPropertyType
in class PropertyDefinition
type
- the property type of this beanpublic boolean isPropertyTypeMap()
public boolean isRecordIdentifer()
PropertyDefinition.isRecordIdentifier()
public void setRecordIdentifer(boolean recordIdentifer)
PropertyDefinition.setRecordIdentifier(boolean)
recordIdentifer
- true if any field descendant of this bean
definition is used to identify the record
|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |