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
AParsertree component for parsing a collection of bean objects, where a bean object is mapped to aRecordorGroup.- 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.booleanhasContent(ParsingContext context)Returns whether this parser or any of its descendant have content for marshalling.booleanmarshal(MarshallingContext context)Marshals a record.voidsetValue(ParsingContext context, java.lang.Object value)Sets the property value for marshaling.inttype()Returns the property type.booleanunmarshal(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:ParserUnmarshals a record.- Specified by:
unmarshalin interfaceParser- Overrides:
unmarshalin classDelegatingParser- Parameters:
context- theUnmarshallingContext- Returns:
trueif this component was present in the unmarshalled record, orfalseotherwise
-
marshal
public boolean marshal(MarshallingContext context) throws java.io.IOException
Description copied from interface:ParserMarshals a record.- Specified by:
marshalin interfaceParser- Overrides:
marshalin 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:ParserSets the property value for marshaling.- Specified by:
setValuein interfaceParser- Specified by:
setValuein interfaceProperty- Overrides:
setValuein classRecordAggregation- Parameters:
context- theParsingContextvalue- 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:PropertyReturns the property type.
-
hasContent
public boolean hasContent(ParsingContext context)
Description copied from interface:ParserReturns whether this parser or any of its descendant have content for marshalling.- Specified by:
hasContentin interfaceParser- Overrides:
hasContentin classDelegatingParser- Parameters:
context- theParsingContext- Returns:
- true if there is content for marshalling, false otherwise
-
-