Klasse UpnpHeader<T>

java.lang.Object
org.jupnp.model.message.header.UpnpHeader<T>
Bekannte direkte Unterklassen:
AVClientInfoHeader, CallbackHeader, ContentRangeHeader, ContentTypeHeader, DeviceTypeHeader, DeviceUSNHeader, EventSequenceHeader, EXTHeader, HostHeader, InterfaceMacHeader, LocationHeader, MANHeader, MaxAgeHeader, MXHeader, NTEventHeader, NTSHeader, PragmaHeader, RangeHeader, RootDeviceHeader, ServerHeader, ServiceTypeHeader, ServiceUSNHeader, SoapActionHeader, STAllHeader, SubscriptionIdHeader, TimeoutHeader, UDNHeader, UserAgentHeader, USNRootDeviceHeader

public abstract class UpnpHeader<T> extends Object
Transforms known and standardized UPnP/HTTP headers from/to string representation.

The newInstance(org.jupnp.model.message.header.UpnpHeader.Type, String) method attempts to instantiate the best header subtype for a given header (name) and string value.

Autor:
Christian Bauer
  • Konstruktordetails

    • UpnpHeader

      public UpnpHeader()
  • Methodendetails

    • setValue

      public void setValue(T value)
    • getValue

      public T getValue()
    • setString

      public abstract void setString(String s) throws InvalidHeaderException
      Parameter:
      s - This header's value as a string representation.
      Löst aus:
      InvalidHeaderException - If the value is invalid for this UPnP header.
    • getString

      public abstract String getString()
      Gibt zurück:
      A string representing this header's value.
    • newInstance

      public static UpnpHeader newInstance(UpnpHeader.Type type, String headerValue)
      Create a new instance of a UpnpHeader subtype that matches the given type and value.

      This method iterates through all potential header subtype classes as declared in UpnpHeader.Type. It creates a new instance of the subtype class and calls its setString(String) method. If no InvalidHeaderException is thrown, the subtype instance is returned.

      Parameter:
      type - The type (or name) of the header.
      headerValue - The value of the header.
      Gibt zurück:
      The best matching header subtype instance, or null if no subtype can be found.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object