public class RhinoJavaScriptAstParser extends JavaScriptAstParser
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PACKAGES |
dot, options, provider| Constructor and Description |
|---|
RhinoJavaScriptAstParser(SourceCompletionProvider provider,
int dot,
TypeDeclarationOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearImportCache(SourceCompletionProvider provider)
Clear the importPackage and importClass cache
|
CodeBlock |
convertAstNodeToCodeBlock(org.mozilla.javascript.ast.AstRoot root,
java.util.Set<Completion> set,
java.lang.String entered)
Converts AstRoot to CodeBlock
|
protected void |
iterateNode(org.mozilla.javascript.ast.AstNode child,
java.util.Set<Completion> set,
java.lang.String entered,
CodeBlock block,
int offset)
Overridden iterateNode to intercept Token.EXPR_RESULT and check for importPackage and importClass named nodes
If found, then process them and extract the imports and add them to RhinoJavaScriptTypesFactory then return
otherwise call super.iterateNode()
|
static java.lang.String |
removePackages(java.lang.String src) |
getDot, getProviderisPreProcessingpublic static final java.lang.String PACKAGES
public RhinoJavaScriptAstParser(SourceCompletionProvider provider, int dot, TypeDeclarationOptions options)
public void clearImportCache(SourceCompletionProvider provider)
provider - SourceCompletionProviderpublic CodeBlock convertAstNodeToCodeBlock(org.mozilla.javascript.ast.AstRoot root, java.util.Set<Completion> set, java.lang.String entered)
JavaScriptParserconvertAstNodeToCodeBlock in class JavaScriptAstParserroot - AstRoot to iterateset - completions setentered - text entered by userprotected void iterateNode(org.mozilla.javascript.ast.AstNode child,
java.util.Set<Completion> set,
java.lang.String entered,
CodeBlock block,
int offset)
iterateNode in class JavaScriptAstParserpublic static java.lang.String removePackages(java.lang.String src)