All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.etlunit.maven.util.JavaSource Maven / Gradle / Ivy

There is a newer version: 1.6.9
Show newest version
package org.etlunit.maven.util;

import java.util.ArrayList;
import java.util.List;

public class JavaSource {
	private final String packag;
	private final String className;
	private final List properties = new ArrayList();

	public JavaSource(String packag, String className) {
		this.packag = packag;
		this.className = className;
	}

	public void addProperty(JavaProperty property)
	{
		properties.add(property);
	}

	public String toSource()
	{
		StringBuffer buffer = new StringBuffer();

		buffer.append("package ").append(packag).append(";\n\n");
		buffer.append("import java.util.List;\n");
		buffer.append("import java.util.ArrayList;\n");
		buffer.append("import java.util.Map;\n");
		buffer.append("import java.util.HashMap;\n\n");
		buffer.append("public class ").append(className).append("\n");
		buffer.append("{\n");

		for (JavaProperty property : properties)
		{
			property.append(buffer);
		}

		buffer.append("}\n");

		return buffer.toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy