ingo@209: package de.intevation.artifactdatabase.state;
ingo@209:
ingo@251: import java.util.ArrayList;
ingo@226: import java.util.List;
ingo@226:
ingo@209: /**
ingo@209: * The default implementation of an Output.
ingo@209: *
ingo@209: * @author Ingo Weinzierl
ingo@209: */
ingo@209: public class DefaultOutput implements Output {
ingo@209:
ingo@209: protected String name;
ingo@209:
ingo@209: protected String description;
ingo@209:
ingo@209: protected String mimeType;
ingo@209:
ingo@290: protected String type;
ingo@290:
ingo@226: protected List facets;
ingo@226:
ingo@358: protected Settings settings;
ingo@358:
ingo@209:
ingo@209: /**
ingo@209: * The default constructor that instantiates a new DefaultOutput object.
ingo@209: *
ingo@209: * @param name The name of this output.
ingo@209: * @param description The description of this output.
ingo@209: * @param mimeType The mimetype of this output.
ingo@209: */
ingo@209: public DefaultOutput(String name, String description, String mimeType) {
ingo@209: this.name = name;
ingo@209: this.description = description;
ingo@209: this.mimeType = mimeType;
ingo@290: this.type = "";
ingo@251: this.facets = new ArrayList();
ingo@209: }
ingo@209:
ingo@209:
ingo@290: public DefaultOutput(
ingo@290: String name,
ingo@290: String description,
ingo@290: String mimeType,
ingo@290: String type)
ingo@290: {
ingo@290: this(name, description, mimeType);
ingo@290:
ingo@290: this.facets = new ArrayList();
ingo@290: this.type = type;
ingo@290: }
ingo@290:
ingo@290:
ingo@290: public DefaultOutput(
ingo@290: String name,
ingo@290: String description,
ingo@290: String mimeType,
ingo@290: List facets)
ingo@290: {
ingo@290: this(name, description, mimeType);
ingo@290:
ingo@290: this.type = "";
ingo@290: this.facets = facets;
ingo@290: }
ingo@290:
ingo@290:
ingo@209: /**
ingo@226: * This constructor builds a new Output object that contains facets as well.
ingo@226: *
ingo@226: * @param name The name of this output.
ingo@226: * @param description The description of this output.
ingo@226: * @param mimeType The mimetype of this output.
ingo@226: * @param facets The list of facets supported by this output.
ingo@226: */
ingo@226: public DefaultOutput(
ingo@226: String name,
ingo@226: String description,
ingo@226: String mimeType,
ingo@290: List facets,
ingo@290: String type)
ingo@226: {
ingo@290: this(name, description, mimeType, facets);
ingo@226:
ingo@290: this.type = type;
ingo@226: }
ingo@226:
ingo@226:
ingo@226: /**
ingo@209: * Returns the name of this output.
ingo@209: *
ingo@209: * @return the name of this output.
ingo@209: */
ingo@209: public String getName() {
ingo@209: return name;
ingo@209: }
ingo@209:
ingo@209:
ingo@209: /**
ingo@209: * Returns the description of this output.
ingo@209: *
ingo@209: * @return the description of this output.
ingo@209: */
ingo@209: public String getDescription() {
ingo@209: return description;
ingo@209: }
ingo@209:
ingo@209:
ingo@209: /**
ingo@209: * Returns the mimetype of this output.
ingo@209: *
ingo@209: * @return the mimetype of this output.
ingo@209: */
ingo@209: public String getMimeType() {
ingo@209: return mimeType;
ingo@209: }
ingo@226:
ingo@226:
ingo@290: public String getType() {
ingo@290: return type;
ingo@290: }
ingo@290:
ingo@290:
ingo@226: /**
ingo@226: * Returns the list of facets supported by this output.
ingo@226: *
ingo@226: * @return the list of facets supported by this output.
ingo@226: */
ingo@226: public List getFacets() {
ingo@226: return facets;
ingo@226: }
ingo@251:
ingo@251:
ingo@251: public void addFacet(Facet facet) {
ingo@251: facets.add(facet);
ingo@251: }
ingo@296:
ingo@296:
ingo@296: public void addFacets(List facets) {
ingo@296: this.facets.addAll(facets);
ingo@296: }
ingo@358:
ingo@358:
ingo@358: @Override
ingo@358: public void setSettings(Settings settings) {
ingo@358: this.settings = settings;
ingo@358: }
ingo@358:
ingo@358:
ingo@358: @Override
ingo@358: public Settings getSettings() {
ingo@358: return settings;
ingo@358: }
ingo@209: }
ingo@209: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :