org.teleal.cling.model.message.header
Class UpnpHeader<T>
java.lang.Object
org.teleal.cling.model.message.header.UpnpHeader<T>
- Direct Known Subclasses:
- CallbackHeader, ContentTypeHeader, DeviceTypeHeader, DeviceUSNHeader, EventSequenceHeader, EXTHeader, HostHeader, InterfaceMacHeader, LocationHeader, MANHeader, MaxAgeHeader, MXHeader, NTEventHeader, NTSHeader, RootDeviceHeader, ServerHeader, ServiceTypeHeader, ServiceUSNHeader, SoapActionHeader, STAllHeader, SubscriptionIdHeader, TimeoutHeader, UDNHeader, USNRootDeviceHeader
public abstract class UpnpHeader<T>
- extends Object
Transforms known and standardized UPnP/HTTP headers from/to string representation.
The newInstance(org.teleal.cling.model.message.header.UpnpHeader.Type, String)
method
attempts to instantiate the best header subtype for a given header (name) and string value.
- Author:
- Christian Bauer
Nested Class Summary |
static class |
UpnpHeader.Type
Maps a standardized UPnP header to potential header subtypes. |
UpnpHeader
public UpnpHeader()
setValue
public void setValue(T value)
getValue
public T getValue()
setString
public abstract void setString(String s)
throws InvalidHeaderException
- Parameters:
s
- This header's value as a string representation.
- Throws:
InvalidHeaderException
- If the value is invalid for this UPnP header.
getString
public abstract String getString()
- Returns:
- 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.
- Parameters:
type
- The type (or name) of the header.headerValue
- The value of the header.
- Returns:
- The best matching header subtype instance, or
null
if no subtype can be found.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.