Package org.apache.flex.compiler.tree.as

Examples of org.apache.flex.compiler.tree.as.IFileNode


                + "public function MyTextButton() {if (foo() != 42) { bar(); } }"
                + "private var _privateVar:String = \"do \";"
                + "public var publicProperty:Number = 100;"
                + "public function myFunction(value: String): String{"
                + "return \"Don't \" + _privateVar + value; }";
        IFileNode node = getFileNode(code);
        visitor.visitFile(node);
        assertOut("package com.example.components {\n\tpublic class MyTextButton extends TextButton {\n\t\tcom.example.components.MyTextButton = function() {\n\t\t\tif (foo() != 42) {\n\t\t\t\tbar();\n\t\t\t}\n\t\t}\n\t\tprivate var _privateVar:String = \"do \";\n\t\tpublic var publicProperty:Number = 100;\n\t\tcom.example.components.MyTextButton.prototype.myFunction = function(value) {\n\t\t\treturn \"Don't \" + _privateVar + value;\n\t\t}\n\t}\n}");
    }
View Full Code Here


                    cu = cu2;
            }
        }

        // Build the AST.
        IFileNode fileNode = null;
        try
        {
            fileNode = (IFileNode) cu.getSyntaxTreeRequest().get().getAST();
        }
        catch (InterruptedException e)
View Full Code Here

    protected IASNode getNode(String code, Class<? extends IASNode> type)
    {
        String source = "package {public class A {function a():void {" + code
                + "}}";
        IFileNode node = getFileNode(source);
        if (type.isInstance(node))
            return node;
        IASNode child = findFirstDescendantOfType(node, type);
        return child;
    }
View Full Code Here

    protected IExpressionNode getExpressionNode(String code,
            Class<? extends IASNode> type)
    {
        String source = "package {public class A {function a():void {" + code
                + "}}";
        IFileNode node = getFileNode(source);
        IExpressionNode child = (IExpressionNode) findFirstDescendantOfType(
                node, type);
        return child;
    }
View Full Code Here

    }

    protected IAccessorNode getAccessor(String code)
    {
        String source = "package {public class A {" + code + "}}";
        IFileNode node = getFileNode(source);
        IAccessorNode child = (IAccessorNode) findFirstDescendantOfType(node,
                IAccessorNode.class);
        return child;
    }
View Full Code Here

    protected IBinaryOperatorNode getBinaryNode(String code)
    {
        String source = "package {public class A {function a():void {" + code
                + "}}";
        IFileNode node = getFileNode(source);
        IBinaryOperatorNode child = (IBinaryOperatorNode) findFirstDescendantOfType(
                node, IBinaryOperatorNode.class);
        return child;
    }
View Full Code Here

    protected IDynamicAccessNode getDynamicAccessNode(String code)
    {
        String source = "package {public class A {function a():void {" + code
                + "}}";
        IFileNode node = getFileNode(source);
        IDynamicAccessNode child = (IDynamicAccessNode) findFirstDescendantOfType(
                node, IDynamicAccessNode.class);
        return child;
    }
View Full Code Here

    }

    protected IVariableNode getField(String code)
    {
        String source = "package {public class A {" + code + "}}";
        IFileNode node = getFileNode(source);
        IVariableNode child = (IVariableNode) findFirstDescendantOfType(node,
                IVariableNode.class);
        return child;
    }
View Full Code Here

    }

    protected IInterfaceNode getInterfaceNode(String code)
    {
        String source = "package {" + code + "}";
        IFileNode node = getFileNode(source);
        IInterfaceNode child = (IInterfaceNode) findFirstDescendantOfType(node,
                IInterfaceNode.class);
        return child;
    }
View Full Code Here

    }

    protected IFunctionNode getMethod(String code)
    {
        String source = "package {public class A {" + code + "}}";
        IFileNode node = getFileNode(source);
        IFunctionNode child = (IFunctionNode) findFirstDescendantOfType(node,
                IFunctionNode.class);
        return child;
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.IFileNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.