Class RhinoJavaScriptTypesFactory


public class RhinoJavaScriptTypesFactory extends JSR223JavaScriptTypesFactory
Rhino Specific JavaScriptTypesFactory. Supports importPackage and importClass. importPackage(java.util) importClass(java.util.HashSet) Clears the cache every time document is parsed for importPackage and importClass to work properly.
  • Field Details

  • Constructor Details

  • Method Details

    • addImportClass

      public void addImportClass(String qualifiedClass)
    • addImportPackage

      public void addImportPackage(String packageName)
    • mergeImports

      public void mergeImports(HashSet<String> packages, HashSet<String> classes)
    • mergeImports

      private void mergeImports(HashSet<String> newImports, LinkedHashSet<String> oldImports, boolean packages)
    • canClearCache

      private boolean canClearCache(HashSet<String> newImports, LinkedHashSet<String> oldImports)
      Validate whether the newImports and old imports contain the same values
      Parameters:
      newImports -
      oldImports -
      Returns:
    • clearImportCache

      public void clearImportCache()
    • clearAllImportTypes

      private void clearAllImportTypes()
    • removeAllTypes

      private void removeAllTypes(JavaScriptType type)
      Remove all TypeDeclarations from the TypeDeclarationFactory from the JavaScriptType and all it's extended classes
      Parameters:
      type -
    • getClassFile

      public ClassFile getClassFile(JarManager manager, TypeDeclaration type)
      Override getClassFile that checks the imported packages and classnames based on the TypeDeclaration.getAPITypeName()
      Overrides:
      getClassFile in class JavaScriptTypesFactory
    • removePackagesFromType

      private String removePackagesFromType(String type)
    • findFromClasses

      private ClassFile findFromClasses(JarManager manager, String name)
      Look for class file using imported classes
      Parameters:
      manager -
      name -
      Returns:
    • findFromImport

      private ClassFile findFromImport(JarManager manager, String name)
      Look for class file using imported packages
      Parameters:
      manager -
      name -
      Returns: