public interface Parser
Modifier and Type | Method and Description |
---|---|
void |
clearValue(ParsingContext context)
Clears the current property value.
|
String |
getName()
Returns the name of this parser component.
|
int |
getSize()
Returns the size of a single occurrence of this element, which is used to offset
field positions for repeating segments and fields.
|
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 |
isIdentifier()
Returns whether this parser or any descendant of this parser is used to identify
a record during unmarshalling.
|
boolean |
isOptional()
Returns whether this node must exist during unmarshalling.
|
boolean |
marshal(MarshallingContext context)
Marshals a record.
|
boolean |
matches(UnmarshallingContext context)
Returns whether this parser and its children match a record
being unmarshalled.
|
void |
setValue(ParsingContext context,
Object value)
Sets the property value for marshaling.
|
boolean |
unmarshal(UnmarshallingContext context)
Unmarshals a record.
|
String getName()
boolean matches(UnmarshallingContext context)
context
- the UnmarshallingContext
boolean unmarshal(UnmarshallingContext context) throws AbortRecordUnmarshalligException
context
- the UnmarshallingContext
AbortRecordUnmarshalligException
boolean marshal(MarshallingContext context) throws IOException
context
- the MarshallingContext
IOException
- if an I/O error occursboolean hasContent(ParsingContext context)
context
- the ParsingContext
void clearValue(ParsingContext context)
context
- the ParsingContext
void setValue(ParsingContext context, Object value)
context
- the ParsingContext
value
- the property valueObject getValue(ParsingContext context)
context
- the ParsingContext
int getSize()
The concept of size is dependent on the stream format. The size of an element in a fixed length stream format is determined by the length of the element in characters, while other stream formats calculate size based on the number of fields. Some stream formats, such as XML, may ignore size settings.
boolean isIdentifier()
boolean isOptional()