public interface Selector extends Parser
Modifier and Type | Method and Description |
---|---|
Selector |
close(ParsingContext context)
Checks for any unsatisfied components before the stream is closed.
|
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).
|
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. |
boolean |
isMaxOccursReached(ParsingContext context)
Returns whether this component has reached its maximum occurrences.
|
boolean |
isRecordGroup()
Returns whether this component is a record group.
|
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 |
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 |
setCount(ParsingContext context,
int count)
Sets the number of times this component was matched within the current
iteration of its parent component.
|
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.
|
clearValue, getName, getSize, getValue, hasContent, isIdentifier, isOptional, marshal, matches, setValue, unmarshal
static final String COUNT_KEY
Selector matchNext(MarshallingContext context)
context
- the MarshallingContext
Selector
for marshalling the bean objectSelector matchNext(UnmarshallingContext context)
context
- the UnmarshallingContext
Selector
for unmarshalling the recordSelector matchAny(UnmarshallingContext context)
matchNext(UnmarshallingContext)
returns null, in order to differentiate
between unexpected and unidentified record types.context
- the UnmarshallingContext
Selector
void skip(UnmarshallingContext context)
context
- the UnmarshallingContext
Selector close(ParsingContext context)
context
- the ParsingContext
void reset(ParsingContext context)
context
- the ParsingContext
int getCount(ParsingContext context)
context
- the ParsingContext
void setCount(ParsingContext context, int count)
context
- the ParsingContext
count
- the new match countboolean isMaxOccursReached(ParsingContext context)
context
- the ParsingContext
int getMinOccurs()
int getMaxOccurs()
int getOrder()
Property getProperty()
Property
mapped to this component, or null if there is
no property mapping.Property
mapped to this componentboolean isRecordGroup()
void updateState(ParsingContext context, String namespace, Map<String,Object> state)
context
- the ParsingContext
namespace
- a String to prefix all state keys withstate
- the Map to update with the latest statevoid restoreState(ParsingContext context, String namespace, Map<String,Object> state) throws IllegalStateException
context
- the ParsingContext
namespace
- a String to prefix all state keys withstate
- the Map containing the state to restoreIllegalStateException
- if the Map is missing any state information