java.lang.Object
org.cybergarage.upnp.Argument

public class Argumentextends Object
Represents a UPnP argument for an action. An argument has a name, direction (in/out), and an optional related state variable.
  • Field Details

    • ELEM_NAME

      public static final String ELEM_NAME
      Element name for argument
      See Also:
    • IN

      public static final String IN
      Direction constant for input arguments
      See Also:
    • OUT

      public static final String OUT
      Direction constant for output arguments
      See Also:
    • argumentNode

      private Node argumentNode
      /////////////////////////////////////////////
    • serviceNode

      private Node serviceNode
      The node of the service this argument belongs to.
    • NAME

      private static final String NAME
      /////////////////////////////////////////////
      See Also:
    • DIRECTION

      private static final String DIRECTION
      /////////////////////////////////////////////
      See Also:
    • userData

      private Object userData
      User-defined data associated with this argument
  • Constructor Details

    • Argument

      public Argument()
      Creates a new Argument with no associated service.
    • Argument

      public Argument(Node servNode)
      Creates a new Argument associated with the specified service node.
      Parameters:
      servNode - service node to associate
    • Argument

      public Argument(Node servNode, Node argNode)
      Creates a new Argument associated with the specified service node and argument node.
      Parameters:
      servNode - service node to associate
      argNode - argument node containing definition
    • Argument

      public Argument(String name, String value)
      Creates a new Argument with the specified name and value.
      Parameters:
      name - argument name
      value - argument value
  • Method Details

    • getArgumentNode

      public Node getArgumentNode()
      Gets the argument node containing argument definition.
      Returns:
      the node holding this argument's definition
    • getServiceNode

      private Node getServiceNode()
      Gets the service node this argument belongs to.
      Returns:
      the node of the service this argument belongs to
    • getService

      public Service getService()
      Gets the service this argument belongs to.
      Returns:
      service object
    • setService

      void setService(Service s)
      Sets the service this argument belongs to.
      Parameters:
      s - service to set
    • getActionNode

      public Node getActionNode()
      Gets the action node this argument belongs to.
      Returns:
      action node, or null if not found
    • getAction

      public Action getAction()
      Gets the action this argument belongs to.
      Returns:
      action object
    • isArgumentNode

      public static boolean isArgumentNode(Node node)
      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

      public void setName(String value)
      Sets the name of this argument.
      Parameters:
      value - name to set
    • getName

      public String getName()
      Gets the name of this argument.
      Returns:
      argument name
    • setDirection

      public void setDirection(String value)
      Sets the direction of this argument (in or out).
      Parameters:
      value - direction to set
    • getDirection

      public String 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

      public void setRelatedStateVariableName(String value)
      Sets the name of the related state variable for this argument.
      Parameters:
      value - state variable name to set
    • getRelatedStateVariableName

      public String getRelatedStateVariableName()
      Gets the name of the related state variable for this argument.
      Returns:
      related state variable name
    • getRelatedStateVariable

      public StateVariable getRelatedStateVariable()
      Gets the related state variable for this argument.
      Returns:
      state variable object, or null if not found
    • getArgumentData

      private ArgumentData getArgumentData()
      Gets the argument data associated with this argument.
      Returns:
      argument data object
    • setValue

      public void setValue(String value)
      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

      public String getValue()
      Gets the string value of this argument.
      Returns:
      argument value as string
    • getIntegerValue

      public int getIntegerValue()
      Gets the integer value of this argument.
      Returns:
      argument value as integer, or 0 if parsing fails
    • setUserData

      public void setUserData(Object data)
      Sets user-defined data for this argument.
      Parameters:
      data - data to set
    • getUserData

      public Object getUserData()
      Gets the user-defined data associated with this argument.
      Returns:
      user data object