org.pfsw.odem
Class TypeDependency<S extends IType,T extends IType>

java.lang.Object
  extended by org.pfsw.odem.TypeDependency<S,T>
All Implemented Interfaces:
IDependency<S,T>, IObjectProperties

public abstract class TypeDependency<S extends IType,T extends IType>
extends java.lang.Object
implements IDependency<S,T>

This abstract dependency class implements some convenience methods to find out the kind of dependency between two types.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
TypeDependency()
          Initialize the new instance with default values.
 
Method Summary
 boolean isDerived()
          Returns true if the source type of this dependency either extends or implements the target type.
 boolean isExtension()
          Returns true if the source type of this dependency extends the target type.
 boolean isImplementation()
          Returns true if the source type of this dependency implements the target (interface) type.
 boolean isParamTypeInMethod()
          Returns true if the target type of this dependency is the type of a method parameter in one of the source type's methods.
 boolean isReferencedInMethodSignature()
          Returns true if the target type of this dependency is used in one of the source type's methods.
 boolean isReturnTypeOfMethod()
          Returns true if the target type of this dependency is the type of a method parameter in one of the source type's methods.
 boolean isTypeOfField()
          Returns true if the target type of this dependency is the type of a field (i.e. instance variable or static variable) in source type.
 boolean isTypeOfLocalVariable()
          Returns true if the target type of this dependency is the type of a local variable (i.e. a field declared locally inside a method) in source type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pfsw.odem.IDependency
getDependencyClassification, getSourceElement, getTargetElement
 
Methods inherited from interface org.pfsw.odem.IObjectProperties
getProperty, getPropertyNames, setProperty
 

Constructor Detail

TypeDependency

public TypeDependency()
Initialize the new instance with default values.

Method Detail

isReferencedInMethodSignature

public boolean isReferencedInMethodSignature()
Returns true if the target type of this dependency is used in one of the source type's methods.


isDerived

public boolean isDerived()
Returns true if the source type of this dependency either extends or implements the target type.


isParamTypeInMethod

public boolean isParamTypeInMethod()
Returns true if the target type of this dependency is the type of a method parameter in one of the source type's methods.


isReturnTypeOfMethod

public boolean isReturnTypeOfMethod()
Returns true if the target type of this dependency is the type of a method parameter in one of the source type's methods.


isTypeOfField

public boolean isTypeOfField()
Returns true if the target type of this dependency is the type of a field (i.e. instance variable or static variable) in source type.


isTypeOfLocalVariable

public boolean isTypeOfLocalVariable()
Returns true if the target type of this dependency is the type of a local variable (i.e. a field declared locally inside a method) in source type.


isExtension

public boolean isExtension()
Returns true if the source type of this dependency extends the target type.


isImplementation

public boolean isImplementation()
Returns true if the source type of this dependency implements the target (interface) type.