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

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


        IFileNode node = (IFileNode) getNode(
                "public class B {public function c() { d.b = 1; }; public function set b(value:int):void {}; public static function get d():B {}}",
                IFileNode.class, WRAP_LEVEL_PACKAGE, true);
        IFunctionNode fnode = (IFunctionNode) findFirstDescendantOfType(
                node, IFunctionNode.class);
        IClassNode classnode = (IClassNode) findFirstDescendantOfType(
                node, IClassNode.class);
        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
                fnode, IBinaryOperatorNode.class);
        ((NodeBase)fnode).setParent(null);
        IDefinition def = classnode.getDefinition();

        ((JSFlexJSEmitter)asEmitter).thisClass = def;
        asBlockWalker.visitBinaryOperator(bnode);
        assertOut("foo.bar.B.get_d().set_b(1)");
    }
View Full Code Here


        IFileNode node = (IFileNode) getNode(
                "class B extends C { public function c() { E(model).labelText = null; } } class C extends D {} class D { public var model:Object; } class E { public function set labelText(value:String) {} }",
                IFileNode.class, WRAP_LEVEL_PACKAGE, true);
        IFunctionNode fnode = (IFunctionNode) findFirstDescendantOfType(
                node, IFunctionNode.class);
        IClassNode classnode = (IClassNode) findFirstDescendantOfType(
                node, IClassNode.class);
        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
                fnode, IBinaryOperatorNode.class);
        ((NodeBase)fnode).setParent(null);
        IDefinition def = classnode.getDefinition();

        ((JSFlexJSEmitter)asEmitter).thisClass = def;
        asBlockWalker.visitBinaryOperator(bnode);
        assertOut("org.apache.flex.utils.Language.as(this.model, foo.bar.E, true).set_labelText(null)");
    }
View Full Code Here

    //----------------------------------

    @Test
    public void testClassCast()
    {
        IClassNode node = (IClassNode) getNode("import spark.components.Button; public class B implements Button { public function B() { Button(b).label = ''; } }", ClassNode.class, WRAP_LEVEL_PACKAGE);
        asBlockWalker.visitClass(node);
        assertOut("/**\n * @constructor\n * @implements {spark.components.Button}\n */\nB = function() {\n  org.apache.flex.utils.Language.as(b, spark.components.Button, true).set_label('');\n};");
    }
View Full Code Here

    //--------------------------------------------------------------------------

    @Test
    public void testSimple()
    {
        IClassNode node = getClassNode("public class A{}");
        asBlockWalker.visitClass(node);
        assertOut("public class A {\n}");
    }
View Full Code Here

    }

    @Test
    public void testSimpleInternal()
    {
        IClassNode node = getClassNode("internal class A{}");
        asBlockWalker.visitClass(node);
        assertOut("internal class A {\n}");
    }
View Full Code Here

    }

    @Test
    public void testSimpleFinal()
    {
        IClassNode node = getClassNode("public final class A{}");
        asBlockWalker.visitClass(node);
        assertOut("public final class A {\n}");
    }
View Full Code Here

    }

    @Test
    public void testSimpleDynamic()
    {
        IClassNode node = getClassNode("public dynamic class A{}");
        asBlockWalker.visitClass(node);
        assertOut("public dynamic class A {\n}");
    }
View Full Code Here

    }

    @Test
    public void testSimpleExtends()
    {
        IClassNode node = getClassNode("public class A extends B {}");
        asBlockWalker.visitClass(node);
        assertOut("public class A extends B {\n}");
    }
View Full Code Here

    }

    @Test
    public void testSimpleImplements()
    {
        IClassNode node = getClassNode("public class A implements IA {}");
        asBlockWalker.visitClass(node);
        assertOut("public class A implements IA {\n}");
    }
View Full Code Here

    }

    @Test
    public void testSimpleImplementsMultiple()
    {
        IClassNode node = getClassNode("public class A implements IA, IB, IC {}");
        asBlockWalker.visitClass(node);
        assertOut("public class A implements IA, IB, IC {\n}");
    }
View Full Code Here

TOP

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

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.