class

File class.str
Author Martin Bravenboer <martin@cs.uu.nl>
Since unknown

Abstract class that represents a Java Class.

Concrete implementations of this class are for example bytecode-class and source-class.




Statistics


General
Lines of code 871
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 77 (96% documented)
Rule number 0
DynamicRule number 0



Strategy summary


add-declared-member-type(ATerm class) n/a class.str
get-canonical-name Returns the canonical name of this class class.str
get-constructors Returns all constructors of this class, including superclasses class.str
get-declared-constructor-list Returns a list of the constructors declared in this class class.str
get-declared-constructors Returns a list of the constructors declared in this class class.str
get-declared-field(ATerm name) Returns the field 'name', which must be declared in this class class.str
get-declared-field-table Private class.str
get-declared-fields n/a class.str
get-declared-member-type(ATerm name) Returns the type 'name', which must be declared in this class class.str
get-declared-member-type-table Private class.str
get-declared-member-types Returns all the member types declared in this class class.str
get-declared-method-table Returns a hashtable of the methods declared in this class class.str
get-declared-methods Returns a list of the methods declared in this class class.str
get-declared-methods(ATerm name) Returns the methods 'name', which must be declared in this class class.str
get-enclosing-class n/a class.str
get-field(ATerm name) Returns the field for the given name class.str
get-fields Returns all fields of this class, including those inherited from superclasses and superinterfaces class.str
get-fields(ATerm name) Returns all the visible fields with the given name class.str
get-formal-type-parameter(ATerm name) Returns the type parameter of the given name, or fails if this class thus have a type parameter with this name class.str
get-formal-type-parameters Abstract method class.str
get-fully-qualified-name Returns the canonical name of this class, which is a fully qualified name class.str
get-inherited-fields Returns all fields of this class that are inherited from superclasses and superinterfaces class.str
get-inherited-fields(ATerm name) Returns all fields of this class that are inherited from superclasses and superinterfaces class.str
get-inherited-member-types Returns all member types of this class that are inherited from superclasses and superinterfaces class.str
get-inherited-member-types(ATerm name) Returns all member types of this class with the given name that are inherited from superclasses and superinterfaces class.str
get-inherited-methods Returns all methods of this class that are inherited from superclasses and superinterfaces class.str
get-inherited-methods(ATerm name) Returns all methods of this class with this name that are inherited from superclasses and superinterfaces class.str
get-member-type(ATerm name) Returns the member type of this class with this name class.str
get-member-types Returns all member types of this class class.str
get-member-types(ATerm name) Returns the member types of this class with this name class.str
get-methods Returns all member methods of this class class.str
get-methods(ATerm name) Returns all member methods of this class with this name class.str
get-name Returns the canonical name of this class class.str
get-simple-name Returns the simple name of this class class.str
get-superclass Returns the super class of this class class.str
get-superclass(ATerm intype) Superclass of a parameterized types class.str
get-superclass(ATerm intype) Superclass of a raw type class.str
get-superclass(ATerm intype) Superclass of a unparameterized type class.str
get-superclass-as-type Returns the super class of this class as a type class.str
get-superclass-type n/a class.str
get-superinterfaces Returns the direct super interfaces class.str
get-superinterfaces(ATerm intype) n/a class.str
get-superinterfaces(ATerm intype) Superclass of a raw type class.str
get-superinterfaces(ATerm intype) Superclass of a unparameterized type class.str
get-superinterfaces-as-type Returns the interfaces implemented by this class as types class.str
has-declared-field(ATerm name) Succeeds if the current class declares a field with this name class.str
has-declared-member-type(ATerm name) Succeeds if the current class declares a class with this name class.str
has-declared-method(ATerm name) Succeeds if the current class declares a method with this name class.str
has-field(ATerm name) Succeeds if the current class has a field with this name class.str
has-formal-type-parameter(ATerm name) Succeeds if this class has a type parameter of the given name class.str
has-inherited-field(ATerm name) Succeeds if the current class inherits a field with this name class.str
has-inherited-member-type(ATerm name) Succeeds if the current class inherits a member type with this name class.str
has-inherited-method(ATerm name) Succeeds if the current class inherits a method with this name class.str
has-member-type(ATerm name) Succeeds if this has a member type with the given name class.str
has-method(ATerm name) Succeeds if this has a member method with the given name class.str
init-declared-constructor-list Must be implemented by subclasses class.str
init-declared-constructor-list Default implementation (not required to use this) class.str
init-declared-field-table Abstract strategy class.str
init-declared-field-table Default implementation of init-declared-field-table, which requires the subclass to implement init-get-declared-field-list class.str
init-declared-member-type-table Should be overridden by a subclass class.str
init-declared-method-table Abstract strategy class.str
init-declared-method-table Default implementation class.str
init-get-declared-field-list Abstract strategy class.str
init-get-declared-method-list n/a class.str
instanceof-JavaClass Checks if current term is an instance of JavaClass class.str
instanceof-JavaMember Succeeds if the current term is an instance of a Java member class.str
is-anonymous-class n/a class.str
is-generic Succeeds if this is a generic class (i class.str
is-local-class n/a class.str
is-member-type Succeeds if this class is a member of an enclosing class class.str
is-nested-class Succeeds if this is a nested class class.str
is-not-inherited(ATerm inclass) Private methods are not inherited class.str
is-not-inherited(ATerm inclass) Hidden fields are not inherited class.str
is-not-inherited(ATerm inclass) Hidden member types are not inherited class.str
is-not-inherited(ATerm inclass) Members with default access are not inherited into classes defined in a different package class.str
is-subclass(ATerm class) Succeeds if this class is subclass of the given class class.str
is-top-level-class Succeeds if this is a top level class class.str



Strategy details


ATerm get-canonical-name
File class.str
Author unknown
Since unknown
 

Returns the canonical name of this class.

Canonical names (see section 6.7) are fully qualified namesthat uniquely identify a class. There are no two different canonical names that refer to the same class.


type Class Object -> TypeName

 
ATerm get-constructors
File class.str
Author unknown
Since unknown
 

Returns all constructors of this class, including superclasses.


type Class Object -> List(Constructor Object)

 
ATerm get-declared-constructor-list
File class.str
Author unknown
Since unknown
 

Returns a list of the constructors declared in this class.

Don't invoke directly: use get-declared-constructors


type Class Object -> List(Constructor Object)
todo Is a list the most efficient way for storing constructors?

 
ATerm get-declared-constructors
File class.str
Author unknown
Since unknown
 

Returns a list of the constructors declared in this class.


type Class Object -> List(Constructor Object)

 
ATerm get-declared-field(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name String

Returns the field 'name', which must be declared in this class.


type Class Object -> Field Object

 
ATerm get-declared-field-table
File class.str
Author unknown
Since unknown
 

Private. Do not invoke.



 
ATerm get-declared-fields
File class.str
Author unknown
Since unknown
 

No information available.


type Class Object -> List(Field Object)

 
ATerm get-declared-member-type(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name name String

Returns the type 'name', which must be declared in this class.


type Class Object -> Class Object

 
ATerm get-declared-member-type-table
File class.str
Author unknown
Since unknown
 

Private. Do not invoke directly.


type Hashtable(String, Class Object)

 
ATerm get-declared-member-types
File class.str
Author unknown
Since unknown
 

Returns all the member types declared in this class.


type Class Object -> List(Class Object)

 
ATerm get-declared-method-table
File class.str
Author unknown
Since unknown
 

Returns a hashtable of the methods declared in this class.


type Class Object -> HashTable(String, Method Object)

 
ATerm get-declared-methods
File class.str
Author unknown
Since unknown
 

Returns a list of the methods declared in this class.


type Class Object -> List(Method Object)

 
ATerm get-declared-methods(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name String

Returns the methods 'name', which must be declared in this class.If no such method exits, the empty list is returned.


type Class Object -> List(Method Object)

 
ATerm get-enclosing-class
File class.str
Author unknown
Since unknown
 

No information available.


todo Anonymous classes don't have a declaring class.

 
ATerm get-field(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name String

Returns the field for the given name.

If multiple fields are accessible, then an access of this field ambiguous and this strategy will fail. Use get-fields(|name) if you need all the field declarations of the given name.

If the class is an array class, then this method will succeed and return a field if


type Class Object -> Field Object

 
ATerm get-fields
File class.str
Author unknown
Since unknown
 

Returns all fields of this class, including those inherited from superclasses and superinterfaces.

For array classes, this method does return the length field (java.lang.getFields doesnot return the length field for an array class).


type Class Object -> List(Field Object)

 
ATerm get-fields(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name String

Returns all the visible fields with the given name.

For valid Java classes, this should return a singletonlist. For invalid Java classes, there might be multipledeclarations with the same name.


todo Optimize by not retrieving all the fields first.
type Class Object -> List(Field Object)

 
ATerm get-formal-type-parameter(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name Simple name of the type parameter (String)

Returns the type parameter of the given name, or failsif this class thus have a type parameter with this name.


type Class Object -> TypeParam

 
ATerm get-formal-type-parameters
File class.str
Author unknown
Since unknown
 

Abstract method. Has to declared in subclasses.


type Class Object -> List(TypeParam)

 
ATerm get-fully-qualified-name
File class.str
Author unknown
Since unknown
 

Returns the canonical name of this class, which is a fully qualified name.


type Class Object -> TypeName

 
ATerm get-inherited-fields
File class.str
Author unknown
Since unknown
 

Returns all fields of this class that are inherited from superclasses and superinterfaces.


type Class Object -> List(Fields Object)

 
ATerm get-inherited-fields(ATerm name)
File class.str
Author unknown
Since unknown
 
Parameters
ATerm name Simple name of the field (String)

Returns all fields of this class that are inherited from superclasses and superinterfaces.


type Class Object -> List(Field Object)

 
ATerm get-inherited-member-types
File class.str
Author unknown
S