java.lang.Object
org.cybergarage.upnp.xml.NodeData
org.cybergarage.upnp.xml.StateVariableData

public class StateVariableDataextends NodeData
Data container for UPnP state variable information.

This class extends NodeData to represent state variable definitions from UPnP service descriptions. It encapsulates metadata about state variables including their current values, data types, and query listeners.

Key features:

  • State variable value storage
  • Query listener management
  • XML node data inheritance
  • Service description integration
  • Variable metadata handling

This class is used by UPnP services to manage state variable definitions and their current values, enabling proper service description generation and query response handling.

  • Field Details

    • value

      private String value
      /////////////////////////////////////////////
    • queryListener

      private QueryListener queryListener
      /////////////////////////////////////////////
    • queryRes

      private QueryResponse queryRes
      /////////////////////////////////////////////
  • Constructor Details

    • StateVariableData

      public StateVariableData()
      Creates a variable with no value, listener or response attached.
  • Method Details

    • getValue

      public String getValue()
      Fetches the value this variable currently holds.
      Returns:
      the current value, empty until a query response supplies one
    • setValue

      public void setValue(String value)
      Records the value this variable holds.
      Parameters:
      value - the value to hold for this variable
    • getQueryListener

      public QueryListener getQueryListener()
      Fetches the listener notified when this variable is queried.
      Returns:
      the listener notified when this variable is queried, or null if none is registered
    • setQueryListener

      public void setQueryListener(QueryListener queryListener)
      Registers the listener notified on each query of this variable.
      Parameters:
      queryListener - the listener to notify on each query
    • getQueryResponse

      public QueryResponse getQueryResponse()
      Fetches the response to the last query of this variable.
      Returns:
      the response from the last query, or null if never queried
    • setQueryResponse

      public void setQueryResponse(QueryResponse res)
      Retains a response to the last query of this variable.
      Parameters:
      res - the response to retain for this variable