org.progeeks.meta
Class MetaClassPropertyType

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

public class MetaClassPropertyType
extends java.lang.Object
implements PropertyType

Property type implementation that represents a meta class object.

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

Constructor Summary
MetaClassPropertyType(MetaClass type)
           
MetaClassPropertyType(java.lang.String typeName)
          Constructs a new MetaClassPropertyType using the specified meta-class name passed to MetaClass.forName().
 
Method Summary
protected  boolean equals(MetaClassPropertyType obj)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Class getBaseClass()
          Returns the Java class upon which this property type is based.
 MetaClass getMetaClass()
          Returns the MetaClass to which this property type refers.
 java.util.Iterator getSuperTypes()
          Returns an iterator containing all potential supertypes for this type.
 int hashCode()
           
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaClassPropertyType

public MetaClassPropertyType(MetaClass type)

MetaClassPropertyType

public MetaClassPropertyType(java.lang.String typeName)
Constructs a new MetaClassPropertyType using the specified meta-class name passed to MetaClass.forName(). Use DeferredPropertyType instead when defining meta-classes. This constructor is for runtime type construction for registries and the like.

Method Detail

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

getMetaClass

public MetaClass getMetaClass()
Returns the MetaClass to which this property type refers.


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 MetaClassPropertyType 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. Returns this meta-class's supertypes, then they're super-types and so on. It tries to keep the distance from the starting type consistent so does a modified bredth-first iteration up the class hierarchy.

Specified by:
getSuperTypes in interface PropertyType

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

protected boolean equals(MetaClassPropertyType obj)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

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


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