org.yaml.snakeyaml
Class TypeDescription

java.lang.Object
  extended by org.yaml.snakeyaml.TypeDescription

public final class TypeDescription
extends Object

Provides additional runtime information necessary to create a custom Java instance.


Constructor Summary
TypeDescription(Class<? extends Object> clazz)
           
TypeDescription(Class<? extends Object> clazz, String tag)
           
 
Method Summary
 Class<? extends Object> getListPropertyType(String property)
          Get class of List values for provided JavaBean property.
 Class<? extends Object> getMapKeyType(String property)
          Get keys type info for this JavaBean
 Class<? extends Object> getMapValueType(String property)
          Get values type info for this JavaBean
 String getTag()
          Get tag which shall be used to load or dump the type (class).
 Class<? extends Object> getType()
          Get represented type (class)
 boolean isRoot()
          Defines whether this type (class) is the root of the YAML document
 void putListPropertyType(String property, Class<? extends Object> type)
          Specify that the property is a type-safe List.
 void putMapPropertyType(String property, Class<? extends Object> key, Class<? extends Object> value)
          Specify that the property is a type-safe Map.
 void setRoot(boolean root)
          Specify whether this type (class) should be serve as the root of the YAML document
 void setTag(String tag)
          Set tag to be used to load or dump the type (class).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeDescription

public TypeDescription(Class<? extends Object> clazz,
                       String tag)

TypeDescription

public TypeDescription(Class<? extends Object> clazz)
Method Detail

getTag

public String getTag()
Get tag which shall be used to load or dump the type (class).

Returns:
tag to be used. It may be a tag for Language-Independent Types (http://www.yaml.org/type/)

setTag

public void setTag(String tag)
Set tag to be used to load or dump the type (class).

Parameters:
tag - local or global tag

getType

public Class<? extends Object> getType()
Get represented type (class)

Returns:
type (class) to be described.

isRoot

public boolean isRoot()
Defines whether this type (class) is the root of the YAML document

Returns:
true if this type shall be used as a root of object hierarchy.

setRoot

public void setRoot(boolean root)
Specify whether this type (class) should be serve as the root of the YAML document

Parameters:
root - true if this type shall be used as a root of object hierarchy.

putListPropertyType

public void putListPropertyType(String property,
                                Class<? extends Object> type)
Specify that the property is a type-safe List.

Parameters:
property - name of the JavaBean property
type - class of List values

getListPropertyType

public Class<? extends Object> getListPropertyType(String property)
Get class of List values for provided JavaBean property.

Parameters:
property - property name
Returns:
class of List values

putMapPropertyType

public void putMapPropertyType(String property,
                               Class<? extends Object> key,
                               Class<? extends Object> value)
Specify that the property is a type-safe Map.

Parameters:
property - property name of this JavaBean
key - class of keys in Map
value - class of values in Map

getMapKeyType

public Class<? extends Object> getMapKeyType(String property)
Get keys type info for this JavaBean

Parameters:
property - property name of this JavaBean
Returns:
class of keys in the Map

getMapValueType

public Class<? extends Object> getMapValueType(String property)
Get values type info for this JavaBean

Parameters:
property - property name of this JavaBean
Returns:
class of values in the Map

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2009. All Rights Reserved.