Class JavaScriptType

  • Direct Known Subclasses:
    JSR223Type

    public class JavaScriptType
    extends java.lang.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 Detail

      • methodFieldCompletions

        protected java.util.HashMap<java.lang.String,​JSCompletion> methodFieldCompletions
      • constructors

        protected java.util.HashMap<java.lang.String,​JSCompletion> constructors
    • Method Detail

      • addCompletion

        public void addCompletion​(JSCompletion completion)
        Add method or field completion to CachedType
        Parameters:
        completion -
        See Also:
        JSCompletion
      • 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

        private static JSCompletion getCompletion​(JavaScriptType cachedType,
                                                  java.lang.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:
        JSCompletion
      • getMethodFieldCompletions

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

        public java.util.HashMap<java.lang.String,​JSCompletion> getConstructorCompletions()
      • getExtendedClasses

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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