org.teleal.cling.model.types
Class BinHexDatatype

java.lang.Object
  extended by org.teleal.cling.model.types.AbstractDatatype<Byte[]>
      extended by org.teleal.cling.model.types.BinHexDatatype
All Implemented Interfaces:
Datatype<Byte[]>

public class BinHexDatatype
extends AbstractDatatype<Byte[]>

Author:
Christian Bauer

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.teleal.cling.model.types.Datatype
Datatype.Builtin, Datatype.Default
 
Constructor Summary
BinHexDatatype()
           
 
Method Summary
 String getString(Byte[] value)
          Transforms a value supported by this datatype into a string representation.
 Class<Byte[]> getValueType()
           
 Byte[] valueOf(String s)
          Transforms a string representation into a value of the supported type.
 
Methods inherited from class org.teleal.cling.model.types.AbstractDatatype
getBuiltin, getDisplayString, isValid, setBuiltin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinHexDatatype

public BinHexDatatype()
Method Detail

getValueType

public Class<Byte[]> getValueType()
Overrides:
getValueType in class AbstractDatatype<Byte[]>

valueOf

public Byte[] valueOf(String s)
               throws InvalidValueException
Description copied from interface: Datatype
Transforms a string representation into a value of the supported type.

Parameters:
s - The string representation of a value.
Returns:
The converted value or null if the string was null or empty.
Throws:
InvalidValueException - If the string couldn't be parsed.

getString

public String getString(Byte[] value)
                 throws InvalidValueException
Description copied from interface: Datatype
Transforms a value supported by this datatype into a string representation.

This method calls Datatype.isValid(Object) before converting the value, it throws an exception if validation fails.

Specified by:
getString in interface Datatype<Byte[]>
Overrides:
getString in class AbstractDatatype<Byte[]>
Parameters:
value - The value to transform.
Returns:
The transformed value as a string, or an empty string when the value is null, never returns null.
Throws:
InvalidValueException


Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.