Package flex2.compiler.mxml.rep.init

Examples of flex2.compiler.mxml.rep.init.NamedInitializer


            {
                File file = FileUtil.openFile(directory, relativePath);

                if ((file != null) && file.exists())
                {
                    return new LocalFile(file);
                }
            }
        }

        return null;
View Full Code Here


      {
        Class retType = info.getGetterMethod().getReturnType();

        if (VirtualFile.class.isAssignableFrom(retType))
        {
          VirtualFile file = (VirtualFile) info.getGetterMethod().invoke(targetConfig, (Object[])null);
          if (file != null)
          {
            if (info.doChecksum())
              compile_checksum.append(file.getName());
            link_checksum.append(file.getName());
          }
          continue;
        }
        else if (retType.isArray() && VirtualFile.class.isAssignableFrom(retType.getComponentType()))
        {
          VirtualFile[] files = (VirtualFile[]) info.getGetterMethod().invoke(targetConfig, (Object[])null);
          for (int j = 0; files != null && j < files.length; j++)
          {
            if (files[j] != null)
            {
              if (info.doChecksum())
                compile_checksum.append(files[j].getName());
              link_checksum.append(files[j].getName());
            }
          }
          continue;
        }
      }

      if (args[i] instanceof Object[])
      {
        Object[] a = (Object[]) args[i];
        for (int j = 0; j < a.length; j++)
        {
          if (info.doChecksum())
            compile_checksum.append(a[j]);
          link_checksum.append(a[j]);
        }
      }
      else if (args[i] instanceof List)
      {
        List l = (List) args[i];
        for (int j = 0; j < l.size(); j++)
        {
          if (info.doChecksum())
            compile_checksum.append(l.get(j));
          link_checksum.append(l.get(j));
        }
      }
      else
      {
        if (info.doChecksum())
          compile_checksum.append(args[i]);
        link_checksum.append(args[i]);
      }
    }

    if (info.getGetterMethod() == null)
    {
      // C: need to make sure that all the VirtualFile-based config values should have getters.
      return;
    }

    Class retType = info.getGetterMethod().getReturnType();

    if (VirtualFile.class.isAssignableFrom(retType))
    {
      VirtualFile file = (VirtualFile) info.getGetterMethod().invoke(targetConfig, (Object[])null);
      if (file != null && !file.isDirectory())
      {
        if (info.doChecksum())
          compile_checksum_ts.append(file.getLastModified());
        link_checksum_ts.append(file.getLastModified());
      }
    }
    else if (retType.isArray() && VirtualFile.class.isAssignableFrom(retType.getComponentType()))
    {
      VirtualFile[] files = (VirtualFile[]) info.getGetterMethod().invoke(targetConfig, (Object[])null);
View Full Code Here

    /**
     * Create virtual file for given file and throw configuration exception if not possible
     */
    public static VirtualFile getVirtualFile(String path, boolean reportError) throws ConfigurationException
    {
        VirtualFile result = null;
        File file = new File(path);

        if (file != null && file.exists())
        {
            try
View Full Code Here

    {
            // No need to check to see if the appPath is supported again.
      if ((appPath != null && files[i].getName().equals(appPath.getName())) || isSupported(files[i]))
      {
        String name = files[i].getName();
        VirtualFile pathRoot = calculatePathRoot(files[i]);
        if (pathRoot != null)
        {
                    String relativePath = calculateRelativePath(name);
                    String namespaceURI = relativePath.replace('/', '.');
                    String localPart = calculateLocalPart(name);
View Full Code Here

        standardDefs.set(defs);
    }

    public static StandardDefs getStandardDefs()
    {
        StandardDefs defs = standardDefs.get();
        if (defs == null)
        {
            defs = StandardDefs.getStandardDefs("halo");
            setStandardDefs(defs);
        }
View Full Code Here

            ArgumentListNode propertiesFactoryArgumentList = null;

            // properties
            while (propIter.hasNext())
            {
                NamedInitializer init = (NamedInitializer) propIter.next();
                if (!init.isStateSpecific())
                {
                    IdentifierNode propertyIdentifier = nodeFactory.identifier(init.getName());
                    Node valueExpr = init.generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
                    LiteralFieldNode propertyLiteralField = nodeFactory.literalField(propertyIdentifier,
                                                                                 valueExpr);
                    propertiesFactoryArgumentList = nodeFactory.argumentList(propertiesFactoryArgumentList,
                                                                         propertyLiteralField);
                }
            }

            // designLayer
            if (hasDesignLayer)
            {
              if (model.getType().isAssignableTo(model.getStandardDefs().INTERFACE_IVISUALELEMENT))
                {
                    IdentifierNode layerPropertyIdentifier = nodeFactory.identifier(DESIGN_LAYER, false);
                    MemberExpressionNode memberExpression =
                        AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, model.layerParent.getId(), true);
                  LiteralFieldNode layerLiteralField = nodeFactory.literalField(layerPropertyIdentifier, memberExpression);
                  propertiesFactoryArgumentList = nodeFactory.argumentList(propertiesFactoryArgumentList,
                      layerLiteralField);
                }
            }
           
            // visual children
            if (vcIter.hasNext())
            {
                IdentifierNode childDescriptorsIdentifier = nodeFactory.identifier(CHILD_DESCRIPTORS, false);
                ArgumentListNode childDescriptorsArgumentList = null;

                while (vcIter.hasNext())
                {
                    VisualChildInitializer init = (VisualChildInitializer) vcIter.next();
                    Model child = (MovieClip)init.getValue();
                    if (child.isDescriptorInit())
                    {
                        MemberExpressionNode memberExpression =
                            addDescriptorInitializerFragments(nodeFactory, configNamespaces, generateDocComments,
                                                              (MovieClip) init.getValue(), null, true);
                        childDescriptorsArgumentList = nodeFactory.argumentList(childDescriptorsArgumentList,
                                                                            memberExpression);
                    }
                }
View Full Code Here

            functionSignature.void_anno = true;
            StatementListNode body = null;

      while (styleAndEffectIter.hasNext())
      {
        NamedInitializer init = (NamedInitializer) styleAndEffectIter.next();
                ThisExpressionNode thisExpression = nodeFactory.thisExpression(-1);
                IdentifierNode identifier = nodeFactory.identifier(init.getName());
                Node valueExpr = init.generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
                ArgumentListNode styleAndEffectArgumentList = nodeFactory.argumentList(null, valueExpr);
                SetExpressionNode setExpression = nodeFactory.setExpression(identifier, styleAndEffectArgumentList, false);
                MemberExpressionNode memberExpression = nodeFactory.memberExpression(thisExpression, setExpression);
                ListNode styleAndEffectList = nodeFactory.list(null, memberExpression);
                ExpressionStatementNode expressionStatement = nodeFactory.expressionStatement(styleAndEffectList);
View Full Code Here

            functionSignature.void_anno = true;
            StatementListNode body = null;

            while (iterator.hasNext())
            {
                NamedInitializer namedInitializer = (NamedInitializer) iterator.next();
                thisExpression = nodeFactory.thisExpression(-1);
                IdentifierNode nameIdentifier = nodeFactory.identifier(namedInitializer.getName());
                Node rvalue = namedInitializer.generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
                ArgumentListNode argumentList = nodeFactory.argumentList(null, rvalue);
                SetExpressionNode setExpression = nodeFactory.setExpression(nameIdentifier, argumentList, false);
                MemberExpressionNode memberExpression = nodeFactory.memberExpression(thisExpression, setExpression);
                ListNode list = nodeFactory.list(null, memberExpression);
                ExpressionStatementNode expressionStatement = nodeFactory.expressionStatement(list);
View Full Code Here

            for (Iterator<Initializer> iter = model.getPropertyInitializerIterator(false); iter.hasNext(); )
            {
                Initializer init = iter.next();
                if (init instanceof NamedInitializer)
                {
                    NamedInitializer namedInit = (NamedInitializer) init;
                    String initName = namedInit.getName();
                    if (!initName.equals("name") && !initName.equals("stateGroups") && !initName.equals("overrides"))
                    {
                        list.add(indent, initName + ": " + namedInit.getValueExpr() + ",", 0);
                    }
                }
            }
           
            // State groups
View Full Code Here

            for (Iterator<Initializer> iter = model.getPropertyInitializerIterator(false); iter.hasNext(); )
            {
                Initializer init = iter.next();
                if (init instanceof NamedInitializer)
                {
                    NamedInitializer namedInit = (NamedInitializer) init;
                    String initName = namedInit.getName();
                    if (!initName.equals("name") && !initName.equals("stateGroups") && !initName.equals("overrides"))
                    {
                        IdentifierNode propIdentifier = nodeFactory.identifier(initName);
                        literalField = nodeFactory.literalField(propIdentifier,
                                                                namedInit.generateValueExpr(nodeFactory, configNamespaces,
                                                                                            generateDocComments));
                        stateArguments = nodeFactory.argumentList(stateArguments, literalField);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of flex2.compiler.mxml.rep.init.NamedInitializer

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.