/* * Copyright 2006 Wilfred Springer * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.agilejava.maven.docbkx.spec; import java.util.ArrayList; import java.util.List; /** * A representation of the the DocBook-XSL specific version of a plugin. * * @author Wilfred Springer */ public class Specification { /** * The extension of the target file. */ private String targetFileExtension; /** * The location in which the stylesheets will be stored. */ private String stylesheetLocation; /** * The type of content to be generated. Affects the output directory name, * and the name of the plugin. */ private String type; /** * The suffix of the plugin: generate-.... */ private String pluginSuffix; /** * The name of the Mojo class implementing the required behaviour. */ private String className; /** * The name of the super class for this class. */ private String superClassName; /** * The package in which the generated class should reside. */ private String packageName; /** * The version of the DocBook XSL stylesheets. */ private String docbookXslVersion; /** * A list of all parameters. */ private List parameters; /** * False if the stylesheet is responsible to create the output file(s) using its own naming scheme. * */ private boolean useStandardOutput = true; /** * Constructs a new instance. * */ public Specification() { parameters = new ArrayList(); } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public String getDocbookXslVersion() { return docbookXslVersion; } public void setDocbookXslVersion(String docbookXslVersion) { this.docbookXslVersion = docbookXslVersion; } public String getPackageName() { return packageName; } public void setPackageName(String packageName) { this.packageName = packageName; } public void addParameter(String name, String description) { Parameter parameter = new Parameter(); parameter.setName(name); parameter.setDescription(description); parameters.add(parameter); } public List getParameters() { return parameters; } public void setParameters(List parameters) { this.parameters = parameters; } public String getStylesheetLocation() { return stylesheetLocation; } public void setStylesheetLocation(String stylesheetLocation) { this.stylesheetLocation = stylesheetLocation; } /** * Returns the extension of the files being generated by the plugin * generated from this specification, which will be based on the * {@link #type} variable if it is not explicitly overridden. * * @return The extension of the files being generated by the plugin * generated from this specification. */ public String getTargetFileExtension() { return targetFileExtension == null ? type : targetFileExtension; } public void setTargetFileExtension(String targetFileExtension) { this.targetFileExtension = targetFileExtension; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getSuperClassName() { return superClassName; } public void setSuperClassName(String superClassName) { this.superClassName = superClassName; } public String getPluginSuffix() { return pluginSuffix == null ? type : pluginSuffix; } public void setPluginSuffix(String pluginSuffix) { this.pluginSuffix = pluginSuffix; } public boolean isUseStandardOutput() { return useStandardOutput; } public void setUseStandardOutput(boolean useStandardOutput) { this.useStandardOutput = useStandardOutput; } }