org.objectweb.jac.ide
Class Package

java.lang.Object
  extended byorg.objectweb.jac.ide.ModelElement
      extended byorg.objectweb.jac.ide.Package

public class Package
extends ModelElement


Constructor Summary
Package()
           
 
Method Summary
 void addAspect(Aspect a)
           
 void addClass(Class c)
           
 void addDiagram(Diagram d)
           
 void addGroup(Group g)
           
 void addInstance(Instance i)
           
 void addInterface(Interface i)
           
 void addRepository(Class itemClass)
          Add a repository for a class.
 void addResource(Attachment resource)
           
 void addSubPackage(Package p)
           
 Class findClass(String className)
          Gets a class by its name.
 Package findPackage(String pkgName)
          Find a package by its full name (my.package.ClassName)
 Collection getAllClasses()
          Returns all classes of this package or a subpackage of it.
 Map getAllResources()
          Returns all resources of this package or a subpackage of it, in a Map whose keys are packages and values are Attachements.
 Class getClassByName(String className)
          Gets a class by its name.
 List getClasses()
          Get the value of classes.
 List getDiagrams()
          Get the value of diagrams.
 String getFullName()
          Defines a redefinable method to get the full name.
 List getGroups()
          Get the value of groups.
 List getInstances()
          Get the value of instances.
 Collection getMainClasses()
          Returns available main classes (Classes wich have a static void main(String[]) method)
 Package getPackageByName(String pkgName)
           
 Package getParent()
          Get the value of parent.
 String getPath()
           
 String getPPath()
           
 Project getProject()
           
 List getResources()
           
 List getSubPackages()
          Get the value of packages.
static String packagePathToFile(String path)
           
 void removeClass(Class c)
           
 void removeDiagram(Diagram d)
           
 void removeGroup(Group g)
           
 void removeInstance(Instance i)
           
 void removeResource(Attachment resource)
           
 void removeSubPackage(Package p)
           
 void setClasses(Vector v)
          Set the value of classes.
 void setDiagrams(Vector v)
          Set the value of diagrams.
 void setInstances(Vector v)
          Set the value of instances.
 void setParent(Package v)
          Set the value of parent.
 void setProject(Project project)
           
 void setSubPackages(Vector v)
          Set the value of packages.
 
Methods inherited from class org.objectweb.jac.ide.ModelElement
addConfigItem, addEndingLink, addLink, getConfigItems, getDescription, getEndingLinks, getGenerationFullName, getGenerationName, 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

Package

public Package()
Method Detail

getProject

public Project getProject()

setProject

public void setProject(Project project)

getParent

public Package getParent()
Get the value of parent.

Returns:
value of parent.

setParent

public void setParent(Package v)
Set the value of parent.

Parameters:
v - Value to assign to parent.

getPath

public String getPath()

getPPath

public String getPPath()

packagePathToFile

public static String packagePathToFile(String path)

getSubPackages

public List getSubPackages()
Get the value of packages.

Returns:
value of packages.

setSubPackages

public void setSubPackages(Vector v)
Set the value of packages.

Parameters:
v - Value to assign to packages.

addSubPackage

public void addSubPackage(Package p)

removeSubPackage

public void removeSubPackage(Package p)

getPackageByName

public Package getPackageByName(String pkgName)

findPackage

public Package findPackage(String pkgName)
Find a package by its full name (my.package.ClassName)

Parameters:
pkgName - the package name to find

getDiagrams

public List getDiagrams()
Get the value of diagrams.

Returns:
value of diagrams.

setDiagrams

public void setDiagrams(Vector v)
Set the value of diagrams.

Parameters:
v - Value to assign to diagrams.

addDiagram

public void addDiagram(Diagram d)

removeDiagram

public void removeDiagram(Diagram d)

getClasses

public List getClasses()
Get the value of classes.

Returns:
value of classes.

setClasses

public void setClasses(Vector v)
Set the value of classes.

Parameters:
v - Value to assign to classes.

addClass

public void addClass(Class c)

addInterface

public void addInterface(Interface i)

removeClass

public void removeClass(Class c)

addRepository

public void addRepository(Class itemClass)
Add a repository for a class. Creates a relation, a singleton static field and static method to initialize the singleton.


getAllClasses

public Collection getAllClasses()
Returns all classes of this package or a subpackage of it.


getAllResources

public Map getAllResources()
Returns all resources of this package or a subpackage of it, in a Map whose keys are packages and values are Attachements.


getClassByName

public Class getClassByName(String className)
Gets a class by its name.

Parameters:
className - the requested class name
Returns:
of class of the package whose name or generation name is className, or null

findClass

public Class findClass(String className)
Gets a class by its name. Subpackages are searched recursively.

Parameters:
className - the requested class name (partial fully qualified class name: <sub_pkg1>.<sub_pkg2>.<class_name>
Returns:
a class of the package whose name is className, or null

addAspect

public void addAspect(Aspect a)

getInstances

public List getInstances()
Get the value of instances.

Returns:
value of instances.

setInstances

public void setInstances(Vector v)
Set the value of instances.

Parameters:
v - Value to assign to instances.

addInstance

public void addInstance(Instance i)

removeInstance

public void removeInstance(Instance i)

getGroups

public List getGroups()
Get the value of groups.

Returns:
value of groups.

addGroup

public void addGroup(Group g)

removeGroup

public void removeGroup(Group g)

getResources

public List getResources()

addResource

public void addResource(Attachment resource)

removeResource

public void removeResource(Attachment resource)

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 ModelElement

getMainClasses

public Collection getMainClasses()
Returns available main classes (Classes wich have a static void main(String[]) method)