Package org.beanio.internal.parser
Class RecordMap
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Iterable<Component>
,Parser
,Property
,Selector
,Replicateable
public class RecordMap extends RecordAggregation
- Since:
- 2.0.1.
-
-
Field Summary
-
Fields inherited from class org.beanio.internal.parser.RecordAggregation
lazy, value
-
Fields inherited from interface org.beanio.internal.parser.Property
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE
-
-
Constructor Summary
Constructors Constructor Description RecordMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
defines(java.lang.Object value)
Property
getKey()
protected java.util.Map<java.lang.Object,java.lang.Object>
getMap(ParsingContext context)
Returns the collection value being parsed.boolean
hasContent(ParsingContext context)
Returns whether this parser or any of its descendant have content for marshalling.boolean
marshal(MarshallingContext context)
Marshals a record.void
setKey(Property key)
void
setValue(ParsingContext context, java.lang.Object value)
Sets the property value for marshaling.protected void
toParamString(java.lang.StringBuilder s)
Called byTreeNode.toString()
to append node parameters to the output.int
type()
Returns the property type.boolean
unmarshal(UnmarshallingContext context)
Unmarshals a record.-
Methods inherited from class org.beanio.internal.parser.RecordAggregation
clearValue, close, createAggregationType, createValue, getAccessor, getCount, getMaxOccurs, getMinOccurs, getNullValue, getOrder, getProperty, getSelector, getType, getValue, isIdentifier, isLazy, isMaxOccursReached, isRecordGroup, isSupportedChild, matchAny, matchNext, matchNext, registerLocals, reset, restoreState, setAccessor, setCount, setIdentifier, setLazy, setType, skip, updateState
-
Methods inherited from class org.beanio.internal.parser.DelegatingParser
getParser, getSize, isOptional, matches
-
Methods inherited from class org.beanio.internal.util.TreeNode
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, 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, isOptional, matches
-
-
-
-
Method Detail
-
unmarshal
public boolean unmarshal(UnmarshallingContext context)
Description copied from interface:Parser
Unmarshals a record.- Specified by:
unmarshal
in interfaceParser
- Overrides:
unmarshal
in classDelegatingParser
- Parameters:
context
- theUnmarshallingContext
- Returns:
true
if this component was present in the unmarshalled record, orfalse
otherwise
-
marshal
public boolean marshal(MarshallingContext context) throws java.io.IOException
Description copied from interface:Parser
Marshals a record.- Specified by:
marshal
in interfaceParser
- Overrides:
marshal
in classDelegatingParser
- Parameters:
context
- theMarshallingContext
- Returns:
- whether a value was marshalled
- Throws:
java.io.IOException
- if an I/O error occurs
-
setValue
public void setValue(ParsingContext context, java.lang.Object value)
Description copied from interface:Parser
Sets the property value for marshaling.- Specified by:
setValue
in interfaceParser
- Specified by:
setValue
in interfaceProperty
- Overrides:
setValue
in classRecordAggregation
- Parameters:
context
- theParsingContext
value
- the property value
-
hasContent
public boolean hasContent(ParsingContext context)
Description copied from interface:Parser
Returns whether this parser or any of its descendant have content for marshalling.- Specified by:
hasContent
in interfaceParser
- Overrides:
hasContent
in classDelegatingParser
- Parameters:
context
- theParsingContext
- Returns:
- true if there is content for marshalling, false otherwise
-
getMap
protected java.util.Map<java.lang.Object,java.lang.Object> getMap(ParsingContext context)
Returns the collection value being parsed.- Parameters:
context
- theParsingContext
- Returns:
- the
Collection
-
type
public int type()
Description copied from interface:Property
Returns the property type.
-
defines
public boolean defines(java.lang.Object value)
- Specified by:
defines
in interfaceProperty
- Overrides:
defines
in classRecordAggregation
-
getKey
public Property getKey()
-
setKey
public void setKey(Property key)
-
toParamString
protected void toParamString(java.lang.StringBuilder s)
Description copied from class:TreeNode
Called byTreeNode.toString()
to append node parameters to the output.- Overrides:
toParamString
in classRecordAggregation
- Parameters:
s
- the output to append
-
-