|
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.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 Propertytype - Collection class typepublic Class<?> getType()
getType in interface Propertypublic Object createValue(ParsingContext context)
Property
createValue in interface Propertycontext - the ParsingContext
public Object getNullValue()
protected Object createAggregationType()
public Object getValue(ParsingContext context)
Parser
getValue in interface ParsergetValue in interface PropertygetValue in class DelegatingParsercontext - the ParsingContext
public void clearValue(ParsingContext context)
Parser
clearValue in interface ParserclearValue in interface PropertyclearValue in class DelegatingParsercontext - the ParsingContext
public void setValue(ParsingContext context,
Object value)
Parser
setValue in interface ParsersetValue in interface PropertysetValue in class DelegatingParsercontext - the ParsingContextvalue - the property valuepublic Property getProperty()
SelectorProperty mapped to this component, or null if there is
no property mapping.
getProperty in interface SelectorProperty mapped to this componentpublic Selector matchNext(UnmarshallingContext context)
Selector
matchNext in interface Selectorcontext - the UnmarshallingContext
Selector for unmarshalling the recordpublic Selector matchAny(UnmarshallingContext context)
SelectorSelector.matchNext(UnmarshallingContext) returns null, in order to differentiate
between unexpected and unidentified record types.
matchAny in interface Selectorcontext - the UnmarshallingContext
Selectorpublic Selector matchNext(MarshallingContext context)
Selector
matchNext in interface Selectorcontext - the MarshallingContext
Selector for marshalling the bean objectpublic Selector close(ParsingContext context)
Selector
close in interface Selectorcontext - the ParsingContext
public void reset(ParsingContext context)
Selector
reset in interface Selectorcontext - the ParsingContextpublic int getCount(ParsingContext context)
Selector
getCount in interface Selectorcontext - the ParsingContext
public void setCount(ParsingContext context,
int count)
Selector
setCount in interface Selectorcontext - the ParsingContextcount - the new match countpublic int getOrder()
Selector
getOrder in interface Selectorpublic boolean isMaxOccursReached(ParsingContext context)
Selector
isMaxOccursReached in interface Selectorcontext - the ParsingContext
public void updateState(ParsingContext context,
String namespace,
Map<String,Object> state)
Selector
updateState in interface Selectorcontext - the ParsingContextnamespace - a String to prefix all state keys withstate - the Map to update with the latest state
public void restoreState(ParsingContext context,
String namespace,
Map<String,Object> state)
throws IllegalStateException
Selector
restoreState in interface Selectorcontext - the ParsingContextnamespace - 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 Selectorpublic int getMaxOccurs()
Selector
getMaxOccurs in interface Selectorprotected boolean isSupportedChild(Component child)
TreeNodeTreeNode.add(TreeNode).
isSupportedChild in class ParserComponentchild - the node to test
public Selector getSelector()
Selectorpublic PropertyAccessor getAccessor()
getAccessor in interface Propertypublic void setAccessor(PropertyAccessor accessor)
setAccessor in interface Propertypublic boolean defines(Object value)
defines in interface Propertypublic void setIdentifier(boolean identifier)
setIdentifier in interface Propertypublic boolean isIdentifier()
Parser
isIdentifier in interface ParserisIdentifier in interface PropertyisIdentifier in class DelegatingParserpublic void registerLocals(Set<ParserLocal<? extends Object>> locals)
Component
registerLocals in class Componentlocals - set of local variablespublic void skip(UnmarshallingContext context)
Selector
skip in interface Selectorcontext - the UnmarshallingContextpublic 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 | ||||||||