| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
SciModel contains a set of starting-point methods for working with the
SCI model.
SCI model data is stored in special data containers -
packages.
A package can have other packages called subpackages.
The model can have several upper-level packages
called root packages.
The model can be obtained via SciModelAccess.getModel() method:
SciModel model = SciModelAccess.getModel();
rootPackages(String) method:
SciPackageEnumeration roots = model.rootPackages(SciModelPart.MODEL);
while (roots.hasMoreElements()){
SciPackage nextRoot = roots.nextSciPackage();
myCoolMethodThatProcessesAPackage(nextRoot);
}
While working
with a package, the information can be extracted from it in files, classes, or subpackages:
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);
}
}
SciModel interface also provides access to powerful language-dependent auxiliary tools
SciFactory, SciPatternManager, and SciLanguageHelper.
The class SciUtil contains useful methods for finding a member by the
signature or by another method used as a template.
| Method Summary | |
SciClass | findClass(String language, String qualifiedName)Finds a class/interface by its qualified name. |
SciElement | findElement(String uniqueName)Finds an element by its unique name. |
SciFile | findFile(String qualifiedName)Finds a file by its qualified name. |
SciMember | findMember(String language, String qualifiedName)Finds a member by its qualified name. |
SciPackage | findPackage(String qualifiedName)Deprecated. Method findPackage(String, String) should be used instead. |
SciPackage | findPackage(String qualifiedName, String modelPart)Finds a package by its qualified name. |
SciPackage | findPackageToPasteFile(String absoluteURL)Tries to find an existing SciPackage where a new file with a given absolute URL
can be pasted according to project structure and "writeable for" properties of project roots. |
void | formatFile(SciFile sciFile) |
SciPackage | getDefaultRootPackage()Deprecated. Method rootPackages(String, String) should be used instead. |
SciFactory | getFactory(String language)Returns SciFactory object for the specified language. |
SciGenericFactory | getGenericFactory(String language)Returns SciGenericFactory object for the specified language. |
SciLanguageHelper | getLanguageHelper(String language)Returns SciLanguageHelper object for the specified language. |
SciPatternManager | getPatternManager()Returns SciPatternManager object. |
boolean | isLanguageSupported(String language)Checks whether a given language is supported in the current runtime configuration. |
StringEnumeration | languages()Returns an enumeration of the string with the names of languages being used in this model. |
SciPackageEnumeration | rootPackages()Deprecated. Method rootPackages(String) should be used instead. |
SciPackageEnumeration | rootPackages(String modelPart)Returns an enumeration of the root packages of the specific kind. |
| Method Detail |
public SciClass findClass(String language, String qualifiedName)
SciLanguage interface.SciClass by its qualified name, or null if there is no such classpublic SciElement findElement(String uniqueName)
null if there is no such elementpublic SciFile findFile(String qualifiedName)
null if there is no such filepublic SciMember findMember(String language, String qualifiedName)
SciLanguage interface.null if there is no such memberpublic SciPackage findPackage(String qualifiedName)
findPackage(String, String) should be used instead.public SciPackage findPackage(String qualifiedName, String modelPart)
SciModelPart.MODEL,
SciModelPart.IMPORT or SciModelPart.COMPONENT.null if there is no such packagepublic SciPackage findPackageToPasteFile(String absoluteURL)
SciPackage where a new file with a given absolute URL
SciPackage by
SciPackage object if an appropriate one is found, or null otherwise.public void formatFile(SciFile sciFile)
public SciPackage getDefaultRootPackage()
rootPackages(String, String) should be used instead.public SciFactory getFactory(String language)
SciFactory object for the specified language. This object allows to create
SciLanguage interface.SciFactory object for the specified languagepublic SciGenericFactory getGenericFactory(String language)
SciGenericFactory object for the specified language.SciLanguage interface.SciGenericFactory object for the specified languagepublic SciLanguageHelper getLanguageHelper(String language)
SciLanguageHelper object for the specified language. This object enables you to check
SciLanguage interface.SciLanguageHelper object for the specified languagepublic SciPatternManager getPatternManager()
SciPatternManager object. This object provides
SciPatternManager objectpublic boolean isLanguageSupported(String language)
SciLanguage interface.true if the language is supported, false otherwisepublic StringEnumeration languages()
SciLanguage interface.public SciPackageEnumeration rootPackages()
rootPackages(String) should be used instead.public SciPackageEnumeration rootPackages(String modelPart)
rootPackages(SciModelPart.MODEL) returns an enumeration of the model's root packages.
Normally you would use the method only with SciModelPart.MODEL parameter when working
with the model.
rootPackages(SciModelPart.IMPORT) returns an enumeration of the model's imported root packages.
rootPackages(SciModelPart.COMPONENT) returns an enumeration of the components' root packages.
rootPackages(SciModelPart.IMPORT) call.
SciModel model = SciModelAccess.getModel();
SciPackageEnumeration roots = model.rootPackages(SciModelPart.MODEL);
while (roots.hasMoreElements()){
SciPackage nextRoot = roots.nextSciPackage();
myCoolMethodThatProcessesAPackage(nextRoot);
}
SciModelPart.MODEL,
SciModelPart.IMPORT, or SciModelPart.COMPONENT
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||