Package org.apache.flex.compiler.definitions

Examples of org.apache.flex.compiler.definitions.IClassDefinition


        eventCounter = 0;
        idCounter = 0;

        // visit MXML
        IClassDefinition cdef = node.getClassDefinition();
        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
                .getASEmitter();
        ((JSFlexJSEmitter) asEmitter).thisClass = cdef;

        // visit tags
View Full Code Here


        eventCounter = 0;
        oldIdCounter = idCounter;
        idCounter = 0;

        // visit MXML
        IClassDefinition cdef = node.getContainedClassDefinition();
        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
                .getASEmitter();
        ((JSFlexJSEmitter) asEmitter).thisClass = cdef;

        IASNode classNode = node.getContainedClassDefinitionNode();
        // visit tags
        final int len = classNode.getChildCount();
        for (int i = 0; i < len; i++)
        {
            getMXMLWalker().walk(classNode.getChild(i));
        }

        String cname = cdef.getQualifiedName();
        subDocumentNames.add(cname);
        String baseClassName = cdef.getBaseClassAsDisplayString();

        emitClassDeclStart(cname, baseClassName, false);

        emitPropertyDecls();
       
View Full Code Here

    public void emitInstance(IMXMLInstanceNode node)
    {
        if (isStateDependent(node) && !inStatesOverride)
            return;
       
        IClassDefinition cdef = node
                .getClassReference((ICompilerProject) getMXMLWalker()
                        .getProject());

        MXMLDescriptorSpecifier currentPropertySpecifier = getCurrentDescriptor("ps");

        String id = node.getID();
        if (id == null)
            id = node.getEffectiveID();
        if (id == null)
            id = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken() + idCounter++;

        MXMLDescriptorSpecifier currentInstance = new MXMLDescriptorSpecifier();
        currentInstance.isProperty = false;
        currentInstance.id = id;
        currentInstance.name = cdef.getQualifiedName();
        currentInstance.parent = currentPropertySpecifier;

        if (currentPropertySpecifier != null)
            currentPropertySpecifier.propertySpecifiers.add(currentInstance);
        else if (inMXMLContent)
View Full Code Here

   
    @Override
    public void emitMethodDoc(IFunctionNode node, ICompilerProject project)
    {
        IClassNode cnode = (IClassNode) node.getAncestorOfType(IClassNode.class);
        IClassDefinition classDefinition = cnode.getDefinition();

        if (node instanceof IFunctionNode)
        {
            boolean hasDoc = false;

            if (node.isConstructor())
            {
                begin();
                hasDoc = true;
               
                write(" * @constructor\n");
               
                IClassDefinition parent = (IClassDefinition) node.getDefinition().getParent();
                IClassDefinition superClass = parent.resolveBaseClass(project);
              String qname = superClass.getQualifiedName();
             
                if (superClass != null && !qname.equals("Object"))
                    emitExtends(superClass);
               
              IReference[] interfaceReferences = classDefinition.getImplementedInterfaceReferences();
View Full Code Here

    @Override
    public void emitMethod(IFunctionNode node)
    {
        if (node.isConstructor())
        {
            IClassDefinition definition = getClassDefinition(node);

            FunctionNode fn = (FunctionNode) node;
            fn.parseFunctionBody(new ArrayList<ICompilerProblem>());

            String qname = definition.getQualifiedName();
            write(qname);
            write(" ");
            write("=");
            write(" ");
            write("function");
View Full Code Here

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

    @Override
    public void emitClass(IClassNode node)
    {
        IClassDefinition definition = node.getDefinition();

        // constructor
        emitMethod((IFunctionNode) definition.getConstructor().getNode());
        write(";");

        IDefinitionNode[] members = node.getAllMemberNodes();
        for (IDefinitionNode dnode : members)
        {
View Full Code Here

    }
   
    @Override
    public void emitField(IVariableNode node)
    {
        IClassDefinition definition = getClassDefinition(node);

        getDoc().emitFieldDoc(node);

        String root = "";
        if (!node.isConst())
          root = "prototype.";
        write(definition.getQualifiedName() + "." + root + node.getName());
       
        IExpressionNode vnode = node.getAssignedValueNode();
        if (vnode != null)
        {
            write(" = ");
View Full Code Here

        return tnode.getDefinition();
    }

    private static IClassDefinition getSuperClassDefinition(IDefinitionNode node, ICompilerProject project)
    {
        IClassDefinition parent = (IClassDefinition) node.getDefinition().getParent();
        IClassDefinition superClass = parent.resolveBaseClass(project);
        return superClass;
    }
View Full Code Here

        return superClass;
    }

    private static boolean hasSuperClass(IDefinitionNode node, ICompilerProject project)
    {
      IClassDefinition superClassDefinition = getSuperClassDefinition(node, project);
      String qname = superClassDefinition.getQualifiedName();
      return superClassDefinition != null && !qname.equals("Object");
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.definitions.IClassDefinition

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.