Package flex2.compiler.abc

Examples of flex2.compiler.abc.MetaData


                String elementTypeName = null;
                List<MetaData> mdList = getMetaDataList(StandardDefs.MD_ARRAYELEMENTTYPE);
   
                if (mdList != null)
                {
                    MetaData metaData = (MetaData) mdList.get(0);
   
                    if (metaData.count() > 0)
                    {
                        String value = metaData.getValue(0);

                        if (value != null)
                        {
                            elementTypeName = NameFormatter.toColon(value);
                        }
View Full Code Here


                String instanceTypeName = null;
   
                List<MetaData> mdList = getMetaDataList(StandardDefs.MD_INSTANCETYPE);
                if (mdList != null)
                {
                    MetaData metaData = (MetaData) mdList.get(0);
                    if (metaData.count() > 0)
                    {
                        instanceTypeName = NameFormatter.toColon(metaData.getValue(0));
                    }
                }

                if (instanceTypeName == null)
                {
View Full Code Here

        public Inspectable getInspectable()
        {
            List<MetaData> mdList = getMetaDataList(Inspectable.INSPECTABLE);
            if (mdList != null)
            {
                MetaData md = mdList.get(0);

                return new InspectableHelper(md.getValue(Inspectable.ENUMERATION),
                                             md.getValue(Inspectable.DEFAULT_VALUE),
                                             md.getValue(Inspectable.IS_DEFAULT),
                                             md.getValue(Inspectable.CATEGORY),
                                             md.getValue(Inspectable.IS_VERBOSE),
                                             md.getValue(Inspectable.TYPE),
                                             md.getValue(Inspectable.OBJECT_TYPE),
                                             md.getValue(Inspectable.ARRAY_TYPE),
                                             md.getValue(Inspectable.ENVIRONMENT),
                                             md.getValue(Inspectable.FORMAT));
            }
            else
            {
                return null;
            }
View Full Code Here

        public Deprecated getDeprecated()
        {
            List<MetaData> mdList = getMetaDataList(Deprecated.DEPRECATED);
            if (mdList != null)
            {
                MetaData md = mdList.get(0);

                String replacement = md.getValue(Deprecated.REPLACEMENT);
                String message     = md.getValue(Deprecated.MESSAGE);
                String since       = md.getValue(Deprecated.SINCE);

                // grab whatever string /was/ provided: [Deprecated("foo")]
                if ((replacement == null) &&
                        (message == null) &&
                          (since == null) && (md.count() > 0))
                {
                    message = md.getValue(0);
                }
               
                return new DeprecatedHelper(replacement, message, since);
            }
            else
View Full Code Here

                List<MetaData> mdList = var.getMetaData(StandardDefs.MD_CHANGEEVENT);
                if (mdList != null)
                {
                    for (int i = 0, size = mdList.size(); i < size; i++)
                    {
                        MetaData md = mdList.get(i);
                        if (name.equals(md.getValue(0)))
                        {
                            return true;
                        }
                    }
                }
View Full Code Here

        public String getPercentProxy()
        {
            List<MetaData> metaDataList = getMetaDataList(StandardDefs.MD_PERCENTPROXY);
            if (metaDataList != null && !metaDataList.isEmpty())
            {
                MetaData metaData = (MetaData) metaDataList.get(0);
                if (metaData.count() > 0)
                {
                    return metaData.getValue(0);
                }
            }

            return null;
        }
View Full Code Here

     */
    private static AtEmbed createResolved(ContextStatics perCompileData, Source source, String value, String path, int line, String prefix, boolean logInvalidEmbedOnMissingFile)
    {
        AtEmbed result = null;

        MetaData metaData = MetaDataParser.parse(perCompileData, source, line, value);
        String sourceValue = null;
        Map<String, Object> values = new HashMap<String, Object>();

        // Embed("foo.swf", "barSymbol", ...) or Embed("foo", "image/png", ...)
        if ((metaData.count() > 1) && (metaData.getKey(0) == null) && (metaData.getKey(1) == null))
        {
            sourceValue = metaData.getValue(0);
            String symbolOrMimeType = metaData.getValue(1);

            if (MimeMappings.getExtension(symbolOrMimeType) != null)
            {
                values.put(Transcoder.MIMETYPE, symbolOrMimeType);
            }
            else
            {
                values.put(Transcoder.SYMBOL, symbolOrMimeType);
            }
        }
        // Embed("foo.png", ...)
        else if ((metaData.count() > 0) && (metaData.getKey(0) == null))
        {
            sourceValue = metaData.getValue(0);
        }
        // Embed(skinClass="foo", source="bar.swc")
        else if ((metaData.getValue(Transcoder.SKINCLASS) != null) &&
                 (metaData.getValue(Transcoder.SOURCE) != null))
        {
            logSkinClassWithSourceNotSupported(value, path, line);               
        }
        // Embed(skinClass="foo")
        else if (metaData.getValue(Transcoder.SKINCLASS) != null)
        {
            String skinClass = metaData.getValue(Transcoder.SKINCLASS);
        }
        // Embed(source="foo.png")
        else
        {
            sourceValue = metaData.getValue(Transcoder.SOURCE);
        }

        // logInvalidEmbedOnMissingFile - if 'true', we will logInvalidEmbed(), however
        // in certain scenarios the caller needs to log a different error, so they pass 'false'.
        if (((sourceValue != null) &&
             tokenizeAndResolveSource(sourceValue, values, source, value, path, line, logInvalidEmbedOnMissingFile)) ||
            (metaData.getValue(Transcoder.SKINCLASS) != null))
        {
            for (Iterator it = metaData.getValueMap().entrySet().iterator(); it.hasNext();)
            {
                Map.Entry e = (Map.Entry) it.next();
                String key = (String) e.getKey();

                if (!values.containsKey(key))
View Full Code Here

  /**
   * create new AtEmbed instance
   */
  public static AtEmbed create(ContextStatics perCompileData, Source sourceFile, int beginLine, String value, boolean strType)
  {
    MetaData metaData = MetaDataParser.parse(perCompileData, sourceFile, beginLine, value.substring(1));

    if (metaData == null)
    {
      return null;
    }
    else if (metaData.count() == 0)
    {
      ThreadLocalToolkit.log(new NoEmbedParams(), sourceFile.getNameForReporting(), beginLine);
      return null;
    }

    String source = metaData.getValue("source");
    if (source == null)
    {
      if ((metaData.getKey( 0 ) == null) && (metaData.count() == 1))
        source = metaData.getValue( 0 );
    }

    Map<String, Object> values = getMetaDataMap( metaData );

        // This allows EmbedUtil to have an idea of where the original @Embed lived, so it
View Full Code Here

        // If we strip off the @ at the beginning of the directive,
        // we're left with a string like "Resource(bundle='MyResources', key='OPEN')"
        // that has the same syntax as a metadata body inside [...].
        // So we can parse it with MetaDataParser.
        MetaData metaData = MetaDataParser.parse(typeTable.getPerCompileData(), sourceFile, beginLine, value.substring(1));
        if (metaData == null)
        {
          return null;
        }
        else if (metaData.count() == 0)
        {
      ThreadLocalToolkit.log(new NoResourceParams(), sourceFile.getNameForReporting(), beginLine);
      return null;
        }

        String key = metaData.getValue("key");
       
        // Support the syntax @Resource('OPEN')
        // where only the key is specified.       
        if (key == null)
        {
           if ((metaData.getKey(0) == null) && (metaData.count() == 1))
            {
                key = metaData.getValue(0);
            }
          else
            {
        ThreadLocalToolkit.log(new NoResourceKeyParam(), sourceFile.getNameForReporting(), beginLine);
        return null;
            }
        }
        String bundle = metaData.getValue("bundle");
   
        // If the bundle name isn't specified, use the class name.
        if (bundle == null)
    {
      if (metaData.count() > 1)
      {
        ThreadLocalToolkit.log(new NoResourceBundleParam(), sourceFile.getNameForReporting(), beginLine);
        return null;
      }
      bundle = NameFormatter.qNameFromSource(sourceFile).toString();
View Full Code Here

      acc.setHeight(Integer.toString(config.getDefaultHeight()));
        acc.setWidth(Integer.toString(config.getDefaultWidth()));
        acc.setSwfVersion(config.getSwfVersion());
        acc.setScriptRecursionLimit(config.getScriptRecursionLimit());
        acc.setScriptTimeLimit(config.getScriptTimeLimit());
        CompilerConfiguration cc = acc.getCompilerConfiguration();
        cc.setAccessible(config.getCompilerAccessible());
        List<String> externalLibraries = config.getCompilerExternalLibraryPath();
        String[] extlibs = new String[externalLibraries.size()];
        externalLibraries.toArray(extlibs);
        try
        {
            cc.cfgExternalLibraryPath(null, extlibs);
        }
        catch (ConfigurationException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of flex2.compiler.abc.MetaData

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.