org.fosstrak.llrp.commander.util
Class LLRP
java.lang.Object
org.fosstrak.llrp.commander.util.LLRP
public class LLRP
- extends java.lang.Object
This class can be used to get information on the LLRP protocol.
For example, to learn the definition of the "ADD_ROSPEC" message, call
LLRP.getMessageDefinition("ADD_ROSPEC").
- Author:
- Ulrich Etter, ETHZ
Constructor Summary |
LLRP()
|
Method Summary |
static boolean |
canOccurMultipleTimes(java.lang.Object messageOrParameterDefinition,
java.lang.String parameterOrChoiceName)
Returns true if the parameter/choice with the given name can occur multiple times in
the message/parameter with the given definition,
and false otherwise. |
static org.llrp.ltkGenerator.generated.ChoiceDefinition |
getChoiceDefinition(java.lang.String choiceName)
Returns the definition of the choice with the given name. |
static java.lang.String |
getDescription(java.lang.Object messageOrParameterDefinition)
Returns the description of the message/parameter with the given definition as a HTML string. |
static org.llrp.ltkGenerator.generated.EnumerationDefinition |
getEnumerationDefinition(java.lang.String enumerationName)
Returns the definition of the enumeration with the given name. |
static org.llrp.ltkGenerator.generated.FieldDefinition |
getFieldDefinition(java.lang.Object messageOrParameterDefinition,
java.lang.String fieldName)
Returns the definition of the field with the given name of the message/parameter with the given definition. |
static java.util.List<org.llrp.ltkGenerator.generated.FieldDefinition> |
getFieldDefinitions(java.lang.Object messageOrParameterDefinition)
Returns the definitions of all fields of the message/parameter with the given name. |
static java.lang.String |
getFieldType(org.llrp.ltkGenerator.generated.FieldDefinition fieldDefinition)
Returns the type of the field with the given definition. |
static org.llrp.ltkGenerator.generated.LlrpDefinition |
getLlrpDefintion()
Returns the LLRP definition object. |
static org.llrp.ltkGenerator.generated.MessageDefinition |
getMessageDefinition(java.lang.String messageName)
Returns the definition of the message with the given name. |
static java.util.List<java.lang.String> |
getParameterAndChoiceNames(java.lang.Object messageOrParameterDefinition)
Returns the names of all parameters and choices of the message/parameter with the given definition. |
static org.llrp.ltkGenerator.generated.ParameterDefinition |
getParameterDefinition(java.lang.String parameterName)
Returns the definition of the parameter with the given name. |
static boolean |
isChoice(java.lang.Object messageOrParameterDefinition,
java.lang.String parameterOrChoiceName)
Returns true if the parameter/choice with the given name, defined in the
message/parameter with the given definition, is a choice,
and false otherwise. |
static boolean |
isEnumeration(org.llrp.ltkGenerator.generated.FieldDefinition fieldDefinition)
Returns true if the field with the given definition is an enumeration,
and false otherwise. |
static boolean |
mustOccurAtLeastOnce(java.lang.Object messageOrParameterDefinition,
java.lang.String parameterOrChoiceName)
Returns true if the parameter/choice with the given name must occur at least once in
the message/parameter with the given definition,
and false otherwise. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LLRP
public LLRP()
getLlrpDefintion
public static org.llrp.ltkGenerator.generated.LlrpDefinition getLlrpDefintion()
- Returns the LLRP definition object.
- Returns:
- the LLRP definition object
getMessageDefinition
public static org.llrp.ltkGenerator.generated.MessageDefinition getMessageDefinition(java.lang.String messageName)
- Returns the definition of the message with the given name.
- Parameters:
messageName
- the name of a message
- Returns:
- the definition object, or
null
if no message with the given name exists
getParameterDefinition
public static org.llrp.ltkGenerator.generated.ParameterDefinition getParameterDefinition(java.lang.String parameterName)
- Returns the definition of the parameter with the given name.
- Parameters:
parameterName
- the name of a parameter
- Returns:
- the definition object, or
null
if no parameter with the given name exists
getChoiceDefinition
public static org.llrp.ltkGenerator.generated.ChoiceDefinition getChoiceDefinition(java.lang.String choiceName)
- Returns the definition of the choice with the given name.
- Parameters:
choiceName
- the name of a choice
- Returns:
- the definition object, or
null
if no choice with the given name exists
getFieldDefinition
public static org.llrp.ltkGenerator.generated.FieldDefinition getFieldDefinition(java.lang.Object messageOrParameterDefinition,
java.lang.String fieldName)
- Returns the definition of the field with the given name of the message/parameter with the given definition.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
fieldName
- the name of a field
- Returns:
- the definition of the field, or
null
if no field with the given name exists
in the message/parameter with the given definition
getFieldDefinitions
public static java.util.List<org.llrp.ltkGenerator.generated.FieldDefinition> getFieldDefinitions(java.lang.Object messageOrParameterDefinition)
- Returns the definitions of all fields of the message/parameter with the given name.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
- Returns:
- the definitions of all fields of the message/parameter with the given name
getEnumerationDefinition
public static org.llrp.ltkGenerator.generated.EnumerationDefinition getEnumerationDefinition(java.lang.String enumerationName)
- Returns the definition of the enumeration with the given name.
- Parameters:
enumerationName
- the name of an enumeration
- Returns:
- the definition of the enumeration, or
null
if no enumeration with the given name exists
getDescription
public static java.lang.String getDescription(java.lang.Object messageOrParameterDefinition)
- Returns the description of the message/parameter with the given definition as a HTML string.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
- Returns:
- the description of the message/parameter with the given definition as a HTML string
getParameterAndChoiceNames
public static java.util.List<java.lang.String> getParameterAndChoiceNames(java.lang.Object messageOrParameterDefinition)
- Returns the names of all parameters and choices of the message/parameter with the given definition.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
- Returns:
- the names of all parameters and choices of the message/parameter with the given definition
getFieldType
public static java.lang.String getFieldType(org.llrp.ltkGenerator.generated.FieldDefinition fieldDefinition)
- Returns the type of the field with the given definition.
- Parameters:
fieldDefinition
- the definition of the field
- Returns:
- the type of the field with the given definition
isEnumeration
public static boolean isEnumeration(org.llrp.ltkGenerator.generated.FieldDefinition fieldDefinition)
- Returns
true
if the field with the given definition is an enumeration,
and false
otherwise.
- Parameters:
fieldDefinition
- the definition of the field
- Returns:
- true if the field is an enumeration, false otherwise.
canOccurMultipleTimes
public static boolean canOccurMultipleTimes(java.lang.Object messageOrParameterDefinition,
java.lang.String parameterOrChoiceName)
- Returns
true
if the parameter/choice with the given name can occur multiple times in
the message/parameter with the given definition,
and false
otherwise.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
parameterOrChoiceName
- the name of a parameter/choice
- Returns:
- true if a parameter can occur multiple times, false otherwise.
mustOccurAtLeastOnce
public static boolean mustOccurAtLeastOnce(java.lang.Object messageOrParameterDefinition,
java.lang.String parameterOrChoiceName)
- Returns
true
if the parameter/choice with the given name must occur at least once in
the message/parameter with the given definition,
and false
otherwise.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
parameterOrChoiceName
- the name of a parameter/choice
- Returns:
- true if parameter must occur at least once, false otherwise.
isChoice
public static boolean isChoice(java.lang.Object messageOrParameterDefinition,
java.lang.String parameterOrChoiceName)
- Returns
true
if the parameter/choice with the given name, defined in the
message/parameter with the given definition, is a choice,
and false
otherwise.
- Parameters:
messageOrParameterDefinition
- either a MessageDefinition
or a ParameterDefinition
parameterOrChoiceName
- the name of a parameter/choice
- Returns:
- true if the parameter is a choise parameter, false otherwise.
Copyright © 2009. All Rights Reserved.