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

net.anotheria.asg.generator.GeneratedJSONFile Maven / Gradle / Ivy

There is a newer version: 4.3.0
Show newest version
package net.anotheria.asg.generator;

/**
 * Represents a generated XML file.
 *
 * @author lrosenberg
 * @version $Id: $Id
 */
public class GeneratedJSONFile extends GeneratedArtefact{

	/**
	 * Body of the artefact.
	 */
	private StringBuilder body;
	/**
	 * Path to the generated file.
	 */
	private String path;

	/**
	 * Creates a new artefact.
	 */
	public GeneratedJSONFile(){
		body = new StringBuilder();
	}

	/**
	 * Creates a new artefact.
	 *
	 * @param aName a {@link String} object.
	 */
	public GeneratedJSONFile(String aName){
		this();
		setName(aName);
	}
	
	/** {@inheritDoc} */
	@Override
	public String createFileContent() {
		StringBuilder ret = new StringBuilder(body.length());
		ret.append(getBody());
		return ret.toString();
	}

	/** {@inheritDoc} */
	@Override
	public String getFileType() {
		return ".json";
	}

	/** {@inheritDoc} */
	@Override
	public String getPath() {
		return path;
	}

	/**
	 * 

Setter for the field path.

* * @param path a {@link String} object. */ public void setPath(String path) { this.path = path; } /** *

Getter for the field body.

* * @return a {@link StringBuilder} object. */ public StringBuilder getBody() { return body; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy