java.lang.Object
org.cybergarage.upnp.AllowedValue

public class AllowedValueextends Object
Represents an allowed value constraint for UPnP state variables.

This class encapsulates allowed value definitions from UPnP service descriptions. It provides XML node management for state variables that have enumerated or restricted value sets defined in their service descriptions.

Key features:

  • XML node wrapping for allowed values
  • Element name constant for XML parsing
  • Service description integration
  • State variable constraint management
  • UPnP specification compliance

This class is used by UPnP services to manage allowed value constraints for state variables, enabling proper validation and description generation for variables with restricted value sets.

  • Field Details

    • ELEM_NAME

      public static final String ELEM_NAME
      XML element name for allowed value in UPnP descriptions.
      See Also:
    • allowedValueNode

      private Node allowedValueNode
      The underlying XML node containing the allowed value data.
  • Constructor Details

    • AllowedValue

      public AllowedValue(Node node)
      Create an AllowedValue wrapping the given XML node.
      Parameters:
      node - the XML node containing the allowed value
    • AllowedValue

      public AllowedValue(String value)
      Create an AllowedValue by the value String, and will create the Node structure by itself
      Parameters:
      value - The value that will be associate to this object
  • Method Details

    • getAllowedValueNode

      public Node getAllowedValueNode()
      Get the underlying XML node.
      Returns:
      the underlying XML node
    • isAllowedValueNode

      public static boolean isAllowedValueNode(Node node)
      Checks if the given node is an allowedValue element.
      Parameters:
      node - the XML node to check
      Returns:
      true if the node is an allowedValue element
    • setValue

      public void setValue(String value)
      Sets the value for this allowed value element.
      Parameters:
      value - the value string to set
    • getValue

      public String getValue()
      Get the value string.
      Returns:
      the value string