org.pfsw.odem
Interface IType

All Superinterfaces:
IExplorableElement, IExplorableElementVisiting, IExplorationModelObject, IObjectProperties
All Known Implementing Classes:
ClassInformation

public interface IType
extends IExplorableElement

Represents a type such as a class, an interface, an enumeration and so on.

Version:
1.1
Author:
M.Duchrow

Field Summary
static IType[] EMPTY_TYPE_ARRAY
          An empty array of IType elements that can be used as return value in implementations whenever an empty array is needed.
 
Method Summary
 TypeClassification getClassification()
          Returns the classification (i.e.
 DependencySet<IType,IType> getDependencies()
          Returns all dependencies to other types.
 java.util.Collection<IType> getDirectReferredTypes()
          Returns all types this type directly depends on.
 INamespace getNamespace()
          Returns the namespace the type belongs to.
 java.lang.String getUnqualifiedName()
          Returns the name without the namespace
 Visibility getVisibility()
          Returns the visibility of this type.
 boolean isAbstract()
          Returns whether or not this type is abstract.
 boolean isDirectExtensionOf(IType type)
          Returns true if this type extends the given type directly.
 boolean isDirectImplementorOf(IType type)
          Returns true if this type directly implements the given type.
 boolean isFinal()
          Returns whether or not this type is final.
 
Methods inherited from interface org.pfsw.odem.IExplorationModelObject
getContext, getName
 
Methods inherited from interface org.pfsw.odem.IObjectProperties
getProperty, getPropertyNames, setProperty
 
Methods inherited from interface org.pfsw.odem.IExplorableElementVisiting
accept, acceptTypes
 

Field Detail

EMPTY_TYPE_ARRAY

static final IType[] EMPTY_TYPE_ARRAY
An empty array of IType elements that can be used as return value in implementations whenever an empty array is needed.

Method Detail

getClassification

TypeClassification getClassification()
Returns the classification (i.e. CLASS, INTERFACE, ANNOTAION, ENUM) of this type.


getNamespace

INamespace getNamespace()
Returns the namespace the type belongs to.


getUnqualifiedName

java.lang.String getUnqualifiedName()
Returns the name without the namespace


getDirectReferredTypes

java.util.Collection<IType> getDirectReferredTypes()
Returns all types this type directly depends on. Each type must be only once in the result collection. This method never returns null.

This is a convenience method that allows to work on the referred types rather than the more detailed information provided by the result of getDependencies().

Returns:
A collection zero or many referred types without duplicates

isDirectExtensionOf

boolean isDirectExtensionOf(IType type)
Returns true if this type extends the given type directly.

This is a convenient method to avoid the necessity of always iterating over the dependencies provided by getDependencies() if one wants to find out if there is a direct inheritance relationship.

Parameters:
type - Any type that can be extended.
Returns:
true if this type is a direct extension of the given type.
See Also:
isDirectImplementorOf(IType), getDependencies()

isDirectImplementorOf

boolean isDirectImplementorOf(IType type)
Returns true if this type directly implements the given type. If the given type is not an interface false wiil be returned.

This is a convenient method to avoid the necessity of always iterating over the dependencies provided by getDependencies() if one wants to find out if there is a direct implementation relationship.

Parameters:
type - An interface type
Returns:
true if this type is a direct implementor of the given interface type.
See Also:
isDirectExtensionOf(IType), getDependencies()

getDependencies

DependencySet<IType,IType> getDependencies()
Returns all dependencies to other types. That include all different dependencies to the same type (fields, method signatures, inheritance etc.).
To get just the different types without duplicates this type depends on use getDirectReferredTypes().


isFinal

boolean isFinal()
Returns whether or not this type is final.


isAbstract

boolean isAbstract()
Returns whether or not this type is abstract.


getVisibility

Visibility getVisibility()
Returns the visibility of this type. Or course only the visibilities Visibility.PUBLIC and Visibility.DEFAULT are reasonable return values here.