|
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.ParserComponent org.beanio.internal.parser.DelegatingParser org.beanio.internal.parser.RecordAggregation
public abstract class RecordAggregation
Field Summary | |
---|---|
protected ParserLocal<Object> |
value
|
Fields inherited from interface org.beanio.internal.parser.Selector |
---|
COUNT_KEY |
Fields inherited from interface org.beanio.internal.parser.Property |
---|
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE |
Constructor Summary | |
---|---|
RecordAggregation()
Constructs a new RecordAggregation. |
Method Summary | |
---|---|
void |
clearValue(ParsingContext context)
Clears the current property value. |
Selector |
close(ParsingContext context)
Checks for any unsatisfied components before the stream is closed. |
protected Object |
createAggregationType()
|
Object |
createValue(ParsingContext context)
Creates the property value and returns it. |
boolean |
defines(Object value)
|
PropertyAccessor |
getAccessor()
|
int |
getCount(ParsingContext context)
Returns the number of times this component was matched within the current iteration of its parent component. |
int |
getMaxOccurs()
Returns the maximum number of occurrences of this component (within the context of its parent). |
int |
getMinOccurs()
Returns the minimum number of occurrences of this component (within the context of its parent). |
Object |
getNullValue()
|
int |
getOrder()
Returns the order of this component (within the context of its parent). |
Property |
getProperty()
Returns the Property mapped to this component, or null if there is
no property mapping. |
Selector |
getSelector()
Returns the child selector. |
Class<?> |
getType()
|
Object |
getValue(ParsingContext context)
Returns the unmarshalled property value. |
boolean |
isIdentifier()
Returns whether this parser or any descendant of this parser is used to identify a record during unmarshalling. |
boolean |
isMaxOccursReached(ParsingContext context)
Returns whether this component has reached its maximum occurrences. |
boolean |
isRecordGroup()
Returns whether this component is a record group. |
protected boolean |
isSupportedChild(Component child)
Returns whether a node is a supported child of this node. |
Selector |
matchAny(UnmarshallingContext context)
Finds a parser that matches the input record. |
Selector |
matchNext(MarshallingContext context)
Finds a parser for marshalling a bean object. |
Selector |
matchNext(UnmarshallingContext context)
Finds a parser for unmarshalling a record based on the current state of the stream. |
void |
registerLocals(Set<ParserLocal<? extends Object>> locals)
Called by a stream to register variables stored in the parsing context. |
void |
reset(ParsingContext context)
Resets the component count of this Selector's children. |
void |
restoreState(ParsingContext context,
String namespace,
Map<String,Object> state)
Restores a Map of previously stored state information. |
void |
setAccessor(PropertyAccessor accessor)
|
void |
setCount(ParsingContext context,
int count)
Sets the number of times this component was matched within the current iteration of its parent component. |
void |
setIdentifier(boolean identifier)
|
void |
setType(Class<?> type)
Sets the collection type. |
void |
setValue(ParsingContext context,
Object value)
Sets the property value for marshaling. |
void |
skip(UnmarshallingContext context)
Skips a record or group of records. |
void |
updateState(ParsingContext context,
String namespace,
Map<String,Object> state)
Updates a Map with the current state of the Writer to allow for restoration at a later time. |
Methods inherited from class org.beanio.internal.parser.DelegatingParser |
---|
getParser, getSize, hasContent, isLazy, marshal, matches, unmarshal |
Methods inherited from class org.beanio.internal.util.TreeNode |
---|
add, clone, find, getChildren, getFirst, getName, iterator, print, setName, size, sort, toParamString, 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, hasContent, isLazy, marshal, matches, unmarshal |
Methods inherited from interface org.beanio.internal.parser.Property |
---|
getName, type |
Field Detail |
---|
protected ParserLocal<Object> value
Constructor Detail |
---|
public RecordAggregation()
Method Detail |
---|
public void setType(Class<?> type)
setType
in interface Property
type
- Collection
class typepublic Class<?> getType()
getType
in interface Property
public Object createValue(ParsingContext context)
Property
createValue
in interface Property
context
- the ParsingContext
public Object getNullValue()
protected Object createAggregationType()
public Object getValue(ParsingContext context)
Parser
getValue
in interface Parser
getValue
in interface Property
getValue
in class DelegatingParser
context
- the ParsingContext
public void clearValue(ParsingContext context)
Parser
clearValue
in interface Parser
clearValue
in interface Property
clearValue
in class DelegatingParser
context
- the ParsingContext
public void setValue(ParsingContext context, Object value)
Parser
setValue
in interface Parser
setValue
in interface Property
setValue
in class DelegatingParser
context
- the ParsingContext
value
- the property valuepublic Property getProperty()
Selector
Property
mapped to this component, or null if there is
no property mapping.
getProperty
in interface Selector
Property
mapped to this componentpublic Selector matchNext(UnmarshallingContext context)
Selector
matchNext
in interface Selector
context
- the UnmarshallingContext
Selector
for unmarshalling the recordpublic Selector matchAny(UnmarshallingContext context)
Selector
Selector.matchNext(UnmarshallingContext)
returns null, in order to differentiate
between unexpected and unidentified record types.
matchAny
in interface Selector
context
- the UnmarshallingContext
Selector
public Selector matchNext(MarshallingContext context)
Selector
matchNext
in interface Selector
context
- the MarshallingContext
Selector
for marshalling the bean objectpublic Selector close(ParsingContext context)
Selector
close
in interface Selector
context
- the ParsingContext
public void reset(ParsingContext context)
Selector
reset
in interface Selector
context
- the ParsingContext
public int getCount(ParsingContext context)
Selector
getCount
in interface Selector
context
- the ParsingContext
public void setCount(ParsingContext context, int count)
Selector
setCount
in interface Selector
context
- the ParsingContext
count
- the new match countpublic int getOrder()
Selector
getOrder
in interface Selector
public boolean isMaxOccursReached(ParsingContext context)
Selector
isMaxOccursReached
in interface Selector
context
- the ParsingContext
public void updateState(ParsingContext context, String namespace, Map<String,Object> state)
Selector
updateState
in interface Selector
context
- the ParsingContext
namespace
- a String to prefix all state keys withstate
- the Map to update with the latest statepublic void restoreState(ParsingContext context, String namespace, Map<String,Object> state) throws IllegalStateException
Selector
restoreState
in interface Selector
context
- the ParsingContext
namespace
- a String to prefix all state keys withstate
- the Map containing the state to restore
IllegalStateException
- if the Map is missing any state informationpublic int getMinOccurs()
Selector
getMinOccurs
in interface Selector
public int getMaxOccurs()
Selector
getMaxOccurs
in interface Selector
protected boolean isSupportedChild(Component child)
TreeNode
TreeNode.add(TreeNode)
.
isSupportedChild
in class ParserComponent
child
- the node to test
public Selector getSelector()
Selector
public PropertyAccessor getAccessor()
getAccessor
in interface Property
public void setAccessor(PropertyAccessor accessor)
setAccessor
in interface Property
public boolean defines(Object value)
defines
in interface Property
public void setIdentifier(boolean identifier)
setIdentifier
in interface Property
public boolean isIdentifier()
Parser
isIdentifier
in interface Parser
isIdentifier
in interface Property
isIdentifier
in class DelegatingParser
public void registerLocals(Set<ParserLocal<? extends Object>> locals)
Component
registerLocals
in class Component
locals
- set of local variablespublic void skip(UnmarshallingContext context)
Selector
skip
in interface Selector
context
- the UnmarshallingContext
public boolean isRecordGroup()
Selector
isRecordGroup
in interface Selector
|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |