org.progeeks.meta
Class ClassEnumeratedPropertyType

java.lang.Object
  extended by org.progeeks.meta.ClassPropertyType
      extended by org.progeeks.meta.ClassEnumeratedPropertyType
All Implemented Interfaces:
java.io.Serializable, EnumeratedPropertyType, PropertyType
Direct Known Subclasses:
HibernateAnnotations.AccessPropertyType, HibernateAnnotations.CascadePropertyType, HibernateAnnotations.FetchPropertyType, HibernateAnnotations.LazyPropertyType, HibernateAnnotations.OptimisticLockingPropertyType, HibernateAnnotations.PolymorphismPropertyType, HibernateAnnotations.UnsavedValuePropertyType, MonthType

public class ClassEnumeratedPropertyType
extends ClassPropertyType
implements EnumeratedPropertyType

Extends ClassPropertyType to implement the EnumeratedPropertyType interface. Usually the value list is a list of integer objects for normal enumerated type, but the values can be anything. Almost universally, this class will be subclassed to a specific type.

Version:
$Revision: 1.5 $
Author:
Paul Speed
See Also:
Serialized Form

Constructor Summary
ClassEnumeratedPropertyType(java.lang.Class type, java.lang.Object[] values)
           
ClassEnumeratedPropertyType(int[] ints)
          Creates a new enumerated type of integer that only allows a set of Integer values converted from the specified array of ints.
ClassEnumeratedPropertyType(java.lang.Integer[] values)
          Creates a new enumerated type of integer that only allows the specified Integer values.
 
Method Summary
 java.util.List getEnumeratedValues()
          Returns the list of acceptable values.
 boolean isEnumeratedValue(java.lang.Object object)
          Returns true if the specified value is a valid value for this enumerated type.
 boolean isInstance(java.lang.Object obj)
          Returns true if the specified object is an instance of this type and also a valid enumerated value.
protected  PropertyType wrapRawSuperType(java.lang.Object o)
          Called to wrap the specified class in a PropertyType.
 
Methods inherited from class org.progeeks.meta.ClassPropertyType
convertPrimitive, createRawSuperTypeIterator, equals, getBaseClass, getSuperTypes, hashCode, isAssignableFrom, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.progeeks.meta.PropertyType
getBaseClass, getSuperTypes, isAssignableFrom
 

Constructor Detail

ClassEnumeratedPropertyType

public ClassEnumeratedPropertyType(java.lang.Integer[] values)
Creates a new enumerated type of integer that only allows the specified Integer values.


ClassEnumeratedPropertyType

public ClassEnumeratedPropertyType(int[] ints)
Creates a new enumerated type of integer that only allows a set of Integer values converted from the specified array of ints. The base class will be Integer.TYPE primitive class.


ClassEnumeratedPropertyType

public ClassEnumeratedPropertyType(java.lang.Class type,
                                   java.lang.Object[] values)
Method Detail

isInstance

public boolean isInstance(java.lang.Object obj)
Returns true if the specified object is an instance of this type and also a valid enumerated value.

Specified by:
isInstance in interface PropertyType
Overrides:
isInstance in class ClassPropertyType

getEnumeratedValues

public java.util.List getEnumeratedValues()
Returns the list of acceptable values.

Specified by:
getEnumeratedValues in interface EnumeratedPropertyType

isEnumeratedValue

public boolean isEnumeratedValue(java.lang.Object object)
Returns true if the specified value is a valid value for this enumerated type.

Specified by:
isEnumeratedValue in interface EnumeratedPropertyType

wrapRawSuperType

protected PropertyType wrapRawSuperType(java.lang.Object o)
Called to wrap the specified class in a PropertyType.

Overrides:
wrapRawSuperType in class ClassPropertyType


Copyright © 2002-2003 Paul Speed. All Rights Reserved.