Package flex2.compiler.io

Examples of flex2.compiler.io.DeletedFile


                                                          cv);
  }

  public static ConfigurationInfo getLoadConfigInfo()
    {
        return new ConfigurationInfo( 1, "filename" )
        {
            public boolean allowMultiple()
            {
                return true;
            }
View Full Code Here


        this.output = Configuration.getOutputPath(val, output);
  }

  public static ConfigurationInfo getOutputInfo()
  {
      return new ConfigurationInfo(1, "filename")
      {
          public boolean isRequired()
          {
              return false;
          }
View Full Code Here

    projector = getVirtualFile(path, cfgval);
  }

    public static ConfigurationInfo getProjectorInfo()
    {
        return new ConfigurationInfo()
        {
            public boolean isHidden()
            {
                return true;
            }
View Full Code Here

        // intercepted upstream in order to allow help text to be printed even when args are otherwise bad
    }
   
    public static ConfigurationInfo getHelpInfo()
    {
        return new ConfigurationInfo( -1, "keyword" )
        {
            public boolean isGreedy()
      {
        return true;
      }
View Full Code Here

        classes.addAll( toQNameString(args) );
    }

    public static ConfigurationInfo getIncludeClassesInfo()
    {
        return new ConfigurationInfo( -1, new String[] { "class" } )
        {
            public boolean allowMultiple()
            {
                return true;
            }
View Full Code Here

              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addComponent((String) valArgs.get(k));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-file".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  this.addArchiveFile((String) valArgs.get(0), new File((String) valArgs.get(1)));
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-namespaces".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    try
                    {
                      this.addComponent(new URI((String) valArgs.get(k)));
                    }
                    catch (URISyntaxException ex)
                    {
                      ex.printStackTrace();
                    }
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-resource-bundles".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addResourceBundle((String) valArgs.get(k));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-sources".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addComponent(new File((String) valArgs.get(k)));
                  }
                }
View Full Code Here

      long ts = readLong(in);

      if (f == null)
      {
        // C: create an instance of DeletedFile...
        f = new DeletedFile(fileName);
      }

      includes.add(f);
      includeTimes.put(f, new Long(ts));
    }

    size = readU32(in);
    LocalLogger logger = size == 0 ? null : new LocalLogger(null);

    for (int i = 0; i < size; i++)
    {
      String path = (String) pool[readU32(in)];
      if (path.length() == 0)
      {
        path = null;
      }
      String warning = (String) pool[readU32(in)];
      if (warning.length() == 0)
      {
        warning = null;
      }
      String source = (String) pool[readU32(in)];
      if (source.length() == 0)
      {
        source = null;
      }
      int line = readU32(in);
      int col = readU32(in);
      int errorCode = readU32(in);

      logger.recordWarning(path,
                           line == -1 ? null : IntegerPool.getNumber(line),
                           col == -1 ? null : IntegerPool.getNumber(col),
                           warning,
                           source,
                           errorCode == -1 ? null : IntegerPool.getNumber(errorCode));
    }


    byte[] abc = (hasUnit) ? (byte[]) pool[readU32(in)] : null;
    Source s = null;

    if (owner == 0) // FileSpec
    {
      Collection<Source> c = fileSpec.sources();
      for (Iterator<Source> i = c.iterator(); i.hasNext();)
      {
        s = i.next();
        if (s.getName().equals(name))
        {
          Source.populateSource(s, fileTime, pathRoot, relativePath, shortName, fileSpec, isInternal, isRoot, isDebuggable,
                                includes, includeTimes, logger);
          break;
        }
      }
    }
    else if (owner == 1) // SourceList
    {
      Collection<Source> c = sourceList.sources().values();
      for (Iterator<Source> i = c.iterator(); i.hasNext();)
      {
        s = i.next();
        if (s.getName().equals(name))
        {
          Source.populateSource(s, fileTime, pathRoot, relativePath, shortName, sourceList, isInternal, isRoot, isDebuggable,
                                includes, includeTimes, logger);
          break;
        }
      }
    }
    else if (owner == 2) // SourcePath
    {
      Map<String, Source> c = sourcePath.sources();
      String className = mappings.get(name);

      if ((className != null) && !c.containsKey(className))
      {
        VirtualFile f = resolver.resolve(name);

        if (f == null)
        {
          f = new DeletedFile(name);
        }

        s = Source.newSource(f, fileTime, pathRoot, relativePath, shortName, sourcePath, isInternal, isRoot, isDebuggable,
                             includes, includeTimes, logger);
        c.put(className, s);
      }
      else
      {
        assert false : name;
      }
    }
    else if (owner == 3) // ResourceContainer
    {
      if (resources == null)
      {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
        throw new IOException(l10n.getLocalizedTextString(new NoResourceContainer()));
      }

      s = Source.newSource(abc, name, fileTime, pathRoot, relativePath, shortName, resources, isInternal, isRoot, isDebuggable,
                           includes, includeTimes, logger);
      s = resources.addResource(s);
    }
    else if (owner == 4) // ResourceBundlePath
    {
      Map<String, Source> c = bundlePath.sources();
      Object[] value = (Object[]) rbMappings.get(name);
      String bundleName = (String) value[0];
      String[] rNames = (String[]) value[1];
      String[] rRoots = (String[]) value[2];

      if (bundleName != null)
      {
        VirtualFile[] rFiles = new VirtualFile[rNames.length];

        for (int i = 0; i < rFiles.length; i++)
        {
          if (rNames[i] != null)
          {
            rFiles[i] = resolver.resolve(rNames[i]);
            if (rFiles[i] == null)
            {
              rFiles[i] = new DeletedFile(rNames[i]);
            }
          }
        }

        VirtualFile[] rRootFiles = new VirtualFile[rRoots.length];

        for (int i = 0; i < rRootFiles.length; i++)
        {
          if (rRoots[i] != null)
          {
            rRootFiles[i] = resolver.resolve(rRoots[i]);
            if (rRootFiles[i] == null)
            {
              rRootFiles[i] = new DeletedFile(rRoots[i]);
            }
          }
        }

        VirtualFile f = new ResourceFile(name, bundlePath.getLocales(), rFiles, rRootFiles);
View Full Code Here

        else
        {
          f = resolver.resolve(pathName);
          if (f == null)
          {
            f = new DeletedFile(pathName);
          }
        }

        assets.put(className, new AssetInfo(null, f, readLong(in), null));
      }
View Full Code Here

        // it's not in the HashMap. let's locate it in the file system.
        File absolute = FileUtil.openFile(name);
        if (absolute != null && absolute.exists())
        {
            return new LocalFile(absolute);
        }
       
        File relative = FileUtil.openFile(fullName);
        if (relative != null && relative.exists())
        {
            return new LocalFile(relative);
        }
       
        return null;
    }
View Full Code Here

     *
     * @param includeSource A source file.
     */
    public void addComponent(File includeSource)
    {
        sources.add(new LocalFile(includeSource));
    }
View Full Code Here

TOP

Related Classes of flex2.compiler.io.DeletedFile

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.