org.fosstrak.llrp.commander.editors
Class BinaryMessageHelper

java.lang.Object
  extended by org.fosstrak.llrp.commander.editors.BinaryMessageHelper

public class BinaryMessageHelper
extends java.lang.Object

This is a helper class for LLRP Binary Message, which transform the XML message to binary bit list by calling LTK Java APIs.

Version:
1.0
Author:
Haoning Zhang, sawielan

Field Summary
static java.lang.String DEFAULT_CHUNK_DELIMITER
          the default separator between two chunks.
static int DEFAULT_CHUNK_LENGTH
          denotes the length of a chunk within a line.
static int DEFAULT_LINE_LENGTH
          denotes the number of characters used to split the parameters into several lines.
 
Constructor Summary
BinaryMessageHelper(java.lang.String aXMLContent)
          Constructor, initialize the valid Message in binary format
 
Method Summary
 java.lang.String[] getArrParameters(int lineLength, int chunkLength, java.lang.String delimiter)
          splits the parameters into an array of several strings with sub-chunks.
 java.lang.String getBinaryString()
          Get the binary list.
 java.lang.String getLength()
          Get the length value of the message, in binary format.
 java.lang.String getMessageID()
          Get the message ID of the message, in binary format.
 java.lang.String getMessageType()
          Get the message type value of the message, in binary format.
 java.lang.String getParameters()
          Get the ALL parameter values of the message, in binary format.
 java.lang.String getReserved()
          Get the reversed value of the message, in binary format.
 java.lang.String getVersion()
          Get the version value of the message, in binary format.
 java.lang.String insert(java.lang.String orig, java.lang.String ins, int n)
          create a new string that contains the delimiter ins every n characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LINE_LENGTH

public static final int DEFAULT_LINE_LENGTH
denotes the number of characters used to split the parameters into several lines.

See Also:
Constant Field Values

DEFAULT_CHUNK_LENGTH

public static final int DEFAULT_CHUNK_LENGTH
denotes the length of a chunk within a line.

See Also:
Constant Field Values

DEFAULT_CHUNK_DELIMITER

public static final java.lang.String DEFAULT_CHUNK_DELIMITER
the default separator between two chunks.

See Also:
Constant Field Values
Constructor Detail

BinaryMessageHelper

public BinaryMessageHelper(java.lang.String aXMLContent)
                    throws java.lang.Exception
Constructor, initialize the valid Message in binary format

Parameters:
aXMLContent - XML Message Format
Throws:
java.lang.Exception - if message is not valid.
Method Detail

getBinaryString

public java.lang.String getBinaryString()
Get the binary list.

Returns:
Binary List

getReserved

public java.lang.String getReserved()
Get the reversed value of the message, in binary format.

Returns:
Reserved Value

getVersion

public java.lang.String getVersion()
Get the version value of the message, in binary format.

Returns:
Version Value

getMessageType

public java.lang.String getMessageType()
Get the message type value of the message, in binary format.

Returns:
Message Type Value

getLength

public java.lang.String getLength()
Get the length value of the message, in binary format.

Returns:
Message Length Value

getMessageID

public java.lang.String getMessageID()
Get the message ID of the message, in binary format.

Returns:
Message ID Value

getParameters

public java.lang.String getParameters()
Get the ALL parameter values of the message, in binary format.

Returns:
ALL parameter values

insert

public java.lang.String insert(java.lang.String orig,
                               java.lang.String ins,
                               int n)
create a new string that contains the delimiter ins every n characters.

Parameters:
orig - the original string.
ins - the delimiter to insert.
n - the number of characters to use between two delimiters.
Returns:
the resulting string.

getArrParameters

public java.lang.String[] getArrParameters(int lineLength,
                                           int chunkLength,
                                           java.lang.String delimiter)
splits the parameters into an array of several strings with sub-chunks.

Parameters:
lineLength - the length of the resulting line.
chunkLength - the length of one chunk within the line.
delimiter - the delimiter between the chunks.
Returns:
an array encoding the parameters into a chunk of several lines.


Copyright © 2009. All Rights Reserved.