Package org.fife.rsta.ac.js.ast
Class JavaScriptVariableDeclaration
- java.lang.Object
-
- org.fife.rsta.ac.js.ast.JavaScriptDeclaration
-
- org.fife.rsta.ac.js.ast.JavaScriptVariableDeclaration
-
- Direct Known Subclasses:
JavaScriptFunctionTypeDeclaration
public class JavaScriptVariableDeclaration extends JavaScriptDeclaration
JavaScript Variable Declaration classTypeDeclarations
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDeclarationoriginalTypeDecprotected SourceCompletionProviderproviderprivate booleanreassignedprotected TypeDeclarationtypeDec
-
Constructor Summary
Constructors Constructor Description JavaScriptVariableDeclaration(java.lang.String name, int offset, SourceCompletionProvider provider, CodeBlock block)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetJavaScriptTypeName()TypeDeclarationgetTypeDeclaration()voidresetVariableToOriginalType()Resets 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 org.fife.rsta.ac.js.ast.JavaScriptDeclaration
getCodeBlock, getEndOffset, getName, getOffset, getStartOffSet, getTypeDeclarationOptions, setEndOffset, setStartOffset, setTypeDeclarationOptions
-
-
-
-
Field Detail
-
typeDec
protected TypeDeclaration typeDec
-
provider
protected SourceCompletionProvider provider
-
reassigned
private boolean reassigned
-
originalTypeDec
private TypeDeclaration originalTypeDec
-
-
Constructor Detail
-
JavaScriptVariableDeclaration
public JavaScriptVariableDeclaration(java.lang.String name, int offset, SourceCompletionProvider provider, CodeBlock block)- Parameters:
name- of the variableoffset- position within scriptprovider- JavaScript source provider
-
-
Method Detail
-
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()
-
resetVariableToOriginalType
public void resetVariableToOriginalType()
Resets the TypeDeclaration to the original value
-
setTypeDeclaration
public void setTypeDeclaration(TypeDeclaration typeDec)
Set TypeDeclaration- Parameters:
typeDec-
-
getTypeDeclaration
public TypeDeclaration getTypeDeclaration()
- Returns:
- TypeDeclaration for the variable
-
getJavaScriptTypeName
public java.lang.String getJavaScriptTypeName()
- Returns:
- JavaScript name for the type declaration e.g. String, Number etc.
-
-