| 
 | BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.internal.util.TreeNode<Component>
org.beanio.internal.parser.Component
org.beanio.internal.parser.PropertyComponent
org.beanio.internal.parser.Bean
public class Bean
A component used to aggregate Property's into a bean object, which
 may also be a property of a parent bean object itself. 
 
 
A bean may only have children that implement Property.
| Field Summary | 
|---|
| Fields inherited from class org.beanio.internal.parser.PropertyComponent | 
|---|
| createMissingBeans | 
| Fields inherited from interface org.beanio.internal.parser.Property | 
|---|
| AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE | 
| Constructor Summary | |
|---|---|
| Bean()Constructs a new Bean. | |
| Method Summary | |
|---|---|
|  void | clearValue(ParsingContext context)Clears the property value. | 
|  Object | createValue(ParsingContext context)Creates the property value and returns it. | 
|  boolean | defines(Object bean) | 
|  Constructor<?> | getConstructor()Returns the Constructorused to instantiate this bean object, or null
 if the default no-arg constructor is used. | 
|  Object | getValue(ParsingContext context)Returns the value of this property. | 
|  boolean | isLazy() | 
| protected  boolean | isMap()Returns whether the bean object implements Map. | 
| protected  boolean | isSupportedChild(Component child)Returns whether a node is a supported child of this node. | 
| protected  Object | newInstance(ParsingContext context)Creates a new instance of this bean object. | 
|  void | registerLocals(Set<ParserLocal<?>> locals)Called by a stream to register variables stored in the parsing context. | 
|  void | setConstructor(Constructor<?> constructor)Sets the Constructorused to instantiate this bean object. | 
|  void | setLazy(boolean lazy) | 
|  void | setRequired(boolean required)Sets whether this property should always be instantiated when Property.createValue(ParsingContext)is invoked. | 
|  void | setValue(ParsingContext context,
         Object value)Sets the property value (before marshalling). | 
|  int | type()Returns the property type. | 
| Methods inherited from class org.beanio.internal.parser.PropertyComponent | 
|---|
| getAccessor, getType, isIdentifier, isRequired, setAccessor, setIdentifier, setType, toParamString | 
| Methods inherited from class org.beanio.internal.util.TreeNode | 
|---|
| add, clone, find, getChildren, getFirst, getName, iterator, print, setName, size, sort, toString, updateReferences | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.beanio.internal.parser.Property | 
|---|
| getAccessor, getName, getType, isIdentifier, setAccessor, setIdentifier, setType | 
| Constructor Detail | 
|---|
public Bean()
| Method Detail | 
|---|
public void clearValue(ParsingContext context)
PropertyProperty.getValue(ParsingContext) should
 return null, or Value.MISSING for lazy property values.
clearValue in interface Propertycontext - the ParsingContextpublic boolean defines(Object bean)
defines in interface Propertypublic Object createValue(ParsingContext context)
Property
createValue in interface Propertycontext - the ParsingContext
public Object getValue(ParsingContext context)
PropertyWhen unmarshalling, this method should return Value.MISSING if the field
 was not present in the stream.  Or if present, but has no value, null should be returned.  
 
 
When marshalling, this method should return Value.MISSING for any optional
 segment bound to a bean object, or null if required.  Null field properties should 
 always return Value.MISSING.
getValue in interface Propertycontext - the ParsingContext
Value.MISSING if not present in the stream,
   or Value.INVALID if the field was invalid
public void setValue(ParsingContext context,
                     Object value)
Property
setValue in interface Propertycontext - the ParsingContextvalue - the property valueprotected Object newInstance(ParsingContext context)
context - the ParsingContext
protected boolean isSupportedChild(Component child)
TreeNodeTreeNode.add(TreeNode).
isSupportedChild in class PropertyComponentchild - the node to test
public void setRequired(boolean required)
PropertyComponentProperty.createValue(ParsingContext) is invoked.
setRequired in class PropertyComponentrequired - true to always instantiate this property, false otherwisepublic int type()
Property
type in interface PropertyProperty.SIMPLE, Property.COMPLEX, Property.AGGREGATION_ARRAY, Property.COLLECTION, 
   Property.AGGREGATION_COLLECTION, or Property.MAPprotected boolean isMap()
Map.
Map, false otherwisepublic Constructor<?> getConstructor()
Constructor used to instantiate this bean object, or null
 if the default no-arg constructor is used.
Constructorpublic void setConstructor(Constructor<?> constructor)
Constructor used to instantiate this bean object.
constructor - the Constructorpublic void registerLocals(Set<ParserLocal<?>> locals)
Component
registerLocals in class Componentlocals - set of local variablespublic boolean isLazy()
public void setLazy(boolean lazy)
| 
 | BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||