java.lang.Object
org.cybergarage.upnp.xml.NodeData
org.cybergarage.upnp.xml.StateVariableData
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 Summary
FieldsModifier and TypeFieldDescriptionprivate QueryListener/////////////////////////////////////////////private QueryResponse/////////////////////////////////////////////private String/////////////////////////////////////////////Constructor Summary
ConstructorsConstructorDescriptionCreates a variable with no value, listener or response attached.Method Summary
All MethodsModifier and TypeMethodDescriptionFetches the listener notified when this variable is queried.Fetches the response to the last query of this variable.getValue()Fetches the value this variable currently holds.voidsetQueryListener(QueryListener queryListener) Registers the listener notified on each query of this variable.voidRetains a response to the last query of this variable.voidRecords the value this variable holds.
Field Details
value
/////////////////////////////////////////////queryListener
/////////////////////////////////////////////queryRes
/////////////////////////////////////////////
Constructor Details
StateVariableData
public StateVariableData()Creates a variable with no value, listener or response attached.
Method Details
getValue
Fetches the value this variable currently holds.- Returns:
- the current value, empty until a query response supplies one
setValue
Records the value this variable holds.- Parameters:
value- the value to hold for this variable
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
Registers the listener notified on each query of this variable.- Parameters:
queryListener- the listener to notify on each query
getQueryResponse
Fetches the response to the last query of this variable.- Returns:
- the response from the last query, or null if never queried
setQueryResponse
Retains a response to the last query of this variable.- Parameters:
res- the response to retain for this variable