T
- type of the filepublic abstract class AbstractMessageParser<T> extends Object implements MessageParser<T>
Note than starting with Orekit 11.0, CCSDS message parsers are
mutable objects that gather the data being parsed, until the
message is complete and the parseMessage
method has returned. This implies that parsers
should not be used in a multi-thread context. The recommended
way to use parsers is to either dedicate one parser for each message
and drop it afterwards, or to use a single-thread loop.
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageParser(String root,
String formatVersionKey)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
anticipateNext(ProcessingState anticipated)
Anticipate what next processing state should be.
|
ProcessingState |
getCurrent()
Get the current processing state.
|
protected FileFormat |
getFileFormat()
Get the file format.
|
String |
getFormatVersionKey()
Get the key for format version.
|
Map<String,XmlTokenBuilder> |
getSpecialXmlElementsBuilders()
Get the non-default token builders for special XML elements.
|
T |
parseMessage(DataSource source)
Parse a data source.
|
void |
process(ParseToken token)
Process a parse token.
|
protected void |
reset(FileFormat fileFormat,
ProcessingState initialState)
Reset parser to initial state before parsing.
|
void |
setEndTagSeen(boolean endTagSeen)
Set the flag for XML end tag.
|
void |
setFallback(ProcessingState fallback)
Set fallback processing state.
|
boolean |
wasEndTagSeen()
Check if XML end tag has been seen.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, reset
public void setFallback(ProcessingState fallback)
The fallback processing state is used if anticipated state fails to parse the token.
fallback
- processing state to use if anticipated state does not workprotected void reset(FileFormat fileFormat, ProcessingState initialState)
fileFormat
- format of the file ready to be parsedinitialState
- initial processing statepublic void setEndTagSeen(boolean endTagSeen)
endTagSeen
- if true, the XML end tag has been seenpublic boolean wasEndTagSeen()
public ProcessingState getCurrent()
protected FileFormat getFileFormat()
public T parseMessage(DataSource source)
parseMessage
in interface MessageParser<T>
source
- data source to parsepublic String getFormatVersionKey()
getFormatVersionKey
in interface MessageParser<T>
public Map<String,XmlTokenBuilder> getSpecialXmlElementsBuilders()
getSpecialXmlElementsBuilders
in interface MessageParser<T>
public void anticipateNext(ProcessingState anticipated)
anticipated
- anticipated next processing statepublic void process(ParseToken token)
process
in interface MessageParser<T>
token
- token to processCopyright © 2002-2021 CS GROUP. All rights reserved.