BeanIO 1.2.3

org.beanio.parser.xml
Class XmlBeanDefinition

java.lang.Object
  extended by org.beanio.parser.PropertyDefinition
      extended by org.beanio.parser.BeanDefinition
          extended by org.beanio.parser.xml.XmlBeanDefinition
All Implemented Interfaces:
XmlNode

public class XmlBeanDefinition
extends BeanDefinition
implements XmlNode

A bean definition implementation for XML formatted streams.

Since:
1.1
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.parser.PropertyDefinition
INVALID, MISSING
 
Constructor Summary
XmlBeanDefinition()
           
 
Method Summary
 Object formatRecord(Node parent, Object bean)
          Formats a bean object into a XML DOM tree, with support for collection type beans.
 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).
 XmlDefinition getXmlDefinition()
          Returns the XML attributes that define this node.
 boolean isBeanExistenceKnown()
          Returns true if a bean is known to exist before parsing its child fields.
 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.
 
Methods inherited from class org.beanio.parser.BeanDefinition
addProperty, defines, getAllFields, getBeanProperty, getProperty, getPropertyCount, getPropertyList, isBean, isDefinitionFor, isPropertyTypeMap, isRecordIdentifer, setBeanProperty, setPropertyList, setPropertyType, setRecordIdentifer
 
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

XmlBeanDefinition

public XmlBeanDefinition()
Method Detail

matches

public boolean matches(Record record)
Description copied from class: BeanDefinition
Test if a record matches this record definition.

Overrides:
matches in class BeanDefinition
Parameters:
record - the record to test
Returns:
true if all key fields are matched by this record

parsePropertyValue

protected Object parsePropertyValue(Record record)
                             throws InvalidRecordException
Description copied from class: BeanDefinition
Validates and parses a record into a Java bean.

Overrides:
parsePropertyValue in class BeanDefinition
Parameters:
record - the record to parse
Returns:
the parsed Java bean
Throws:
InvalidRecordException

isBeanExistenceKnown

public boolean isBeanExistenceKnown()
Description copied from class: BeanDefinition
Returns true if a bean is known to exist before parsing its child fields. If false is returned, at least one bean field must exist in the stream before the bean is created.

Overrides:
isBeanExistenceKnown in class BeanDefinition
Returns:
true if a bean is known to exist before parsing its fields

formatRecord

public Object formatRecord(Object bean)
Description copied from class: BeanDefinition
Formats a Java bean into a record (whose class type will depend on the type of stream and record writer being used).

Specified by:
formatRecord in class BeanDefinition
Parameters:
bean - the bean to format
Returns:
the formatted record

formatRecord

public Object formatRecord(Node parent,
                           Object bean)
Formats a bean object into a XML DOM tree, with support for collection type beans.

Parameters:
parent - the parent DOM element to append
bean - the bean object

getXmlDefinition

public XmlDefinition getXmlDefinition()
Description copied from interface: XmlNode
Returns the XML attributes that define this node.

Specified by:
getXmlDefinition in interface XmlNode
Returns:
the XML attribute definition

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim