Package org.fife.rsta.ac.js.ast.jsType
Class JavaScriptType
- java.lang.Object
-
- org.fife.rsta.ac.js.ast.jsType.JavaScriptType
-
- Direct Known Subclasses:
JSR223Type
public class JavaScriptType extends java.lang.ObjectCached 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 toJSCompletion
-
-
Field Summary
Fields Modifier and Type Field Description protected JSCompletionclassTypeprotected java.util.HashMap<java.lang.String,JSCompletion>constructorsprivate java.util.ArrayList<JavaScriptType>extendedprotected java.util.HashMap<java.lang.String,JSCompletion>methodFieldCompletionsprotected TypeDeclarationtype
-
Constructor Summary
Constructors Constructor Description JavaScriptType(TypeDeclaration type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JSCompletion_getCompletion(java.lang.String completionLookup, SourceCompletionProvider provider)voidaddCompletion(JSCompletion completion)Add method or field completion to CachedTypevoidaddConstructor(JSCompletion completion)Adds a constructor completion to CachedType object typevoidaddExtension(JavaScriptType type)Add Cached Type extensionbooleanequals(java.lang.Object o)JSCompletiongetClassTypeCompletion()JSCompletiongetCompletion(java.lang.String completionLookup, SourceCompletionProvider provider)private static JSCompletiongetCompletion(JavaScriptType cachedType, java.lang.String completionLookup, SourceCompletionProvider provider)java.util.HashMap<java.lang.String,JSCompletion>getConstructorCompletions()java.util.List<JavaScriptType>getExtendedClasses()java.util.HashMap<java.lang.String,JSCompletion>getMethodFieldCompletions()TypeDeclarationgetType()inthashCode()Overridden sinceequals(Object)is overridden.JSCompletionremoveCompletion(java.lang.String completionLookup, SourceCompletionProvider provider)private voidremoveCompletion(JavaScriptType type, JSCompletion completion)Recursively walk through completions for this and extended classes to remove completion for this lookup namevoidremoveConstructor(JSCompletion completion)voidsetClassTypeCompletion(JSCompletion classType)Set the class type completion e.g.
-
-
-
Field Detail
-
type
protected TypeDeclaration type
-
methodFieldCompletions
protected java.util.HashMap<java.lang.String,JSCompletion> methodFieldCompletions
-
constructors
protected java.util.HashMap<java.lang.String,JSCompletion> constructors
-
classType
protected JSCompletion classType
-
extended
private java.util.ArrayList<JavaScriptType> extended
-
-
Constructor Detail
-
JavaScriptType
public JavaScriptType(TypeDeclaration type)
-
-
Method Detail
-
addCompletion
public void addCompletion(JSCompletion completion)
Add method or field completion to CachedType- Parameters:
completion-- See Also:
JSCompletion
-
removeCompletion
public JSCompletion removeCompletion(java.lang.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(java.lang.String completionLookup, SourceCompletionProvider provider)
- Parameters:
completionLookup-- Returns:
- JSCompletion using lookup name
- See Also:
JSCompletion
-
_getCompletion
protected JSCompletion _getCompletion(java.lang.String completionLookup, SourceCompletionProvider provider)
- Parameters:
completionLookup-- Returns:
- JSCompletion using lookup name
- See Also:
JSCompletion
-
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()
-
getType
public TypeDeclaration getType()
- Returns:
- Get type declaration for CachedType
- See Also:
TypeDeclaration
-
addExtension
public void addExtension(JavaScriptType type)
Add Cached Type extension- Parameters:
type-- See Also:
JavaScriptType
-
getExtendedClasses
public java.util.List<JavaScriptType> getExtendedClasses()
- Returns:
- list of CachedType extended classes
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Overridden sinceequals(Object)is overridden.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code.
-
-