Package org.beanio.internal.parser
Class RecordCollection
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Iterable<Component>
,Parser
,Property
,Selector
,Replicateable
- Direct Known Subclasses:
RecordArray
public class RecordCollection extends RecordAggregation
AParser
tree component for parsing a collection of bean objects, where a bean object is mapped to aRecord
orGroup
.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class org.beanio.internal.parser.RecordAggregation
lazy, value
-
Fields inherited from interface org.beanio.internal.parser.Property
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE
-
-
Constructor Summary
Constructors Constructor Description RecordCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<java.lang.Object>
getCollection(ParsingContext context)
Returns the collection value being parsed.boolean
hasContent(ParsingContext context)
Returns whether this parser or any of its descendant have content for marshalling.boolean
marshal(MarshallingContext context)
Marshals a record.void
setValue(ParsingContext context, java.lang.Object value)
Sets the property value for marshaling.int
type()
Returns the property type.boolean
unmarshal(UnmarshallingContext context)
Unmarshals a record.-
Methods inherited from class org.beanio.internal.parser.RecordAggregation
clearValue, close, createAggregationType, createValue, defines, getAccessor, getCount, getMaxOccurs, getMinOccurs, getNullValue, getOrder, getProperty, getSelector, getType, getValue, isIdentifier, isLazy, isMaxOccursReached, isRecordGroup, isSupportedChild, matchAny, matchNext, matchNext, registerLocals, reset, restoreState, setAccessor, setCount, setIdentifier, setLazy, setType, skip, toParamString, updateState
-
Methods inherited from class org.beanio.internal.parser.DelegatingParser
getParser, getSize, isOptional, matches
-
Methods inherited from class org.beanio.internal.util.TreeNode
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, 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.Parser
getName, getSize, isOptional, matches
-
-
-
-
Method Detail
-
unmarshal
public boolean unmarshal(UnmarshallingContext context)
Description copied from interface:Parser
Unmarshals a record.- Specified by:
unmarshal
in interfaceParser
- Overrides:
unmarshal
in classDelegatingParser
- Parameters:
context
- theUnmarshallingContext
- Returns:
true
if this component was present in the unmarshalled record, orfalse
otherwise
-
marshal
public boolean marshal(MarshallingContext context) throws java.io.IOException
Description copied from interface:Parser
Marshals a record.- Specified by:
marshal
in interfaceParser
- Overrides:
marshal
in classDelegatingParser
- Parameters:
context
- theMarshallingContext
- Returns:
- whether a value was marshalled
- Throws:
java.io.IOException
- if an I/O error occurs
-
setValue
public void setValue(ParsingContext context, java.lang.Object value)
Description copied from interface:Parser
Sets the property value for marshaling.- Specified by:
setValue
in interfaceParser
- Specified by:
setValue
in interfaceProperty
- Overrides:
setValue
in classRecordAggregation
- Parameters:
context
- theParsingContext
value
- the property value
-
getCollection
protected java.util.Collection<java.lang.Object> getCollection(ParsingContext context)
Returns the collection value being parsed.- Parameters:
context
- theParsingContext
- Returns:
- the
Collection
-
type
public int type()
Description copied from interface:Property
Returns the property type.
-
hasContent
public boolean hasContent(ParsingContext context)
Description copied from interface:Parser
Returns whether this parser or any of its descendant have content for marshalling.- Specified by:
hasContent
in interfaceParser
- Overrides:
hasContent
in classDelegatingParser
- Parameters:
context
- theParsingContext
- Returns:
- true if there is content for marshalling, false otherwise
-
-