org.objectweb.jac.ide
Class Class

java.lang.Object
  extended byorg.objectweb.jac.ide.ModelElement
      extended byorg.objectweb.jac.ide.Type
          extended byorg.objectweb.jac.ide.Class
Direct Known Subclasses:
Aspect, Interface, Repository

public class Class
extends Type

This class represents a class meta element.


Constructor Summary
Class()
           
 
Method Summary
 void addConstructor(Constructor c)
           
 void addField(Field f)
           
 void addImport(String _import)
           
 void addInterface(Interface _interface)
           
 void addMainMethod()
          Adds a "public static void main(String[] parameters)" method
 void addMethod(Method m)
           
 void addMethodIntf(Method m)
           
 Field findField(String name)
          Finds a field with a given name
 Method findMethod(Method method)
          Finds a method with the same name and the same parameter types as a given method.
 Method findMethod(String name, List parameters)
          Finds a method with a given name and parameters
 List getAbstractMethods()
           
 List getAllFields()
          Returns all fields, including inherited ones
 List getAllMethods()
          Gets al methods, including specific getter,setters,adders,removers and clearers.
 Collection getAllNavigableRoles()
          Gets all navigable roles, including those form inherited classes.
 Package getContainer()
          Get the value of container.
 List getFields()
          Get the value of fields.
 String getFullName()
          Defines a redefinable method to get the full name.
 String getGenerationFullName()
          Gets full name to use for code generation.
 String getGenerationName()
          Gets name to use for code generation.
 List getImports()
           
 List getInheritedMethods()
           
 Set getInterfaces()
           
 List getMethods()
          Get the value of methods.
 Collection getNavigableRoles()
          Gets navigable roles
 Project getProject()
           
 Collection getReferenceRoles()
          Gets all navigable reference roles (whose cardinality is 1 or 0-1), including those form inherited classes.
 Collection getRelationLinks()
           
 Collection getRelationRoles()
           
 Type getSuperClass()
          Get the value of superClass.
 HandlerResult gotoLine(DisplayContext context, int lineNumber)
           
 void implementInterface(Interface intf)
          Adds the necessary fields and methods to implement a interface
 void implementMethod(Method method)
          Adds an implementation for an abstract method
 boolean isAbstract()
           
 void overrideMethod(Method method)
          Adds an overriding method
 void removeField(Field f)
           
 void removeImport(String _import)
           
 void removeInterface(Interface _interface)
           
 void removeMethod(Method m)
           
 void removeMethodIntf(Method m)
           
 void setAbstract(boolean value)
           
 void setContainer(Package v)
          Set the value of container.
 void setSuperClass(Type v)
          Set the value of superClass.
 
Methods inherited from class org.objectweb.jac.ide.Type
getPackagePath, isPrimitive, setPackagePath
 
Methods inherited from class org.objectweb.jac.ide.ModelElement
addConfigItem, addEndingLink, addLink, getConfigItems, getDescription, getEndingLinks, getLinks, getName, getType, remove, removeEndingLink, removeLink, setDescription, setEndingLinks, setLinks, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Class

public Class()
Method Detail

getGenerationName

public String getGenerationName()
Description copied from class: ModelElement
Gets name to use for code generation. Defaults to name.

Overrides:
getGenerationName in class ModelElement

getSuperClass

public Type getSuperClass()
Get the value of superClass.

Returns:
value of superClass.

setSuperClass

public void setSuperClass(Type v)
Set the value of superClass.

Parameters:
v - Value to assign to superClass.

findField

public Field findField(String name)
Finds a field with a given name

Parameters:
name - field name
Returns:
a field with the given name, or null

getFields

public List getFields()
Get the value of fields.

Returns:
value of fields.

addField

public void addField(Field f)

removeField

public void removeField(Field f)

getAllFields

public List getAllFields()
Returns all fields, including inherited ones


getMethods

public List getMethods()
Get the value of methods.

Returns:
value of methods.

addMethod

public void addMethod(Method m)

removeMethod

public void removeMethod(Method m)

addConstructor

public void addConstructor(Constructor c)

getAllMethods

public List getAllMethods()
Gets al methods, including specific getter,setters,adders,removers and clearers.


getInheritedMethods

public List getInheritedMethods()

getAbstractMethods

public List getAbstractMethods()

findMethod

public Method findMethod(String name,
                         List parameters)
Finds a method with a given name and parameters

Parameters:
name - method name
parameters - the types of the parameters.
Returns:
a method with the given name and parameter types, or null
See Also:
findMethod(Method)

findMethod

public Method findMethod(Method method)
Finds a method with the same name and the same parameter types as a given method.

Parameters:
method - method whose name and parameter types must match
Returns:
a method with the same name and the same parameter types, or null
See Also:
findMethod(String,List)

addMethodIntf

public void addMethodIntf(Method m)

removeMethodIntf

public void removeMethodIntf(Method m)

addMainMethod

public void addMainMethod()
Adds a "public static void main(String[] parameters)" method


getContainer

public Package getContainer()
Get the value of container.

Returns:
value of container.

setContainer

public void setContainer(Package v)
Set the value of container.

Parameters:
v - Value to assign to container.

getFullName

public String getFullName()
Description copied from class: ModelElement
Defines a redefinable method to get the full name. Here it is equivalent to the getName() method.

Overrides:
getFullName in class Type

getGenerationFullName

public String getGenerationFullName()
Description copied from class: ModelElement
Gets full name to use for code generation. Defaults to fullName.

Overrides:
getGenerationFullName in class ModelElement

getNavigableRoles

public Collection getNavigableRoles()
Gets navigable roles

Returns:
a collection of RelationRole

getAllNavigableRoles

public Collection getAllNavigableRoles()
Gets all navigable roles, including those form inherited classes.


getReferenceRoles

public Collection getReferenceRoles()
Gets all navigable reference roles (whose cardinality is 1 or 0-1), including those form inherited classes.


getRelationRoles

public Collection getRelationRoles()

getRelationLinks

public Collection getRelationLinks()

getProject

public Project getProject()

getImports

public List getImports()

addImport

public void addImport(String _import)

removeImport

public void removeImport(String _import)

isAbstract

public boolean isAbstract()

setAbstract

public void setAbstract(boolean value)

getInterfaces

public Set getInterfaces()

addInterface

public void addInterface(Interface _interface)

removeInterface

public void removeInterface(Interface _interface)

implementInterface

public void implementInterface(Interface intf)
Adds the necessary fields and methods to implement a interface

Parameters:
intf - the interface to implement

overrideMethod

public void overrideMethod(Method method)
Adds an overriding method

Parameters:
method - method to override

implementMethod

public void implementMethod(Method method)
Adds an implementation for an abstract method

Parameters:
method - abstract method to implement

gotoLine

public HandlerResult gotoLine(DisplayContext context,
                              int lineNumber)