public class MapParser extends Aggregation
Type | Property and Description |
---|---|
boolean |
is
Gets the value of the property property.
|
lazy, occurs
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE
Constructor and Description |
---|
MapParser()
Constructs a new MapParser.
|
Modifier and Type | Method and Description |
---|---|
void |
clearValue(ParsingContext context)
Clears the current property value.
|
protected Map<Object,Object> |
createMap() |
Object |
createValue(ParsingContext context)
Creates the property value and returns it.
|
boolean |
defines(Object value) |
int |
getIterationSize()
Returns the size of the components that make up a single iteration.
|
Property |
getKey() |
protected Map<Object,Object> |
getMap(ParsingContext context)
Returns the map value being parsed.
|
Class<? extends Map<Object,Object>> |
getType() |
Object |
getValue(ParsingContext context)
Returns the unmarshalled property value.
|
boolean |
hasContent(ParsingContext context)
Returns whether this parser or any of its descendant have content for marshalling.
|
boolean |
isProperty()
Gets the value of the property property.
|
protected int |
length(Object value)
Returns the length of aggregation.
|
protected boolean |
marshal(MarshallingContext context,
Parser delegate,
int minOccurs,
int maxOccurs) |
boolean |
matches(UnmarshallingContext context)
Returns whether this parser and its children match a record
being unmarshalled.
|
void |
registerLocals(Set<ParserLocal<? extends Object>> locals)
Called by a stream to register variables stored in the parsing context.
|
void |
setKey(Property key) |
void |
setType(Class<?> mapType)
Sets the concrete
Map type. |
void |
setValue(ParsingContext context,
Object value)
Sets the property value for marshaling.
|
protected void |
toParamString(StringBuilder s)
Called by
TreeNode.toString() to append node parameters to the output. |
int |
type()
Returns the property type.
|
protected boolean |
unmarshal(UnmarshallingContext context,
Parser delegate,
int minOccurs,
int maxOccurs) |
getAccessor, getIterationIndex, getMaxOccurs, getMinOccurs, getOccurs, isDynamicIteration, isIdentifier, isLazy, isOptional, marshal, setAccessor, setIdentifier, setIterationIndex, setLazy, setMaxOccurs, setMinOccurs, setOccurs, unmarshal
getParser, getSize
isSupportedChild
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, toString, updateReferences
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public boolean isProperty
isProperty
in class Aggregation
public void clearValue(ParsingContext context)
Parser
clearValue
in interface Parser
clearValue
in interface Property
clearValue
in class DelegatingParser
context
- the ParsingContext
public boolean defines(Object value)
public boolean matches(UnmarshallingContext context)
Parser
matches
in interface Parser
matches
in class DelegatingParser
context
- the UnmarshallingContext
protected boolean marshal(MarshallingContext context, Parser delegate, int minOccurs, int maxOccurs) throws IOException
marshal
in class Aggregation
IOException
protected boolean unmarshal(UnmarshallingContext context, Parser delegate, int minOccurs, int maxOccurs)
unmarshal
in class Aggregation
public boolean isProperty()
isProperty
in class Aggregation
public Object createValue(ParsingContext context)
Property
context
- the ParsingContext
public Object getValue(ParsingContext context)
Parser
getValue
in interface Parser
getValue
in interface Property
getValue
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 Aggregation
context
- the ParsingContext
value
- the property valueprotected Map<Object,Object> getMap(ParsingContext context)
Map
protected int length(Object value)
Aggregation
length
in class Aggregation
value
- the aggregation valuepublic int getIterationSize()
Iteration
public int type()
Property
public void registerLocals(Set<ParserLocal<? extends Object>> locals)
Component
registerLocals
in class Aggregation
locals
- set of local variablespublic boolean hasContent(ParsingContext context)
Parser
hasContent
in interface Parser
hasContent
in class DelegatingParser
context
- the ParsingContext
public Property getKey()
public void setKey(Property key)
protected void toParamString(StringBuilder s)
TreeNode
TreeNode.toString()
to append node parameters to the output.toParamString
in class Aggregation
s
- the output to append