|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.internal.util.TreeNode<Component> org.beanio.internal.parser.Component org.beanio.internal.parser.PropertyComponent org.beanio.internal.parser.CollectionBean
public class CollectionBean
A Property
that stores children in a Collection
.
If a child property is missing or null, null is added to the collection.
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 | |
---|---|
CollectionBean()
Constructs a new CollectionBean. |
Method Summary | |
---|---|
void |
clearValue(ParsingContext context)
Clears the property value. |
Object |
createValue(ParsingContext context)
Creates the property value and returns it. |
boolean |
defines(Object value)
|
Object |
getValue(ParsingContext context)
Returns the value of this property. |
protected Object |
newInstance()
Creates a new instance of this bean object. |
void |
registerLocals(Set<ParserLocal<? extends Object>> locals)
Called by a stream to register variables stored in the parsing context. |
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, isSupportedChild, setAccessor, setIdentifier, setRequired, 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 CollectionBean()
Method Detail |
---|
public int type()
Property
type
in interface Property
Property.SIMPLE
, Property.COMPLEX
, Property.AGGREGATION_ARRAY
, Property.COLLECTION
,
Property.AGGREGATION_COLLECTION
, or Property.MAP
public void clearValue(ParsingContext context)
Property
Property.getValue(ParsingContext)
should
return null, or Value.MISSING
for lazy property values.
clearValue
in interface Property
context
- the ParsingContext
public Object createValue(ParsingContext context)
Property
createValue
in interface Property
context
- the ParsingContext
public Object getValue(ParsingContext context)
Property
When 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 Property
context
- the ParsingContext
Value.MISSING
if not present in the stream,
or Value.INVALID
if the field was invalidpublic void setValue(ParsingContext context, Object value)
Property
setValue
in interface Property
context
- the ParsingContext
value
- the property valuepublic boolean defines(Object value)
defines
in interface Property
protected Object newInstance()
public void registerLocals(Set<ParserLocal<? extends Object>> locals)
Component
registerLocals
in class Component
locals
- set of local variables
|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |