Specify generic arguments
This commit is contained in:
		@@ -67,7 +67,7 @@ public class CalabashHelper {
 | 
			
		||||
        final InputStream paramsStream = new ByteArrayInputStream(params.getBytes());
 | 
			
		||||
        
 | 
			
		||||
        //System.out.println("~!~!~!~!~!~!~!~!~!Sending: \n"+params+"\n");
 | 
			
		||||
        List<PipelineInput> pipelineInputs = new ArrayList<PipelineInput>() {{
 | 
			
		||||
        List<PipelineInput<?>> pipelineInputs = new ArrayList<PipelineInput<?>>() {{
 | 
			
		||||
            add(PipelineInput.port("source", inputSource));
 | 
			
		||||
            add(PipelineInput.port("parameters", new InputSource(paramsStream)));
 | 
			
		||||
        }};
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
package com.rackspace.cloud.api.docs;
 | 
			
		||||
 | 
			
		||||
import com.agilejava.docbkx.maven.Entity;
 | 
			
		||||
import com.agilejava.docbkx.maven.Parameter;
 | 
			
		||||
import javax.xml.transform.*;
 | 
			
		||||
import javax.xml.transform.stream.StreamResult;
 | 
			
		||||
import javax.xml.transform.stream.StreamSource;
 | 
			
		||||
@@ -14,6 +16,7 @@ import java.io.FileOutputStream;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Properties;
 | 
			
		||||
import org.apache.maven.artifact.Artifact;
 | 
			
		||||
import org.apache.maven.project.MavenProject;
 | 
			
		||||
import org.apache.tools.ant.Target;
 | 
			
		||||
import org.xml.sax.XMLReader;
 | 
			
		||||
@@ -55,7 +58,7 @@ public abstract class EpubMojo
 | 
			
		||||
     * @required
 | 
			
		||||
     * @readonly
 | 
			
		||||
     */
 | 
			
		||||
    List artifacts;
 | 
			
		||||
    List<Artifact> artifacts;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Ant tasks to be executed before the transformation. Comparable
 | 
			
		||||
@@ -88,7 +91,7 @@ public abstract class EpubMojo
 | 
			
		||||
     *
 | 
			
		||||
     * @parameter
 | 
			
		||||
     */
 | 
			
		||||
    private List entities;
 | 
			
		||||
    private List<Entity> entities;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * A list of additional XSL parameters to give to the XSLT engine.
 | 
			
		||||
@@ -101,7 +104,7 @@ public abstract class EpubMojo
 | 
			
		||||
     *
 | 
			
		||||
     * @parameter
 | 
			
		||||
     */
 | 
			
		||||
    private List customizationParameters;
 | 
			
		||||
    private List<Parameter> customizationParameters;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * List of additional System properties.
 | 
			
		||||
@@ -4289,11 +4292,11 @@ public abstract class EpubMojo
 | 
			
		||||
        return results;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List getEntities() {
 | 
			
		||||
    public List<Entity> getEntities() {
 | 
			
		||||
        return entities;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List getCustomizationParameters()
 | 
			
		||||
    public List<Parameter> getCustomizationParameters()
 | 
			
		||||
    {
 | 
			
		||||
    	return customizationParameters;
 | 
			
		||||
    }
 | 
			
		||||
@@ -4315,7 +4318,7 @@ public abstract class EpubMojo
 | 
			
		||||
        return project;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List getArtifacts() {
 | 
			
		||||
    public List<Artifact> getArtifacts() {
 | 
			
		||||
        return artifacts;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -111,7 +111,7 @@ public class FileUtils {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void extractJaredDirectory (String directory, Class jarSrc,
 | 
			
		||||
    public static void extractJaredDirectory (String directory, Class<?> jarSrc,
 | 
			
		||||
                                              File dest)
 | 
			
		||||
        throws MojoExecutionException {
 | 
			
		||||
        try {
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ public abstract class HTMLMojo extends AbstractHtmlMojo {
 | 
			
		||||
        String pathToPipelineFile = "classpath:///wadl2html.xpl"; //use "classpath:///path" for this to work
 | 
			
		||||
        Source source = super.createSource(inputFilename, sourceFile, filter);
 | 
			
		||||
 | 
			
		||||
        Map map=new HashMap<String, String>();
 | 
			
		||||
        Map<String, Object> map=new HashMap<String, Object>();
 | 
			
		||||
        
 | 
			
		||||
        map.put("security", security);
 | 
			
		||||
        map.put("canonicalUrlBase", canonicalUrlBase);
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,7 @@ import org.xml.sax.SAXException;
 | 
			
		||||
import org.xml.sax.XMLReader;
 | 
			
		||||
 | 
			
		||||
import com.agilejava.docbkx.maven.CachingTransformerBuilder;
 | 
			
		||||
import com.agilejava.docbkx.maven.Entity;
 | 
			
		||||
import com.agilejava.docbkx.maven.ExpressionHandler;
 | 
			
		||||
import com.agilejava.docbkx.maven.InjectingEntityResolver;
 | 
			
		||||
import com.agilejava.docbkx.maven.NullWriter;
 | 
			
		||||
@@ -134,8 +135,8 @@ public class PDFBuilder {
 | 
			
		||||
	 * @parameter
 | 
			
		||||
	 */
 | 
			
		||||
	private String foCustomization;
 | 
			
		||||
	private List customizationParameters = new ArrayList();
 | 
			
		||||
	private List entities;
 | 
			
		||||
	private List<Parameter> customizationParameters = new ArrayList<Parameter>();
 | 
			
		||||
	private List<Entity> entities;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	private Log log = null;
 | 
			
		||||
@@ -776,10 +777,10 @@ public class PDFBuilder {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	public List getEntities() {
 | 
			
		||||
	public List<Entity> getEntities() {
 | 
			
		||||
		return entities;
 | 
			
		||||
	}
 | 
			
		||||
	public void setEntities(List entities) {
 | 
			
		||||
	public void setEntities(List<Entity> entities) {
 | 
			
		||||
		this.entities = entities;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -846,14 +847,14 @@ public class PDFBuilder {
 | 
			
		||||
			final String catalog = catalogs[i];
 | 
			
		||||
 | 
			
		||||
			try {
 | 
			
		||||
				Enumeration enumeration = classLoader.getResources(catalog);
 | 
			
		||||
				Enumeration<URL> enumeration = classLoader.getResources(catalog);
 | 
			
		||||
				while (enumeration.hasMoreElements()) {
 | 
			
		||||
					if (!first) {
 | 
			
		||||
						builder.append(';');
 | 
			
		||||
					} else {
 | 
			
		||||
						first = false;
 | 
			
		||||
					}
 | 
			
		||||
					URL resource = (URL) enumeration.nextElement();
 | 
			
		||||
					URL resource = enumeration.nextElement();
 | 
			
		||||
					builder.append(resource.toExternalForm());
 | 
			
		||||
				}
 | 
			
		||||
			} catch (IOException ioe) {
 | 
			
		||||
@@ -968,9 +969,9 @@ public class PDFBuilder {
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if (getCustomizationParameters() != null) {
 | 
			
		||||
					final Iterator iterator = getCustomizationParameters().iterator();
 | 
			
		||||
					final Iterator<Parameter> iterator = getCustomizationParameters().iterator();
 | 
			
		||||
					while (iterator.hasNext()) {
 | 
			
		||||
						Parameter param = (Parameter) iterator.next();
 | 
			
		||||
						Parameter param = iterator.next();
 | 
			
		||||
						if (param.getName() != null) // who knows
 | 
			
		||||
						{
 | 
			
		||||
							transformer.setParameter(param.getName(), param.getValue());
 | 
			
		||||
@@ -1024,7 +1025,7 @@ public class PDFBuilder {
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public List getCustomizationParameters()
 | 
			
		||||
	public List<Parameter> getCustomizationParameters()
 | 
			
		||||
	{
 | 
			
		||||
		return customizationParameters;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,12 +22,12 @@ public abstract class AbstractPipeline implements Pipeline {
 | 
			
		||||
   
 | 
			
		||||
   protected abstract <T>void addOption(PipelineInput<T> input);
 | 
			
		||||
   
 | 
			
		||||
   protected void handleInputs(PipelineInput... inputs) {
 | 
			
		||||
   protected void handleInputs(PipelineInput<?>... inputs) {
 | 
			
		||||
      handleInputs(Arrays.asList(inputs));
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   protected void handleInputs(List<PipelineInput> inputs) {
 | 
			
		||||
      for (PipelineInput input: inputs) {
 | 
			
		||||
   protected void handleInputs(List<PipelineInput<?>> inputs) {
 | 
			
		||||
      for (PipelineInput<?> input: inputs) {
 | 
			
		||||
         switch (input.getType()) {
 | 
			
		||||
            case PORT:
 | 
			
		||||
               addPort(input);
 | 
			
		||||
@@ -64,13 +64,13 @@ public abstract class AbstractPipeline implements Pipeline {
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   protected void clearParameters(PipelineInput... inputs) {
 | 
			
		||||
   protected void clearParameters(PipelineInput<?>... inputs) {
 | 
			
		||||
      clearParameters(Arrays.asList(inputs));
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   protected void clearParameters(List<PipelineInput> inputs) {
 | 
			
		||||
   protected void clearParameters(List<PipelineInput<?>> inputs) {
 | 
			
		||||
      
 | 
			
		||||
      for (PipelineInput input: inputs) {
 | 
			
		||||
      for (PipelineInput<?> input: inputs) {
 | 
			
		||||
         switch (input.getType()) {
 | 
			
		||||
            case PARAMETER:
 | 
			
		||||
               clearParameter(input);
 | 
			
		||||
@@ -82,7 +82,7 @@ public abstract class AbstractPipeline implements Pipeline {
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   @Override
 | 
			
		||||
   public void run(PipelineInput... inputs) {
 | 
			
		||||
   public void run(PipelineInput<?>... inputs) {
 | 
			
		||||
      run(Arrays.asList(inputs));
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ public class CalabashPipeline extends AbstractPipeline implements Pipeline {
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   @Override
 | 
			
		||||
   protected void addOption(PipelineInput input) {
 | 
			
		||||
   protected <T> void addOption(PipelineInput<T> input) {
 | 
			
		||||
      pipeline.setOption(new QName(input.getName()), getRuntimeValue(input));
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
@@ -89,7 +89,7 @@ public class CalabashPipeline extends AbstractPipeline implements Pipeline {
 | 
			
		||||
      
 | 
			
		||||
   
 | 
			
		||||
   @Override
 | 
			
		||||
   public void run(List<PipelineInput> inputs) {
 | 
			
		||||
   public void run(List<PipelineInput<?>> inputs) {
 | 
			
		||||
      try {
 | 
			
		||||
         reset();
 | 
			
		||||
         handleInputs(inputs);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,9 +7,9 @@ public interface Pipeline {
 | 
			
		||||
 | 
			
		||||
   List<Source> getResultPort(String name);
 | 
			
		||||
 | 
			
		||||
   void run(List<PipelineInput> inputs) throws PipelineException;
 | 
			
		||||
   void run(List<PipelineInput<?>> inputs) throws PipelineException;
 | 
			
		||||
 | 
			
		||||
   void run(PipelineInput... inputs);
 | 
			
		||||
   void run(PipelineInput<?>... inputs);
 | 
			
		||||
 | 
			
		||||
   void reset();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,15 +5,15 @@ public class PipelineInput<T> {
 | 
			
		||||
   private final PipelineInputType type;
 | 
			
		||||
   private final T source;
 | 
			
		||||
   
 | 
			
		||||
   public static <P> PipelineInput parameter(String name, P source) {
 | 
			
		||||
   public static <P> PipelineInput<P> parameter(String name, P source) {
 | 
			
		||||
      return new PipelineInput<P>(name, PipelineInputType.PARAMETER, source);
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   public static <P> PipelineInput port(String name, P source) {
 | 
			
		||||
   public static <P> PipelineInput<P> port(String name, P source) {
 | 
			
		||||
      return new PipelineInput<P>(name, PipelineInputType.PORT, source);
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   public static <P> PipelineInput option(String name, P source) {
 | 
			
		||||
   public static <P> PipelineInput<P> option(String name, P source) {
 | 
			
		||||
      return new PipelineInput<P>(name, PipelineInputType.OPTION, source);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user