Class JavaScriptVariableDeclaration
java.lang.Object
org.fife.rsta.ac.js.ast.JavaScriptDeclaration
org.fife.rsta.ac.js.ast.JavaScriptVariableDeclaration
- Direct Known Subclasses:
JavaScriptFunctionTypeDeclaration
JavaScript Variable Declaration class
TypeDeclarations-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TypeDeclarationprotected SourceCompletionProviderprivate booleanprotected TypeDeclaration -
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptVariableDeclaration(String name, int offset, SourceCompletionProvider provider, CodeBlock block) -
Method Summary
Modifier and TypeMethodDescriptionvoidResets the TypeDeclaration to the original valuevoidsetTypeDeclaration(TypeDeclaration typeDec) Set TypeDeclarationvoidsetTypeDeclaration(org.mozilla.javascript.ast.AstNode typeNode) Lookup TypeDeclaration from the RhinoAstNodevoidsetTypeDeclaration(org.mozilla.javascript.ast.AstNode typeNode, boolean overrideOriginal) Set the TypeDeclaration for the AstNode.Methods inherited from class JavaScriptDeclaration
getCodeBlock, getEndOffset, getName, getOffset, getStartOffSet, getTypeDeclarationOptions, setEndOffset, setStartOffset, setTypeDeclarationOptions
-
Field Details
-
typeDec
-
provider
-
reassigned
private boolean reassigned -
originalTypeDec
-
-
Constructor Details
-
JavaScriptVariableDeclaration
public JavaScriptVariableDeclaration(String name, int offset, SourceCompletionProvider provider, CodeBlock block) - Parameters:
name- of the variableoffset- position within scriptprovider- JavaScript source provider
-
-
Method Details
-
setTypeDeclaration
public void setTypeDeclaration(org.mozilla.javascript.ast.AstNode typeNode) Lookup TypeDeclaration from the RhinoAstNode- Parameters:
typeNode- - Rhino AstNode linked to this variable
-
setTypeDeclaration
public void setTypeDeclaration(org.mozilla.javascript.ast.AstNode typeNode, boolean overrideOriginal) Set the TypeDeclaration for the AstNode. Stores the original value so it can be reset- Parameters:
typeNode-overrideOriginal-- See Also:
-
resetVariableToOriginalType
public void resetVariableToOriginalType()Resets the TypeDeclaration to the original value -
setTypeDeclaration
-
getTypeDeclaration
- Returns:
- TypeDeclaration for the variable
-
getJavaScriptTypeName
- Returns:
- JavaScript name for the type declaration e.g. String, Number etc.
-