public abstract class RecordAggregation extends DelegatingParser implements Selector, Property
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
lazy |
protected ParserLocal<Object> |
value |
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE| Constructor and Description |
|---|
RecordAggregation()
Constructs a new RecordAggregation.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
isLazy() |
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 |
setLazy(boolean lazy) |
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.
|
protected void |
toParamString(StringBuilder s)
Called by
TreeNode.toString() to append node parameters to the output. |
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.
|
getParser, getSize, hasContent, isOptional, marshal, matches, unmarshaladd, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, toString, updateReferencesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getSize, hasContent, isOptional, marshal, matches, unmarshalforEach, spliteratorprotected ParserLocal<Object> value
protected boolean lazy
public void setType(Class<?> type)
setType in interface Propertytype - Collection class typepublic Object createValue(ParsingContext context)
PropertycreateValue in interface Propertycontext - the ParsingContextpublic Object getNullValue()
protected Object createAggregationType()
public Object getValue(ParsingContext context)
ParsergetValue in interface ParsergetValue in interface PropertygetValue in class DelegatingParsercontext - the ParsingContextpublic void clearValue(ParsingContext context)
ParserclearValue in interface ParserclearValue in interface PropertyclearValue in class DelegatingParsercontext - the ParsingContextpublic void setValue(ParsingContext context, Object value)
ParsersetValue 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)
SelectormatchNext in interface Selectorcontext - the UnmarshallingContextSelector 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 UnmarshallingContextSelectorpublic Selector matchNext(MarshallingContext context)
SelectormatchNext in interface Selectorcontext - the MarshallingContextSelector for marshalling the bean objectpublic Selector close(ParsingContext context)
Selectorclose in interface Selectorcontext - the ParsingContextpublic void reset(ParsingContext context)
Selectorreset in interface Selectorcontext - the ParsingContextpublic int getCount(ParsingContext context)
SelectorgetCount in interface Selectorcontext - the ParsingContextpublic void setCount(ParsingContext context, int count)
SelectorsetCount in interface Selectorcontext - the ParsingContextcount - the new match countpublic int getOrder()
Selectorpublic boolean isMaxOccursReached(ParsingContext context)
SelectorisMaxOccursReached in interface Selectorcontext - the ParsingContextpublic void updateState(ParsingContext context, String namespace, Map<String,Object> state)
SelectorupdateState in interface Selectorcontext - the ParsingContextnamespace - 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
SelectorrestoreState in interface Selectorcontext - the ParsingContextnamespace - a String to prefix all state keys withstate - the Map containing the state to restoreIllegalStateException - if the Map is missing any state informationpublic int getMinOccurs()
SelectorgetMinOccurs in interface Selectorpublic int getMaxOccurs()
SelectorgetMaxOccurs in interface Selectorpublic boolean isLazy()
public void setLazy(boolean lazy)
protected boolean isSupportedChild(Component child)
TreeNodeTreeNode.add(TreeNode).isSupportedChild in class ParserComponentchild - the node to testpublic PropertyAccessor getAccessor()
getAccessor in interface Propertypublic void setAccessor(PropertyAccessor accessor)
setAccessor in interface Propertypublic void setIdentifier(boolean identifier)
setIdentifier in interface Propertypublic boolean isIdentifier()
ParserisIdentifier in interface ParserisIdentifier in interface PropertyisIdentifier in class DelegatingParserpublic void registerLocals(Set<ParserLocal<? extends Object>> locals)
ComponentregisterLocals in class Componentlocals - set of local variablespublic void skip(UnmarshallingContext context)
Selectorskip in interface Selectorcontext - the UnmarshallingContextpublic boolean isRecordGroup()
SelectorisRecordGroup in interface Selectorprotected void toParamString(StringBuilder s)
TreeNodeTreeNode.toString() to append node parameters to the output.toParamString in class TreeNode<Component>s - the output to append