aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MaxonProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-07 18:50:10 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-07 18:50:10 +1300
commitc344d4086bb2179d485c9b25af4d737e26f23221 (patch)
treef937934f07951e0ec8f8281528bd1ba9664c2d3f /src/org/traccar/protocol/MaxonProtocolDecoder.java
parent4a5961a98b0b6576e4c6553435a70a7bca3f9b44 (diff)
downloadtraccar-server-c344d4086bb2179d485c9b25af4d737e26f23221.tar.gz
traccar-server-c344d4086bb2179d485c9b25af4d737e26f23221.tar.bz2
traccar-server-c344d4086bb2179d485c9b25af4d737e26f23221.zip
Rename pattern to upper case style
Diffstat (limited to 'src/org/traccar/protocol/MaxonProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MaxonProtocolDecoder.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/MaxonProtocolDecoder.java b/src/org/traccar/protocol/MaxonProtocolDecoder.java
index 54177af68..14bf285fc 100644
--- a/src/org/traccar/protocol/MaxonProtocolDecoder.java
+++ b/src/org/traccar/protocol/MaxonProtocolDecoder.java
@@ -20,9 +20,7 @@ import java.util.Calendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
import org.jboss.netty.channel.Channel;
-
import org.traccar.BaseProtocolDecoder;
import org.traccar.model.Position;
@@ -41,7 +39,7 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private static final Pattern pattern = Pattern.compile(
+ private static final Pattern PATTERN = Pattern.compile(
"\\$GPRMC," +
"(\\d{2})(\\d{2})(\\d{2})\\.(\\d{2})," + // Time (HHMMSS.SSS)
"([AV])," + // Validity
@@ -54,11 +52,10 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder {
"(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY)
".+"); // Other (Checksumm)
- private static final Pattern gpfidPattern = Pattern.compile("\\$GPFID,(\\d+)$");
+ private static final Pattern PATTERN_GPFID = Pattern.compile("\\$GPFID,(\\d+)$");
- protected Object decode(
- Channel channel, SocketAddress remoteAddress, Object msg)
- throws Exception {
+ @Override
+ protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
@@ -67,7 +64,7 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder {
if (sentence.contains("$GPRMC")) {
// Parse message
- Matcher parser = pattern.matcher(sentence);
+ Matcher parser = PATTERN.matcher(sentence);
if (!parser.matches()) {
return null;
}
@@ -119,7 +116,7 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder {
position.setTime(time.getTime());
} else if (sentence.contains("$GPFID") && position != null) {
- Matcher parser = gpfidPattern.matcher(sentence);
+ Matcher parser = PATTERN_GPFID.matcher(sentence);
if (parser.matches()) {
if (!identify(parser.group(1), channel)) {