java.lang.Object
org.cybergarage.upnp.Argument
Represents a UPnP argument for an action. An argument has a name, direction (in/out), and an optional related state variable.
Field Summary
Modifier and TypeFieldDescriptionprivate Node/////////////////////////////////////////////private static final String/////////////////////////////////////////////static final StringElement name for argumentstatic final StringDirection constant for input argumentsprivate static final String/////////////////////////////////////////////static final StringDirection constant for output argumentsprivate static final String/////////////////////////////////////////////private NodeThe node of the service this argument belongs to.private ObjectUser-defined data associated with this argumentConstructor Summary
ConstructorsConstructorDescriptionArgument()Creates a new Argument with no associated service.Creates a new Argument with the specified name and value.Creates a new Argument associated with the specified service node.Creates a new Argument associated with the specified service node and argument node.Method Summary
Modifier and TypeMethodDescriptionGets the action this argument belongs to.Gets the action node this argument belongs to.private ArgumentDataGets the argument data associated with this argument.Gets the argument node containing argument definition.Gets the direction of this argument.intGets the integer value of this argument.getName()Gets the name of this argument.Gets the related state variable for this argument.Gets the name of the related state variable for this argument.Gets the service this argument belongs to.private NodeGets the service node this argument belongs to.Gets the user-defined data associated with this argument.getValue()Gets the string value of this argument.static booleanisArgumentNode(Node node) Checks if the specified node is an argument node.booleanChecks if this argument is an input argument.booleanChecks if this argument is an output argument.voidsetDirection(String value) Sets the direction of this argument (in or out).voidSets the name of this argument.voidSets the name of the related state variable for this argument.(package private) voidSets the service this argument belongs to.voidsetUserData(Object data) Sets user-defined data for this argument.voidsetValue(int value) Sets the integer value of this argument.voidSets the string value of this argument.
Field Details
ELEM_NAME
IN
OUT
argumentNode
/////////////////////////////////////////////serviceNode
The node of the service this argument belongs to.NAME
/////////////////////////////////////////////- See Also:
DIRECTION
/////////////////////////////////////////////- See Also:
RELATED_STATE_VARIABLE
/////////////////////////////////////////////- See Also:
userData
User-defined data associated with this argument
Constructor Details
Argument
public Argument()Creates a new Argument with no associated service.Argument
Creates a new Argument associated with the specified service node.- Parameters:
servNode- service node to associate
Argument
Argument
Method Details
getArgumentNode
Gets the argument node containing argument definition.- Returns:
- the node holding this argument's definition
getServiceNode
Gets the service node this argument belongs to.- Returns:
- the node of the service this argument belongs to
getService
setService
getActionNode
Gets the action node this argument belongs to.- Returns:
- action node, or null if not found
getAction
isArgumentNode
Checks if the specified node is an argument node.- Parameters:
node- node to check- Returns:
- true if the node is an argument node, false otherwise
setName
getName
setDirection
Sets the direction of this argument (in or out).- Parameters:
value- direction to set
getDirection
Gets the direction of this argument.- Returns:
- direction string ("in" or "out")
isInDirection
public boolean isInDirection()Checks if this argument is an input argument.- Returns:
- true if direction is "in", false otherwise
isOutDirection
public boolean isOutDirection()Checks if this argument is an output argument.- Returns:
- true if direction is "out", false otherwise
setRelatedStateVariableName
Sets the name of the related state variable for this argument.- Parameters:
value- state variable name to set
getRelatedStateVariableName
Gets the name of the related state variable for this argument.- Returns:
- related state variable name
getRelatedStateVariable
Gets the related state variable for this argument.- Returns:
- state variable object, or null if not found
getArgumentData
Gets the argument data associated with this argument.- Returns:
- argument data object
setValue
Sets the string value of this argument.- Parameters:
value- value to set
setValue
public void setValue(int value) Sets the integer value of this argument.- Parameters:
value- integer value to set
getValue
getIntegerValue
public int getIntegerValue()Gets the integer value of this argument.- Returns:
- argument value as integer, or 0 if parsing fails
setUserData
Sets user-defined data for this argument.- Parameters:
data- data to set
getUserData
Gets the user-defined data associated with this argument.- Returns:
- user data object