org.llrp.ltk.generated
Class LLRPMessageFactory

java.lang.Object
  extended by org.llrp.ltk.generated.LLRPMessageFactory

public class LLRPMessageFactory
extends java.lang.Object

LLRPMessageFactory generates LLRPMessage objects from LLRP Messages in binary or LTK XML encoding. LLRPMessageFactory detects the message types in a binary or XML message and instantiates the corresponding LTK Java message object, e.g. ADD_ROSPEC. The static factory methods return the abstract LLRPMessage. Example: Input a LLRP message in LTK XML format and output the binary representation: // build JDOM document from file org.jdom.Document doc = new org.jdom.input.SAXBuilder().build(new FileReader(filename)); // create LTK-Java object LLRPMessage message = LLRPMessageFactory.createLLRPMessage(doc); // output as a binary message byte[] output = message.encodeBinary();


Field Summary
static int reservedLength
           
static int versionLength
           
 
Constructor Summary
LLRPMessageFactory()
           
 
Method Summary
static LLRPMessage createLLRPMessage(byte[] byteArray)
          Generates a LLRPMessage out of the given Byte Array.
static LLRPMessage createLLRPMessage(org.jdom.Document document)
           
static LLRPMessage createLLRPMessage(LLRPBitList bits)
          Generates a LLRPMessage out of the given LLRPBitList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reservedLength

public static final int reservedLength
See Also:
Constant Field Values

versionLength

public static final int versionLength
See Also:
Constant Field Values
Constructor Detail

LLRPMessageFactory

public LLRPMessageFactory()
Method Detail

createLLRPMessage

public static LLRPMessage createLLRPMessage(LLRPBitList bits)
                                     throws InvalidLLRPMessageException
Generates a LLRPMessage out of the given LLRPBitList.

Parameters:
bits - LLRPBitList of a LLRPMessage
Returns:
appropriate LLRPMessage out of the given LLRPBitList or null when Message couldn't be generated
Throws:
InvalidLLRPMessageException

createLLRPMessage

public static LLRPMessage createLLRPMessage(byte[] byteArray)
                                     throws InvalidLLRPMessageException
Generates a LLRPMessage out of the given Byte Array.

Parameters:
byteArray - byte[] of a LLRPMessage
Returns:
appropriate LLRPMessage out of the given byte[] or null when Message couldn't be generated
Throws:
InvalidLLRPMessageException

createLLRPMessage

public static LLRPMessage createLLRPMessage(org.jdom.Document document)
                                     throws InvalidLLRPMessageException
Throws:
InvalidLLRPMessageException


Copyright © 2007 ETH Zurich.