Class JavaScriptVariableDeclaration

    • Constructor Detail

      • JavaScriptVariableDeclaration

        public JavaScriptVariableDeclaration​(java.lang.String name,
                                             int offset,
                                             SourceCompletionProvider provider,
                                             CodeBlock block)
        Parameters:
        name - of the variable
        offset - position within script
        provider - JavaScript source provider
    • Method Detail

      • setTypeDeclaration

        public void setTypeDeclaration​(org.mozilla.javascript.ast.AstNode typeNode)
        Lookup TypeDeclaration from the Rhino AstNode
        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.