public final class SentenceValidator extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
isSentence(String nmea)
Tells if the specified String matches the NMEA 0183 sentence format.
|
static boolean |
isValid(String nmea)
Tells if the specified String is a valid NMEA 0183 sentence.
|
public static boolean isSentence(String nmea)
Tells if the specified String matches the NMEA 0183 sentence format.
String is considered as a sentence if it meets the following criteria:
Notice that format matching is not strict; although NMEA 0183 defines a maximum length of 80 chars, the sentence length is not checked. This is due to fact that it seems quite common that devices violate this rule, some perhaps deliberately, some by mistake. Thus, assuming the formatting is otherwise valid, it is not feasible to strictly validate length and discard sentences that just exceed the 80 chars limit.
nmea
- String to inspectpublic static boolean isValid(String nmea)
isSentence(String)
test and contains correct checksum. Sentences without checksum are
validated only by checking the general sentence characteristics.nmea
- String to validatetrue
if valid, otherwise false
.Copyright (C) 2010-2017 Java Marine API authors. All Rights Reserved.