cybergarage-upnp
org.cybergarage.upnp.Argument Class Reference

Public Member Functions

Node getArgumentNode ()
 
Service getService ()
 
Node getActionNode ()
 
Action getAction ()
 
 Argument ()
 
 Argument (Node servNode)
 
 Argument (Node servNode, Node argNode)
 
 Argument (String name, String value)
 
void setName (String value)
 
String getName ()
 
void setDirection (String value)
 
String getDirection ()
 
boolean isInDirection ()
 
boolean isOutDirection ()
 
void setRelatedStateVariableName (String value)
 
String getRelatedStateVariableName ()
 
StateVariable getRelatedStateVariable ()
 
void setValue (String value)
 
void setValue (int value)
 
String getValue ()
 
int getIntegerValue ()
 
void setUserData (Object data)
 
Object getUserData ()
 

Static Public Member Functions

static boolean isArgumentNode (Node node)
 

Static Public Attributes

static final String ELEM_NAME = "argument"
 
static final String IN = "in"
 
static final String OUT = "out"
 

Private Member Functions

Node getServiceNode ()
 
ArgumentData getArgumentData ()
 

Private Attributes

Node argumentNode
 
Node serviceNode
 
Object userData = null
 

Static Private Attributes

static final String NAME = "name"
 
static final String DIRECTION = "direction"
 
static final String RELATED_STATE_VARIABLE = "relatedStateVariable"
 

Detailed Description

Represents an argument of a UPnP action.

Arguments are the parameters passed to and returned from UPnP actions. Each argument has:

  • A name identifying the argument
  • A direction (in or out) indicating if it's an input or output parameter
  • A related state variable defining its data type and constraints
  • A value holding the actual data

Example usage:


// Creating an input argument
Argument volumeArg = new Argument("DesiredVolume", "50");

// Checking direction
if (argument.isInDirection()) {
String value = argument.getValue();
}

// Getting related state variable
StateVariable stateVar = argument.getRelatedStateVariable();
See also
Action
StateVariable
ArgumentList

Constructor & Destructor Documentation

◆ Argument() [1/4]

org.cybergarage.upnp.Argument.Argument ( )
inline

Constructs an empty argument.

◆ Argument() [2/4]

org.cybergarage.upnp.Argument.Argument ( Node servNode)
inline

Constructs an argument associated with a service node.

Parameters
servNodethe XML node representing the parent service

◆ Argument() [3/4]

org.cybergarage.upnp.Argument.Argument ( Node servNode,
Node argNode )
inline

Constructs an argument from existing service and argument XML nodes.

Parameters
servNodethe XML node representing the parent service
argNodethe XML node representing the argument definition

◆ Argument() [4/4]

org.cybergarage.upnp.Argument.Argument ( String name,
String value )
inline

Constructs an argument with the specified name and value.

Parameters
namethe argument name
valuethe argument value

Member Function Documentation

◆ getAction()

Action org.cybergarage.upnp.Argument.getAction ( )
inline

Returns the action that contains this argument.

Returns
the parent action of this argument

◆ getActionNode()

Node org.cybergarage.upnp.Argument.getActionNode ( )
inline

Returns the XML node representing the action that contains this argument.

Returns
the action XML node, or null if not found

◆ getArgumentData()

ArgumentData org.cybergarage.upnp.Argument.getArgumentData ( )
inlineprivate

◆ getArgumentNode()

Node org.cybergarage.upnp.Argument.getArgumentNode ( )
inline

Returns the underlying XML node representing this argument.

Returns
the argument XML node

◆ getDirection()

String org.cybergarage.upnp.Argument.getDirection ( )
inline

Returns the direction of this argument.

Returns
the direction string, or null if not set

◆ getIntegerValue()

int org.cybergarage.upnp.Argument.getIntegerValue ( )
inline

Returns the value of this argument as an integer.

If the value cannot be parsed as an integer, returns 0.

Returns
the argument value as an integer, or 0 if parsing fails

◆ getName()

String org.cybergarage.upnp.Argument.getName ( )
inline

Returns the name of this argument.

Returns
the argument name

◆ getRelatedStateVariable()

StateVariable org.cybergarage.upnp.Argument.getRelatedStateVariable ( )
inline

Returns the related state variable object.

Looks up the state variable by name in the parent service's state table.

Returns
the related state variable, or null if not found or if the service is not available
See also
StateVariable

◆ getRelatedStateVariableName()

String org.cybergarage.upnp.Argument.getRelatedStateVariableName ( )
inline

Returns the name of the related state variable.

Returns
the name of the related state variable

◆ getService()

Service org.cybergarage.upnp.Argument.getService ( )
inline

Returns the service that contains this argument.

Returns
the parent service of this argument

◆ getServiceNode()

Node org.cybergarage.upnp.Argument.getServiceNode ( )
inlineprivate

◆ getUserData()

Object org.cybergarage.upnp.Argument.getUserData ( )
inline

Returns the custom user data associated with this argument.

Returns
the user data object, or null if none has been set

◆ getValue()

String org.cybergarage.upnp.Argument.getValue ( )
inline

Returns the value of this argument.

Returns
the argument value as a string

◆ isArgumentNode()

static boolean org.cybergarage.upnp.Argument.isArgumentNode ( Node node)
inlinestatic

Checks if the given XML node represents an argument element.

Parameters
nodethe XML node to check
Returns
true if the node's name matches the argument element name, false otherwise

◆ isInDirection()

boolean org.cybergarage.upnp.Argument.isInDirection ( )
inline

Checks if this argument is an input parameter.

Returns
true if the direction is "in", false otherwise

◆ isOutDirection()

boolean org.cybergarage.upnp.Argument.isOutDirection ( )
inline

Checks if this argument is an output parameter.

Returns
true if the direction is not "in", false otherwise

◆ setDirection()

void org.cybergarage.upnp.Argument.setDirection ( String value)
inline

Sets the direction of this argument.

Parameters
valuethe direction, either IN or OUT

◆ setName()

void org.cybergarage.upnp.Argument.setName ( String value)
inline

Sets the name of this argument.

Parameters
valuethe argument name

◆ setRelatedStateVariableName()

void org.cybergarage.upnp.Argument.setRelatedStateVariableName ( String value)
inline

Sets the name of the related state variable.

The related state variable defines the data type, range, and constraints for this argument's value.

Parameters
valuethe name of the related state variable

◆ setUserData()

void org.cybergarage.upnp.Argument.setUserData ( Object data)
inline

Sets custom user data associated with this argument.

Allows applications to attach arbitrary data to an argument instance for application-specific purposes.

Parameters
datathe user data object to associate with this argument

◆ setValue() [1/2]

void org.cybergarage.upnp.Argument.setValue ( int value)
inline

Sets the value of this argument from an integer.

The integer is converted to a string representation.

Parameters
valuethe argument value as an integer

◆ setValue() [2/2]

void org.cybergarage.upnp.Argument.setValue ( String value)
inline

Sets the value of this argument.

Parameters
valuethe argument value as a string

Field Documentation

◆ argumentNode

Node org.cybergarage.upnp.Argument.argumentNode
private

◆ DIRECTION

final String org.cybergarage.upnp.Argument.DIRECTION = "direction"
staticprivate

◆ ELEM_NAME

final String org.cybergarage.upnp.Argument.ELEM_NAME = "argument"
static

The XML element name for argument nodes in SCPD documents.

◆ IN

final String org.cybergarage.upnp.Argument.IN = "in"
static

Direction constant for input arguments.

◆ NAME

final String org.cybergarage.upnp.Argument.NAME = "name"
staticprivate

◆ OUT

final String org.cybergarage.upnp.Argument.OUT = "out"
static

Direction constant for output arguments.

◆ RELATED_STATE_VARIABLE

final String org.cybergarage.upnp.Argument.RELATED_STATE_VARIABLE = "relatedStateVariable"
staticprivate

◆ serviceNode

Node org.cybergarage.upnp.Argument.serviceNode
private

◆ userData

Object org.cybergarage.upnp.Argument.userData = null
private

The documentation for this class was generated from the following file: