Login | Register
My pages Projects Community openCollabNet

The Tigris site will receive a major upgrade the evening of Monday, December 1, beginning at 8:30 pm PST. Downtime is projected to be about ten hours. Further details in the announcement


jmt.codebase
Interface ReferenceManager


public interface ReferenceManager

Describes a reference manager containing references of the ClassReference, the FieldReference and the MethodReference type.

By definition the reference manager references to every imagnable class, interface, field or method. To reflect that behaviour every getXXXRef method returns a valid reference everytime it is used. So the getXXXRef methods will create a new Reference instance if the requested reference is not known to the reference manager.
To check if the manager already knows the reference use the isContainingXXXRef methods.

Author:
Martin Kersten
See Also:
ReferenceFactory, Reference, AbstractReferenceManager

Method Summary
 ClassReference getClassRef(ClassName name)
          Returns the reference of a class or interface with the given name.
 FieldReference getFieldRef(ClassReference owner, java.lang.String name)
          Returns a reference of a field with the given name and owned by the referred owner.
 MethodReference getMethodRef(ClassReference owner, java.lang.String name, MethodParameters parameters)
          Returns a reference of a method with the given name and parameter signature, and owned by the referred owner.
 boolean isContainingClassRef(ClassName name)
          Returns true if the manager contains a reference of the class described by the given name.
 boolean isContainingFieldRef(ClassReference owner, java.lang.String name)
          Returns true if the manager contains a reference of the field described by the given name and its owner.
 boolean isContainingMethodRef(ClassReference owner, java.lang.String name, MethodParameters parameters)
          Returns true if the manager contains a reference of the method described by the given name and the given parameter signature, and its owner.
 

Method Detail

getClassRef

public ClassReference getClassRef(ClassName name)
Returns the reference of a class or interface with the given name. If the name describes an array a ArrayReference instance will be returned.

Parameters:
name - The name of the class or interface
Returns:
A refence referring to the class or interface with the given name

getFieldRef

public FieldReference getFieldRef(ClassReference owner,
                                  java.lang.String name)
Returns a reference of a field with the given name and owned by the referred owner.

Parameters:
owner - A class reference of the class or interface owning the described field
name - The name of the field
Returns:
A reference of the specified field

getMethodRef

public MethodReference getMethodRef(ClassReference owner,
                                    java.lang.String name,
                                    MethodParameters parameters)
Returns a reference of a method with the given name and parameter signature, and owned by the referred owner.

Parameters:
owner - A class reference of the class or interface owning the described method
name - The name of the method
parameters - The parameter signature of the method
Returns:
A reference of the specified method

isContainingClassRef

public boolean isContainingClassRef(ClassName name)
Returns true if the manager contains a reference of the class described by the given name.

Parameters:
name - The name of the class or interface
Returns:
true if the manager contains the class reference

isContainingFieldRef

public boolean isContainingFieldRef(ClassReference owner,
                                    java.lang.String name)
Returns true if the manager contains a reference of the field described by the given name and its owner.

Parameters:
owner - A class reference of the class or interface owning the described field
name - The name of the field
Returns:
true if the manager contains the field reference

isContainingMethodRef

public boolean isContainingMethodRef(ClassReference owner,
                                     java.lang.String name,
                                     MethodParameters parameters)
Returns true if the manager contains a reference of the method described by the given name and the given parameter signature, and its owner.

Parameters:
owner - A class reference of the class or interface owning the described method
name - The name of the method
parameters - The parameter signature of the method
Returns:
true if the manager contains the method reference