commonj.sdo
Interface Type

All Known Subinterfaces:
EType
All Known Implementing Classes:
ETypeImpl

public interface Type

A representation of the type of a property of a data object.


Method Summary
 Class getInstanceClass()
          Returns the Java class that this type represents.
 String getName()
          Returns the name of the type.
 List getProperties()
          Returns the list of the properties of this type.
 Property getProperty(String propertyName)
          Returns from all the properties of this type, the one with the specified name.
 String getURI()
          Returns the namespace URI of the type.
 boolean isInstance(Object object)
          Returns whether the specified object is an instance of this type.
 

Method Detail

getName

public String getName()
Returns the name of the type.

Returns:
the type name.

getURI

public String getURI()
Returns the namespace URI of the type.

Returns:
the namespace URI.

getInstanceClass

public Class getInstanceClass()
Returns the Java class that this type represents.

Returns:
the Java class.

isInstance

public boolean isInstance(Object object)
Returns whether the specified object is an instance of this type.

Parameters:
object - the object in question.
Returns:
true if the object is an instance.
See Also:
Class.isInstance(java.lang.Object)

getProperties

public List getProperties()
Returns the list of the properties of this type.

The expression

   type.getProperties().indexOf(property)
yields the property's index relative to this type. As such, these expressions are equivalent:
    dataObject.get(i)
    dataObject.get((Property)dataObject.getType().getProperties().get(i));

Returns:
the properties of the type.
See Also:
Property.getContainingType()

getProperty

public Property getProperty(String propertyName)
Returns from all the properties of this type, the one with the specified name. As such, these expressions are equivalent:
    dataObject.get("name")
    dataObject.get(dataObject.getType().getProperty("name"))

Returns:
the property with the specified name.
See Also:
getProperties()

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.