| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A container of source code files (for Java language represents a Java package).
SciPackage interface provides a set of methods for accessing the information about files, classes
and subpackages contained in this package.
It is possible to get a package content as an enumeration of files, classes or subpackages using
files, classes or subpackages methods respectively:
SciModel model = SciModelAccess.getModel();
SciPackageEnumeration roots = model.rootPackages(SciModelPart.MODEL);
while (roots.hasMoreElements()){
SciPackage nextRoot = roots.nextSciPackage();
SciClassEnumeration classes=nextRoot.classes();
while (classes.hasMoreElements()){
SciClass nextClass = classes.nextSciClass();
myCoolMethodThatProcessesAClass(nextClass);
}
}
Every package has a string called qualified name. Qualified name is language-specific. It contains full name of this package in a valid systax construction for the programming language. For example, the qualified name for a java package will look like a standard Java language package name: "com.togethersoft.openapi.sci.enum".
Note, that you can find a package by its qualified name. For example:
SciPackage justFoundPackage = model.findPackage("com.togethersoft.openapi.sci.enum", SciModelPart.MODEL);
Note that classes method returns an enumeration of upper-level classes only without their
inner classes. For accessing the information about inner classes of an upper-level class,
the innerClasses method should be used.
| Method Summary | |
boolean | canSetName(String name)Checks whether the specified name can be set as the name for this package. |
SciClassEnumeration | classes()Returns an enumeration of upper-level classes in this package. |
SciFileEnumeration | files()Returns an enumeration of all files in this package. |
String | getModelPart()Returns a string representing the kind of this package. |
String | getName()Returns the string with the name of this package. |
SciPackage | getParentPackage()Returns the package this package belongs to. |
String | getQualifiedName()Returns the fully-qualified name which uniquely identifies this package. |
void | setName(String name)Sets the name for this package. |
SciPackageEnumeration | subpackages()Returns an enumeration of subpackages in this package. |
| Methods inherited from interface com.togethersoft.openapi.sci.SciContainer |
canPaste, objects, paste |
| Methods inherited from interface com.togethersoft.openapi.sci.SciObject |
canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty |
| Method Detail |
public boolean canSetName(String name)
true if
it can be done, false otherwise.true if the name can be set as a name for this package,
false otherwisepublic SciClassEnumeration classes()
innerClasses method should be used.public SciFileEnumeration files()
public String getModelPart()
The returned value can be:
SciModelPart.MODEL - model packages (packages that keep the model's data).
SciModelPart.IMPORT - imported packages
SciModelPart.COMPONENT - contains components
null - for newly created packages. For example, if you create a package in your scipt
using the SciFactory.newPackage, this method
will return null for that package.
public String getName()
getQualifiedName method returns the
fully-qualified name which uniquely identifies this package.public SciPackage getParentPackage()
null.public String getQualifiedName()
public void setName(String name)
public SciPackageEnumeration subpackages()
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||