org.apache.bval.model
Class DynaTypeEnum

java.lang.Object
  extended by org.apache.bval.model.DynaTypeEnum
All Implemented Interfaces:
Type, DynaType

public class DynaTypeEnum
extends Object
implements DynaType

Description: ("artificial" enum with custom values).


Nested Class Summary
static class DynaTypeEnum.Value
          Represents a single "enum" instance (= the value).
 
Constructor Summary
DynaTypeEnum(Class<?> enumClass)
          Create a new DynaTypeEnum instance.
DynaTypeEnum(Class<?> enumClass, String... names)
          Create a new DynaTypeEnum instance.
 
Method Summary
 DynaTypeEnum.Value[] getEnumConstants()
          Get the emulated constants.
 String getName()
          Get the name of the enum class.
 Class<?> getRawType()
          Resolve the type indirection.
 boolean isAssignableFrom(Class<?> cls)
          Learn whether the wrapped class is assignable from cls.
 boolean isEnum()
          Learn whether the referred class is, in fact, an enum class.
 void setEnumNames(String[] names)
          Set the enumeration value names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynaTypeEnum

public DynaTypeEnum(Class<?> enumClass)
Create a new DynaTypeEnum instance.

Parameters:
enumClass -

DynaTypeEnum

public DynaTypeEnum(Class<?> enumClass,
                    String... names)
Create a new DynaTypeEnum instance.

Parameters:
enumClass -
names -
Method Detail

setEnumNames

public void setEnumNames(String[] names)
Set the enumeration value names.

Parameters:
names -

getName

public String getName()
Get the name of the enum class.

Returns:
String

getRawType

public Class<?> getRawType()
Resolve the type indirection.

Specified by:
getRawType in interface DynaType
Returns:
Type

isEnum

public boolean isEnum()
Learn whether the referred class is, in fact, an enum class. used by freemarker-template "bean-infos-json.ftl"


getEnumConstants

public DynaTypeEnum.Value[] getEnumConstants()
Get the emulated constants. used by freemarker-template "bean-infos-json.ftl"

Returns:
Value[]

isAssignableFrom

public boolean isAssignableFrom(Class<?> cls)
Learn whether the wrapped class is assignable from cls.

Parameters:
cls -
Returns:
boolean


Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.