Class JavaScriptType

java.lang.Object
org.fife.rsta.ac.js.ast.jsType.JavaScriptType
Direct Known Subclasses:
JSR223Type

public class JavaScriptType extends Object
Cached Type Tree Node with pointer to a list of super classes to make it easy to walk through Completion hierarchy Contains a HashMap of lookup keys to JSCompletion
  • Field Details

  • Constructor Details

  • Method Details

    • addCompletion

      public void addCompletion(JSCompletion completion)
      Add method or field completion to CachedType
      Parameters:
      completion -
      See Also:
    • removeCompletion

      public JSCompletion removeCompletion(String completionLookup, SourceCompletionProvider provider)
    • removeCompletion

      private void removeCompletion(JavaScriptType type, JSCompletion completion)
      Recursively walk through completions for this and extended classes to remove completion for this lookup name
      Parameters:
      type -
      completion - The completion to remove.
    • addConstructor

      public void addConstructor(JSCompletion completion)
      Adds a constructor completion to CachedType object type
      Parameters:
      completion -
    • removeConstructor

      public void removeConstructor(JSCompletion completion)
    • setClassTypeCompletion

      public void setClassTypeCompletion(JSCompletion classType)
      Set the class type completion e.g. String, Number
      Parameters:
      classType - Completion to format the class
    • getClassTypeCompletion

      public JSCompletion getClassTypeCompletion()
      Returns:
      the class type completion for the javascript type
    • getCompletion

      public JSCompletion getCompletion(String completionLookup, SourceCompletionProvider provider)
      Parameters:
      completionLookup -
      Returns:
      JSCompletion using lookup name
      See Also:
    • _getCompletion

      protected JSCompletion _getCompletion(String completionLookup, SourceCompletionProvider provider)
      Parameters:
      completionLookup -
      Returns:
      JSCompletion using lookup name
      See Also:
    • getCompletion

      private static JSCompletion getCompletion(JavaScriptType cachedType, String completionLookup, SourceCompletionProvider provider)
      Parameters:
      cachedType -
      completionLookup -
      Returns:
      completion searches this typCompletions first and if not found, then tries the extended type. Recursive routine to drill down for JSCompletion
      See Also:
    • getMethodFieldCompletions

      public HashMap<String,JSCompletion> getMethodFieldCompletions()
      Returns:
      A map of completion names to completions.
      See Also:
    • getConstructorCompletions

      public HashMap<String,JSCompletion> getConstructorCompletions()
    • getType

      public TypeDeclaration getType()
      Returns:
      Get type declaration for CachedType
      See Also:
    • addExtension

      public void addExtension(JavaScriptType type)
      Add Cached Type extension
      Parameters:
      type -
      See Also:
    • getExtendedClasses

      public List<JavaScriptType> getExtendedClasses()
      Returns:
      list of CachedType extended classes
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overridden since equals(Object) is overridden.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.