Package au.gov.amsa.util.nmea
Class NmeaMessageParser
- java.lang.Object
-
- au.gov.amsa.util.nmea.NmeaMessageParser
-
public class NmeaMessageParser extends java.lang.ObjectParses NMEA messages.
-
-
Constructor Summary
Constructors Constructor Description NmeaMessageParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.LinkedHashMap<java.lang.String,java.lang.String>extractTags(java.lang.String s)Returns the tags from the tag block section of the message (NMEA v4.0).NmeaMessageparse(java.lang.String line)NmeaMessageparse(java.lang.String line, boolean validateChecksum)Return anNmeaMessagefrom the given NMEA line.
-
-
-
Method Detail
-
parse
public NmeaMessage parse(java.lang.String line)
-
parse
public NmeaMessage parse(java.lang.String line, boolean validateChecksum)
Return anNmeaMessagefrom the given NMEA line. If validate checksum is true and the line fails the checksum check then an {@link NmeaMessageParseException) is thrown.- Parameters:
line- NMEA line (without EOL terminator)validateChecksum- if true then throws NmeaMessageParseException on invalid checksum- Returns:
- parsed message
- Throws:
NmeaMessageParseException- if tag block badly formed or no checksum found or if validateChecksum is true and line fails the checksum check
-
extractTags
public static java.util.LinkedHashMap<java.lang.String,java.lang.String> extractTags(java.lang.String s)
Returns the tags from the tag block section of the message (NMEA v4.0). If there is no tag block then returns an empty map.- Parameters:
s-- Returns:
-
-