001: package de.java2html.plugin.jspwiki;
002:
003: import java.util.HashSet;
004: import java.util.Set;
005:
006: import de.java2html.options.ConversionOptionsUtilities;
007: import de.java2html.plugin.IParameter;
008:
009: /**
010: * @author Markus Gebhard
011: */
012: public final class PluginParameter implements IParameter {
013: private final static Set all = new HashSet();
014: private final static Set allNames = new HashSet();
015:
016: public final static PluginParameter _BODY = new PluginParameter(
017: "_body", "-", "-");
018: public final static PluginParameter STYLE = new PluginParameter(
019: "style", "supported styles are: "
020: + ConversionOptionsUtilities
021: .getPredefinedStyleTableNameString(),
022: "monochrome");
023: public final static PluginParameter ATTACHMENT = new PluginParameter(
024: "attachment",
025: "If specified, the source code from the attached Java file will be used.",
026: "HelloWorld.java");
027: public final static PluginParameter SOURCE = new PluginParameter(
028: "source",
029: "If specified, the source code contained in this parameter value will be used (only valid for one line of code).",
030: "public final static main(String[] args);");
031: public final static PluginParameter URL = new PluginParameter(
032: "url",
033: "If specified, the source code from the Java file given by the url will be used (only available if this option is enabled in the wiki properties).",
034: "http://www.java2html.de/HelloWorld.java");
035: public static final IParameter CONVERTER = new PluginParameter(
036: "converter",
037: "Name of the converter to use. Default is <code>html</code>.",
038: "xhtml");
039: public final static PluginParameter ALIGNMENT = new PluginParameter(
040: "alignment",
041: "Specifies the horizontal alignment of the output. Supported values are: "
042: + ConversionOptionsUtilities
043: .getAvailableHorizontalAlignmentNameString()
044: + " default is <code>left</code>.", "center");
045: public final static PluginParameter PRINT_VERSION = new PluginParameter(
046: "printVersion",
047: "If specified, the plugin only prints its name an version.",
048: "true");
049: public final static PluginParameter BORDER = new PluginParameter(
050: "border",
051: "boolean flag for rendering a table border around the converted result. Default is <code>false<code>",
052: "true");
053: public final static PluginParameter LINE_NUMBERS = new PluginParameter(
054: "lineNumbers",
055: "boolean flag for rendering line numbers. Default is <code>false</false>",
056: "true");
057: public final static PluginParameter TAB_SIZE = new PluginParameter(
058: "tabSize",
059: "Number of spaces representing a tab character. Default is <code>2</code>.",
060: "4");
061:
062: private String name;
063: private String description;
064: private String exampleValue;
065:
066: public PluginParameter(String name, String description,
067: String exampleValue) {
068: this .exampleValue = exampleValue;
069: this .name = name;
070: this .description = description;
071: all.add(this );
072: allNames.add(name);
073: }
074:
075: public String getName() {
076: return name;
077: }
078:
079: public static Set getAll() {
080: return all;
081: }
082:
083: public boolean isInternal() {
084: return isInternal(getName());
085: }
086:
087: public static boolean isInternal(String parameterName) {
088: return parameterName.startsWith("_");
089: }
090:
091: public String getDescription() {
092: return description;
093: }
094:
095: public String getExampleValue() {
096: return exampleValue;
097: }
098:
099: public static Set getAllNames() {
100: return allNames;
101: }
102: }
|