org.tizen.common.builder_2.0.0.201311012034

16:49:49.563 INFO  jd.cli.Main - Decompiling org.tizen.common.builder_2.0.0.201311012034.jar
package org.tizen.common.builder;

import java.util.Set;

public abstract interface BuildDependency
{
  public abstract void addVertex(Resource paramResource);
  
  public abstract boolean containsVertex(Resource paramResource);
  
  public abstract void removeVertex(Resource paramResource);
  
  public abstract void addEdge(Resource paramResource1, Resource paramResource2, Dependency paramDependency);
  
  public abstract void removeEdge(Dependency paramDependency);
  
  public abstract Set<Dependency> edgesOf(Resource paramResource);
  
  public abstract Resource getEdgeSource(Dependency paramDependency);
  
  public abstract Resource getEdgeTarget(Dependency paramDependency);
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.BuildDependency
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import java.util.Comparator;

class BuildProcess$1
  implements Comparator<Resource>
{
  BuildProcess$1(BuildProcess paramBuildProcess) {}
  
  public int compare(Resource o1, Resource o2)
  {
    ResourceLayer l1 = o1.getLayer();
    ResourceLayer l2 = o2.getLayer();
    
    ResourceLayer iter = l1;
    while (iter != null)
    {
      if (iter == l2) {
        return 1;
      }
      iter = iter.getParent();
    }
    return -1;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.BuildProcess.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.TreeSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.builder.dependency.DependencyInMemory;
import org.tizen.common.builder.exception.BuildException;
import org.tizen.common.file.FileHandler;
import org.tizen.common.util.Assert;
import org.tizen.common.util.CollectionUtil;
import org.tizen.common.util.FileUtil;
import org.tizen.common.util.FilenameUtil;

public class BuildProcess
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  protected final HashMap<ResourceLayer, Builder> resources2builder = new HashMap();
  protected final List<Builder> builders = new ArrayList();
  protected final BuildDependency dependencies = new DependencyInMemory();
  protected boolean bInitialize = false;
  
  public void addBuilder(Builder builder)
  {
    builders.add(builder);
  }
  
  public ResourceLayer getLastResourceLayer()
  {
    Builder lastBuilder = getLastBuilder();
    return lastBuilder != null ? lastBuilder.getResourceLayer() : null;
  }
  
  public Builder getLastBuilder()
  {
    return (Builder)CollectionUtil.pickupLast(builders);
  }
  
  public Builder getBuilder(String layerName)
  {
    Assert.notNull(layerName);
    
    Builder result = null;
    for (Builder builder : builders)
    {
      String name = builder.getResourceLayer().getName();
      if (layerName.equals(name))
      {
        result = builder;
        break;
      }
    }
    logger.debug("Find a builder by ResourceLayer name {} : {}", 
      layerName, result != null ? result.getResourceLayer().getName() : "Not found");
    
    return result;
  }
  
  public void enableBuilder(String layerName, Resource... resources)
    throws IOException, BuildException
  {
    Builder builder = getBuilder(layerName);
    if (builder == null) {
      return;
    }
    if (builder.isEnabled()) {
      return;
    }
    builder.setEnabled(true);
    
    ResourceLayer builderLayer = builder.getResourceLayer();
    
    Collection<Resource> rebuildResource = new HashSet();
    Resource[] arrayOfResource;
    int j = (arrayOfResource = resources).length;
    for (int i = 0; i < j; i++)
    {
      Resource resource = arrayOfResource[i];
      Resource res = builderLayer.getResource(resource.getPath());
      if (res != null) {
        rebuildResource.add(res);
      }
    }
    removeResources((Resource[])rebuildResource.toArray(new Resource[0]));
  }
  
  public void disableBuilder(String layerName)
    throws BuildException, IOException
  {
    Builder builder = getBuilder(layerName);
    if (builder == null) {
      return;
    }
    if (!builder.isEnabled()) {
      return;
    }
    builder.setEnabled(false);
    
    ResourceLayer builderLayer = builder.getResourceLayer();
    
    FileHandler builderHandler = builderLayer.getFileHandler();
    File cwdFile = new File(builderHandler.getCurrentWorkingDirectory());
    List<File> findFiles = FileUtil.findFiles(cwdFile, ".*", true);
    
    Collection<Resource> rebuildResource = new HashSet();
    for (File removeFile : findFiles)
    {
      String removePath = FilenameUtil.getRelativePath(cwdFile.getCanonicalPath(), removeFile.getCanonicalPath());
      Resource res = builderLayer.getResource(removePath);
      if (res != null) {
        rebuildResource.add(res);
      }
      builderLayer.removeResource(removePath);
    }
    removeResources((Resource[])rebuildResource.toArray(new Resource[0]));
  }
  
  protected Collection<Resource> getSortedResource(Collection<Resource> resources)
  {
    TreeSet<Resource> sortedResources = new TreeSet(new Comparator()
    {
      public int compare(Resource o1, Resource o2)
      {
        ResourceLayer l1 = o1.getLayer();
        ResourceLayer l2 = o2.getLayer();
        
        ResourceLayer iter = l1;
        while (iter != null)
        {
          if (iter == l2) {
            return 1;
          }
          iter = iter.getParent();
        }
        return -1;
      }
    });
    sortedResources.addAll(resources);
    
    return sortedResources;
  }
  
  public void build(Resource... resources)
    throws BuildException
  {
    Collection<Resource> sortedResources = getSortedResource(Arrays.asList(resources));
    try
    {
      Collection<Resource> projectedResources = new ArrayList();
      for (Resource resource : sortedResources) {
        projectedResources.addAll(removeResource(resource));
      }
      logger.debug("Build target :{}", projectedResources);
      Collection<Resource> iter = projectedResources;
      for (int i = 0; !iter.isEmpty(); i++)
      {
        logger.debug("{} th iteration :{}", Integer.valueOf(i), iter);
        iter = buildInternal(iter);
      }
    }
    catch (IOException e)
    {
      throw new BuildException(e);
    }
  }
  
  public Collection<Resource> buildInternal(Collection<Resource> resources)
    throws BuildException
  {
    Collection<Resource> next = new LinkedHashSet();
    for (Resource resource : resources) {
      if (isValidResource(resource)) {
        for (Builder builder : builders)
        {
          boolean bEnabled = builder.isEnabled();
          logger.debug("{} is enabled? {}", new Object[] { builder, Boolean.valueOf(bEnabled) });
          if (bEnabled)
          {
            boolean bBuilt = isBuiltResource(builder.getResourceLayer(), resource);
            logger.debug("{} is a built resource in {}? {}", new Object[] { resource, builder.getResourceLayer(), Boolean.valueOf(bBuilt) });
            if (!bBuilt)
            {
              boolean bBuild = builder.canBuild(resource);
              logger.debug("{} can build {}? {}", new Object[] { builder, resource, Boolean.valueOf(bBuild) });
              if (bBuild)
              {
                dependencies.addVertex(resource);
                BuildResult result = builder.build(resource);
                if (result == null) {
                  break;
                }
                Iterator localIterator4;
                for (Iterator localIterator3 = result.getInputs().iterator(); localIterator3.hasNext(); localIterator4.hasNext())
                {
                  Resource in = (Resource)localIterator3.next();
                  if (!dependencies.containsVertex(in)) {
                    dependencies.addVertex(in);
                  }
                  localIterator4 = result.getOutputs(in).iterator(); continue;Resource out = (Resource)localIterator4.next();
                  if (!dependencies.containsVertex(out)) {
                    dependencies.addVertex(out);
                  }
                  dependencies.addEdge(in, out, new Dependency());
                  
                  next.add(out);
                  
                  logger.debug("Add edge : {} / {}", in.getLayer(), in.getPath());
                  logger.debug("        => {} / {}", out.getLayer(), out.getPath());
                }
                break;
              }
            }
          }
        }
      }
    }
    return next;
  }
  
  public void removeResources(Resource... resources)
    throws BuildException
  {
    Collection<Resource> next = new LinkedHashSet();
    Resource[] arrayOfResource;
    int j = (arrayOfResource = resources).length;
    for (int i = 0; i < j; i++)
    {
      Resource resource = arrayOfResource[i];
      try
      {
        next.addAll(removeResource(resource));
      }
      catch (IOException e)
      {
        throw new BuildException(e);
      }
    }
    build((Resource[])next.toArray(new Resource[0]));
  }
  
  protected Collection<Resource> removeResource(Resource resource)
    throws IOException
  {
    logger.debug("Remove resource :{}", resource);
    ArrayList<Resource> ret = new ArrayList();
    if (!dependencies.containsVertex(resource))
    {
      ret.add(resource);
      return ret;
    }
    ResourceLayer topLayer = getLastBuilder().getResourceLayer();
    
    boolean bChange = resource.equals(resource.getLayer().getResource(resource.getPath()));
    for (Dependency dependency : dependencies.edgesOf(resource))
    {
      dependencies.removeEdge(dependency);
      
      Resource source = dependencies.getEdgeSource(dependency);
      Resource target = dependencies.getEdgeTarget(dependency);
      
      logger.debug("Remove edge : {} / {}", source.getLayer(), source.getPath());
      logger.debug("        => {} / {}", target.getLayer(), target.getPath());
      if (resource.equals(source))
      {
        target.getLayer().removeResource(target.getPath());
        removeResource(target);
      }
      else if ((!bChange) && (resource.equals(target)))
      {
        Resource testResource = topLayer.getResource(source.getPath());
        if (resource.equals(testResource)) {
          ret.add(testResource);
        } else {
          ret.add(source);
        }
      }
    }
    if (bChange) {
      ret.add(resource);
    }
    dependencies.removeVertex(resource);
    
    return ret;
  }
  
  public Collection<Resource> getResult(Resource... resources)
    throws IOException
  {
    Collection<Resource> result = new HashSet();
    Resource[] arrayOfResource;
    int j = (arrayOfResource = resources).length;
    for (int i = 0; i < j; i++)
    {
      Resource resource = arrayOfResource[i];
      Resource resultResource = getLastBuilder().getResourceLayer().getResource(resource.getPath());
      result.add(resultResource);
    }
    return result;
  }
  
  protected boolean isValidResource(Resource resource)
  {
    ResourceLayer iter = getLastBuilder().getResourceLayer();
    
    ResourceLayer resourceLayer = resource.getLayer();
    while (iter != null)
    {
      if (iter == resourceLayer) {
        return !iter.isFilterResource(resource);
      }
      iter = iter.getParent();
    }
    return false;
  }
  
  protected boolean isBuiltResource(ResourceLayer currentLayer, Resource resource)
  {
    logger.trace("Resource :{}", resource);
    
    ResourceLayer iter = resource.getLayer();
    if (currentLayer == iter)
    {
      logger.debug("Layer is matching");
      return true;
    }
    iter = iter.getParent();
    while (iter != null)
    {
      if (currentLayer == iter)
      {
        logger.debug("Find it");
        return true;
      }
      iter = iter.getParent();
    }
    logger.debug("Can't find it");
    return false;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.BuildProcess
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import java.util.Collection;
import org.tizen.common.util.CollectionMap;

public class BuildResult
{
  CollectionMap<Resource, Resource> in2out = new CollectionMap();
  
  public void addDependency(Resource in, Resource out)
  {
    in2out.put(in, out);
  }
  
  public Collection<Resource> getInputs()
  {
    return in2out.keySet();
  }
  
  public Collection<Resource> getOutputs(Resource input)
  {
    return in2out.get(input);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.BuildResult
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import org.tizen.common.builder.exception.BuildException;

public abstract interface Builder
{
  public abstract ResourceLayer getResourceLayer();
  
  public abstract void setResourceLayer(ResourceLayer paramResourceLayer);
  
  public abstract boolean canBuild(Resource paramResource);
  
  public abstract BuildResult build(Resource paramResource)
    throws BuildException;
  
  public abstract boolean isEnabled();
  
  public abstract void setEnabled(boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.Builder
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import org.jgrapht.graph.DefaultEdge;

public class Dependency
  extends DefaultEdge
{
  private static final long serialVersionUID = -5661642289487372891L;
  protected Builder builder;
  
  public Dependency() {}
  
  public Dependency(Builder builder)
  {
    this.builder = builder;
  }
  
  public Builder getBuilder()
  {
    return builder;
  }
  
  public void setBuilder(Builder builder)
  {
    this.builder = builder;
  }
  
  public Resource getSource()
  {
    return (Resource)super.getSource();
  }
  
  public Resource getTarget()
  {
    return (Resource)super.getTarget();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.Dependency
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.tizen.common.file.FileHandler;
import org.tizen.common.file.FileHandler.Attribute;
import org.tizen.common.file.IResource;

public class Resource
  implements IResource
{
  protected String path;
  protected ResourceLayer layer;
  
  public Resource(ResourceLayer layer, String path)
  {
    this.layer = layer;
    this.path = path;
  }
  
  public String getName()
    throws IOException
  {
    return (String)getLayer().getFileHandler().get(path, FileHandler.Attribute.NAME);
  }
  
  public String getPath()
  {
    return path;
  }
  
  public ResourceLayer getLayer()
  {
    return layer;
  }
  
  public InputStream getContents()
    throws IOException
  {
    return layer.getFileHandler().read(path);
  }
  
  public void setContents(InputStream in)
    throws IOException
  {
    layer.getFileHandler().write(path, in);
  }
  
  /* Error */
  public void setContents(byte[] contents)
    throws IOException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_2
    //   2: new 70	java/io/ByteArrayInputStream
    //   5: dup
    //   6: aload_1
    //   7: invokespecial 72	java/io/ByteArrayInputStream:<init>	([B)V
    //   10: astore_2
    //   11: aload_0
    //   12: aload_2
    //   13: invokevirtual 74	org/tizen/common/builder/Resource:setContents	(Ljava/io/InputStream;)V
    //   16: goto +17 -> 33
    //   19: astore_3
    //   20: iconst_1
    //   21: anewarray 3	java/lang/Object
    //   24: dup
    //   25: iconst_0
    //   26: aload_2
    //   27: aastore
    //   28: invokestatic 76	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   31: aload_3
    //   32: athrow
    //   33: iconst_1
    //   34: anewarray 3	java/lang/Object
    //   37: dup
    //   38: iconst_0
    //   39: aload_2
    //   40: aastore
    //   41: invokestatic 76	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   44: return
    // Line number table:
    //   Java source line #87	-> byte code offset #0
    //   Java source line #89	-> byte code offset #2
    //   Java source line #90	-> byte code offset #11
    //   Java source line #91	-> byte code offset #19
    //   Java source line #92	-> byte code offset #26
    //   Java source line #93	-> byte code offset #31
    //   Java source line #91	-> byte code offset #33
    //   Java source line #92	-> byte code offset #39
    //   Java source line #94	-> byte code offset #44
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	45	0	this	Resource
    //   0	45	1	contents	byte[]
    //   1	39	2	bais	java.io.ByteArrayInputStream
    //   19	13	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   2	19	19	finally
  }
  
  public int hashCode()
  {
    return new HashCodeBuilder().append(layer).append(path).toHashCode();
  }
  
  public boolean equals(Object obj)
  {
    if (!(obj instanceof Resource)) {
      return false;
    }
    Resource other = (Resource)obj;
    
    return new EqualsBuilder().append(layer, layer).append(path, path).isEquals();
  }
  
  public String toString()
  {
    return "Resource[" + getPath() + "](" + getLayer() + ")";
  }
  
  public FileHandler getFileHandler()
  {
    if (layer != null) {
      return layer.getFileHandler();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.Resource
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

public abstract interface ResourceChangeListener
{
  public abstract void resourceChanged(Resource... paramVarArgs);
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.ResourceChangeListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.HashSet;
import org.tizen.common.file.FileHandler;
import org.tizen.common.file.FileHandler.Attribute;

public class ResourceLayer
{
  protected final String name;
  protected ResourceLayer parent;
  protected final FileHandler fileHandler;
  protected final Collection<Resource> filter = new HashSet();
  
  public ResourceLayer(FileHandler fileHandler)
  {
    this("Unknown", null, fileHandler);
  }
  
  public ResourceLayer(String name, FileHandler fileHandler)
  {
    this(name, null, fileHandler);
  }
  
  public ResourceLayer(ResourceLayer parent, FileHandler fileHandler)
  {
    this(null, parent, fileHandler);
  }
  
  public ResourceLayer(String name, ResourceLayer parent, FileHandler fileHandler)
  {
    this.name = name;
    this.parent = parent;
    this.fileHandler = fileHandler;
  }
  
  public String getName()
  {
    return name;
  }
  
  public ResourceLayer getParent()
  {
    return parent;
  }
  
  public void setParent(ResourceLayer parent)
  {
    this.parent = parent;
  }
  
  public FileHandler getFileHandler()
  {
    return fileHandler;
  }
  
  public Resource getResource(String path)
    throws IOException
  {
    if (!((Boolean)fileHandler.get(path, FileHandler.Attribute.EXISTS)).booleanValue())
    {
      if (parent == null) {
        return null;
      }
      return parent.getResource(path);
    }
    Resource result = new Resource(this, path);
    if (isFilterResource(result)) {
      return null;
    }
    return result;
  }
  
  public Resource addResource(String path, byte[] contents)
    throws IOException
  {
    Resource ret = new Resource(this, path);
    ret.setContents(contents);
    
    return ret;
  }
  
  public Resource addResource(String path, InputStream in)
    throws IOException
  {
    Resource ret = new Resource(this, path);
    ret.setContents(in);
    return ret;
  }
  
  public void removeResource(String path)
    throws IOException
  {
    fileHandler.removeFile(path);
  }
  
  public void addFilterResource(Resource res)
  {
    filter.add(res);
  }
  
  public Resource[] getFilterResources()
  {
    return (Resource[])filter.toArray(new Resource[0]);
  }
  
  public boolean isFilterResource(Resource res)
  {
    return filter.contains(res);
  }
  
  public void removeFilterResource(Resource res)
  {
    filter.remove(res);
  }
  
  public String toString()
  {
    return "Layer[" + name + "]";
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.ResourceLayer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder.core;

import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.FactoryWithArgument;
import org.tizen.common.builder.Builder;
import org.tizen.common.builder.Resource;
import org.tizen.common.builder.ResourceLayer;
import org.tizen.common.file.FileHandler;
import org.tizen.common.file.FileHandler.Attribute;
import org.tizen.common.file.Filter;
import org.tizen.common.file.SimpleFileFilter;
import org.tizen.common.file.filter.WildCardFilterFactory;

public abstract class AbstractBuilder
  implements Builder
{
  protected final Logger logger = LoggerFactory.getLogger(AbstractBuilder.class);
  protected ResourceLayer layer;
  protected boolean bEnabled;
  protected SimpleFileFilter filter = new SimpleFileFilter(true);
  private FactoryWithArgument<Filter, String> filterFactory = new WildCardFilterFactory();
  
  protected AbstractBuilder()
  {
    this(null);
  }
  
  protected AbstractBuilder(ResourceLayer layer)
  {
    bEnabled = true;
    setResourceLayer(layer);
  }
  
  public boolean canBuild(Resource resource)
  {
    if (resource == null) {
      return false;
    }
    FileHandler fh = resource.getFileHandler();
    String path = resource.getPath();
    try
    {
      if (!fh.is(path, FileHandler.Attribute.EXISTS)) {
        return false;
      }
    }
    catch (IOException localIOException)
    {
      return false;
    }
    if (!filter.accept(null, path))
    {
      logger.debug("Ignore {}", path);
      return false;
    }
    return true;
  }
  
  public ResourceLayer getResourceLayer()
  {
    return layer;
  }
  
  public void setResourceLayer(ResourceLayer layer)
  {
    this.layer = layer;
  }
  
  public boolean isEnabled()
  {
    return bEnabled;
  }
  
  public void setEnabled(boolean enabled)
  {
    bEnabled = enabled;
  }
  
  public void setExcludes(String[] excludes)
  {
    filter.clearExcludes();
    if (excludes != null)
    {
      String[] arrayOfString;
      int j = (arrayOfString = excludes).length;
      for (int i = 0; i < j; i++)
      {
        String exclude = arrayOfString[i];
        filter.addExcludes(new Filter[] { (Filter)filterFactory.create(exclude) });
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.core.AbstractBuilder
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder.core;

import java.io.IOException;
import org.tizen.common.builder.Resource;
import org.tizen.common.builder.ResourceLayer;
import org.tizen.common.file.FileHandler;
import org.tizen.common.file.FileHandler.Attribute;

public class CopyBuilder
  extends AbstractBuilder
{
  private String output = ".";
  public static final String RESOURCE_LAYER_NAME = "copy layer";
  
  public CopyBuilder(String outputPath, ResourceLayer layer)
  {
    super(layer);
    if (outputPath != null) {
      output = outputPath;
    }
  }
  
  public boolean canBuild(Resource resource)
  {
    if (resource == null) {
      return false;
    }
    try
    {
      return resource.getFileHandler().is(resource.getPath(), FileHandler.Attribute.EXISTS);
    }
    catch (IOException localIOException) {}
    return false;
  }
  
  /* Error */
  public org.tizen.common.builder.BuildResult build(Resource resource)
    throws org.tizen.common.builder.exception.BuildException
  {
    // Byte code:
    //   0: new 66	org/tizen/common/builder/BuildResult
    //   3: dup
    //   4: invokespecial 68	org/tizen/common/builder/BuildResult:<init>	()V
    //   7: astore_2
    //   8: aconst_null
    //   9: astore_3
    //   10: aload_1
    //   11: invokevirtual 71	org/tizen/common/builder/Resource:getContents	()Ljava/io/InputStream;
    //   14: astore_3
    //   15: aload_0
    //   16: getfield 19	org/tizen/common/builder/core/CopyBuilder:output	Ljava/lang/String;
    //   19: getstatic 75	java/io/File:separator	Ljava/lang/String;
    //   22: invokevirtual 80	java/lang/String:endsWith	(Ljava/lang/String;)Z
    //   25: ifne +31 -> 56
    //   28: aload_0
    //   29: dup
    //   30: getfield 19	org/tizen/common/builder/core/CopyBuilder:output	Ljava/lang/String;
    //   33: new 84	java/lang/StringBuilder
    //   36: dup_x1
    //   37: swap
    //   38: invokestatic 86	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   41: invokespecial 90	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   44: getstatic 75	java/io/File:separator	Ljava/lang/String;
    //   47: invokevirtual 93	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   50: invokevirtual 97	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   53: putfield 19	org/tizen/common/builder/core/CopyBuilder:output	Ljava/lang/String;
    //   56: aload_0
    //   57: invokevirtual 100	org/tizen/common/builder/core/CopyBuilder:getResourceLayer	()Lorg/tizen/common/builder/ResourceLayer;
    //   60: new 84	java/lang/StringBuilder
    //   63: dup
    //   64: aload_0
    //   65: getfield 19	org/tizen/common/builder/core/CopyBuilder:output	Ljava/lang/String;
    //   68: invokestatic 86	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   71: invokespecial 90	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   74: aload_1
    //   75: invokevirtual 41	org/tizen/common/builder/Resource:getPath	()Ljava/lang/String;
    //   78: invokevirtual 93	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   81: invokevirtual 97	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   84: aload_3
    //   85: invokevirtual 104	org/tizen/common/builder/ResourceLayer:addResource	(Ljava/lang/String;Ljava/io/InputStream;)Lorg/tizen/common/builder/Resource;
    //   88: astore 4
    //   90: aload_2
    //   91: aload_1
    //   92: aload 4
    //   94: invokevirtual 108	org/tizen/common/builder/BuildResult:addDependency	(Lorg/tizen/common/builder/Resource;Lorg/tizen/common/builder/Resource;)V
    //   97: goto +31 -> 128
    //   100: astore 4
    //   102: new 64	org/tizen/common/builder/exception/BuildException
    //   105: dup
    //   106: aload 4
    //   108: invokespecial 112	org/tizen/common/builder/exception/BuildException:<init>	(Ljava/lang/Throwable;)V
    //   111: athrow
    //   112: astore 5
    //   114: iconst_1
    //   115: anewarray 115	java/lang/Object
    //   118: dup
    //   119: iconst_0
    //   120: aload_3
    //   121: aastore
    //   122: invokestatic 117	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   125: aload 5
    //   127: athrow
    //   128: iconst_1
    //   129: anewarray 115	java/lang/Object
    //   132: dup
    //   133: iconst_0
    //   134: aload_3
    //   135: aastore
    //   136: invokestatic 117	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   139: aload_2
    //   140: areturn
    // Line number table:
    //   Java source line #82	-> byte code offset #0
    //   Java source line #84	-> byte code offset #8
    //   Java source line #86	-> byte code offset #10
    //   Java source line #88	-> byte code offset #15
    //   Java source line #89	-> byte code offset #28
    //   Java source line #92	-> byte code offset #56
    //   Java source line #93	-> byte code offset #90
    //   Java source line #94	-> byte code offset #100
    //   Java source line #95	-> byte code offset #102
    //   Java source line #96	-> byte code offset #112
    //   Java source line #97	-> byte code offset #120
    //   Java source line #98	-> byte code offset #125
    //   Java source line #96	-> byte code offset #128
    //   Java source line #97	-> byte code offset #134
    //   Java source line #100	-> byte code offset #139
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	141	0	this	CopyBuilder
    //   0	141	1	resource	Resource
    //   7	133	2	result	org.tizen.common.builder.BuildResult
    //   9	126	3	contents	java.io.InputStream
    //   88	5	4	out	Resource
    //   100	7	4	e	IOException
    //   112	14	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   10	97	100	java/io/IOException
    //   10	112	112	finally
  }
  
  public void setOutput(String path)
  {
    output = path;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.core.CopyBuilder
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder.core;

import org.tizen.common.builder.Resource;
import org.tizen.common.verrari.IModelProvider;
import org.tizen.common.verrari.ITemplateEngine;
import org.tizen.common.verrari.ITemplateProvider;

public abstract class TemplateEngineBuilder
  extends AbstractBuilder
{
  protected ITemplateEngine templateEngine;
  
  public TemplateEngineBuilder(ITemplateEngine engine, ITemplateProvider templateProvider)
  {
    this(engine);
    templateEngine.setTemplateProvider(templateProvider);
  }
  
  public TemplateEngineBuilder(ITemplateEngine engine)
  {
    templateEngine = engine;
  }
  
  /* Error */
  public org.tizen.common.builder.BuildResult build(Resource resource)
    throws org.tizen.common.builder.exception.BuildException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_2
    //   2: new 36	java/io/ByteArrayOutputStream
    //   5: dup
    //   6: invokespecial 38	java/io/ByteArrayOutputStream:<init>	()V
    //   9: astore_2
    //   10: aload_0
    //   11: aload_1
    //   12: invokevirtual 39	org/tizen/common/builder/core/TemplateEngineBuilder:getTemplateKey	(Lorg/tizen/common/builder/Resource;)Ljava/lang/String;
    //   15: astore_3
    //   16: aload_0
    //   17: getfield 13	org/tizen/common/builder/core/TemplateEngineBuilder:templateEngine	Lorg/tizen/common/verrari/ITemplateEngine;
    //   20: aload_3
    //   21: aload_0
    //   22: invokevirtual 43	org/tizen/common/builder/core/TemplateEngineBuilder:getModelProvider	()Lorg/tizen/common/verrari/IModelProvider;
    //   25: aload_2
    //   26: invokeinterface 47 4 0
    //   31: aload_0
    //   32: getfield 51	org/tizen/common/builder/core/TemplateEngineBuilder:layer	Lorg/tizen/common/builder/ResourceLayer;
    //   35: aload_1
    //   36: invokevirtual 55	org/tizen/common/builder/Resource:getPath	()Ljava/lang/String;
    //   39: aload_2
    //   40: invokevirtual 61	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   43: invokevirtual 65	org/tizen/common/builder/ResourceLayer:addResource	(Ljava/lang/String;[B)Lorg/tizen/common/builder/Resource;
    //   46: astore 4
    //   48: new 71	org/tizen/common/builder/BuildResult
    //   51: dup
    //   52: invokespecial 73	org/tizen/common/builder/BuildResult:<init>	()V
    //   55: astore 5
    //   57: aload 5
    //   59: aload_1
    //   60: aload 4
    //   62: invokevirtual 74	org/tizen/common/builder/BuildResult:addDependency	(Lorg/tizen/common/builder/Resource;Lorg/tizen/common/builder/Resource;)V
    //   65: aload 5
    //   67: astore 7
    //   69: iconst_1
    //   70: anewarray 78	java/lang/Object
    //   73: dup
    //   74: iconst_0
    //   75: aload_2
    //   76: aastore
    //   77: invokestatic 80	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   80: aload 7
    //   82: areturn
    //   83: astore_3
    //   84: new 34	org/tizen/common/builder/exception/BuildException
    //   87: dup
    //   88: aload_3
    //   89: invokespecial 86	org/tizen/common/builder/exception/BuildException:<init>	(Ljava/lang/Throwable;)V
    //   92: athrow
    //   93: astore 6
    //   95: iconst_1
    //   96: anewarray 78	java/lang/Object
    //   99: dup
    //   100: iconst_0
    //   101: aload_2
    //   102: aastore
    //   103: invokestatic 80	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   106: aload 6
    //   108: athrow
    // Line number table:
    //   Java source line #76	-> byte code offset #0
    //   Java source line #78	-> byte code offset #2
    //   Java source line #79	-> byte code offset #10
    //   Java source line #80	-> byte code offset #16
    //   Java source line #81	-> byte code offset #31
    //   Java source line #82	-> byte code offset #48
    //   Java source line #83	-> byte code offset #57
    //   Java source line #84	-> byte code offset #65
    //   Java source line #87	-> byte code offset #69
    //   Java source line #88	-> byte code offset #75
    //   Java source line #84	-> byte code offset #80
    //   Java source line #85	-> byte code offset #83
    //   Java source line #86	-> byte code offset #84
    //   Java source line #87	-> byte code offset #93
    //   Java source line #88	-> byte code offset #101
    //   Java source line #89	-> byte code offset #106
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	109	0	this	TemplateEngineBuilder
    //   0	109	1	resource	Resource
    //   1	101	2	baos	java.io.ByteArrayOutputStream
    //   15	6	3	templateKey	String
    //   83	6	3	e	Exception
    //   46	15	4	out	Resource
    //   55	11	5	ret	org.tizen.common.builder.BuildResult
    //   93	14	6	localObject	Object
    //   67	14	7	localBuildResult1	org.tizen.common.builder.BuildResult
    // Exception table:
    //   from	to	target	type
    //   2	69	83	java/lang/Exception
    //   2	69	93	finally
    //   83	93	93	finally
  }
  
  protected abstract String getTemplateKey(Resource paramResource);
  
  protected abstract IModelProvider getModelProvider();
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.core.TemplateEngineBuilder
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder.dependency;

import java.util.Set;
import org.tizen.common.builder.BuildDependency;
import org.tizen.common.builder.Dependency;
import org.tizen.common.builder.Resource;

public class DependencyInFile
  implements BuildDependency
{
  public void addVertex(Resource resource) {}
  
  public boolean containsVertex(Resource resource)
  {
    return false;
  }
  
  public void removeVertex(Resource resource) {}
  
  public void addEdge(Resource in, Resource out, Dependency dependency) {}
  
  public void removeEdge(Dependency dependency) {}
  
  public Set<Dependency> edgesOf(Resource resource)
  {
    return null;
  }
  
  public Resource getEdgeSource(Dependency dependency)
  {
    return null;
  }
  
  public Resource getEdgeTarget(Dependency dependency)
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.dependency.DependencyInFile
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder.dependency;

import java.util.Set;
import org.jgrapht.DirectedGraph;
import org.jgrapht.graph.DefaultDirectedGraph;
import org.tizen.common.builder.BuildDependency;
import org.tizen.common.builder.Dependency;
import org.tizen.common.builder.Resource;

public class DependencyInMemory
  implements BuildDependency
{
  protected final DirectedGraph<Resource, Dependency> dependencies = new DefaultDirectedGraph(Dependency.class);
  
  public void addVertex(Resource resource)
  {
    dependencies.addVertex(resource);
  }
  
  public boolean containsVertex(Resource resource)
  {
    return dependencies.containsVertex(resource);
  }
  
  public void removeVertex(Resource resource)
  {
    dependencies.removeVertex(resource);
  }
  
  public void addEdge(Resource in, Resource out, Dependency dependency)
  {
    dependencies.addEdge(in, out, dependency);
  }
  
  public void removeEdge(Dependency dependency)
  {
    dependencies.removeEdge(dependency);
  }
  
  public Set<Dependency> edgesOf(Resource resource)
  {
    return dependencies.edgesOf(resource);
  }
  
  public Resource getEdgeSource(Dependency dependency)
  {
    return (Resource)dependencies.getEdgeSource(dependency);
  }
  
  public Resource getEdgeTarget(Dependency dependency)
  {
    return (Resource)dependencies.getEdgeTarget(dependency);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.dependency.DependencyInMemory
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.builder.exception;

public class BuildException
  extends Exception
{
  private static final long serialVersionUID = -1375835405078898617L;
  
  public BuildException(Throwable th)
  {
    super(th);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.builder.exception.BuildException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd