org.progeeks.meta
Class DeferredPropertyType

java.lang.Object
  extended by org.progeeks.meta.DeferredPropertyType
All Implemented Interfaces:
java.io.Serializable, PropertyType

public class DeferredPropertyType
extends java.lang.Object
implements PropertyType

Represents an unresolved property type of a meta-object. This is to support deferred resolution of property types within a meta-class. The actual functionality of the PropertyType implementation throws UnsupportedOperationExceptions since these operations cannot be done without resolving the type. When the type has been resolved within the meta-class it will be replaced with the real type.

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

Constructor Summary
DeferredPropertyType(java.lang.String metaClassName)
          Creates a deferred type the will resolve to the specified meta-class when resolution is requested.
DeferredPropertyType(java.lang.String metaClassName, PropertyType alternateType)
          Creates a deferred type the will resolve to the specified meta-class when resolution is requested.
 
Method Summary
 java.lang.Class getBaseClass()
          Returns the Java class upon which this property type is based.
 java.util.Iterator getSuperTypes()
          Returns an iterator containing all potential supertypes for this type.
 boolean isAssignableFrom(PropertyType type)
          Returns true if the specified type is the same as or a subclass of this property type.
 boolean isInstance(java.lang.Object obj)
          Returns true if the specified object is an instance of this type.
 PropertyType resolveType(MetaClassRegistry registry)
          Returns the replacement property type as can be resolved from the specified class registry.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeferredPropertyType

public DeferredPropertyType(java.lang.String metaClassName)
Creates a deferred type the will resolve to the specified meta-class when resolution is requested. If the meta-class does not exist then an exception will be thrown.


DeferredPropertyType

public DeferredPropertyType(java.lang.String metaClassName,
                            PropertyType alternateType)
Creates a deferred type the will resolve to the specified meta-class when resolution is requested. If the meta-class does not exist then the alternate type is returned.

Method Detail

resolveType

public PropertyType resolveType(MetaClassRegistry registry)
Returns the replacement property type as can be resolved from the specified class registry.


getBaseClass

public java.lang.Class getBaseClass()
Returns the Java class upon which this property type is based.

Specified by:
getBaseClass in interface PropertyType

isInstance

public boolean isInstance(java.lang.Object obj)
Returns true if the specified object is an instance of this type.

Specified by:
isInstance in interface PropertyType

isAssignableFrom

public boolean isAssignableFrom(PropertyType type)
Returns true if the specified type is the same as or a subclass of this property type. This method will always return false if the specified type is not a ClassPropertyType instance or subclass instance.

Specified by:
isAssignableFrom in interface PropertyType

getSuperTypes

public java.util.Iterator getSuperTypes()
Returns an iterator containing all potential supertypes for this type.

Specified by:
getSuperTypes in interface PropertyType

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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