KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > java2html > plugin > jspwiki > PluginParameter


1 package de.java2html.plugin.jspwiki;
2
3 import java.util.HashSet JavaDoc;
4 import java.util.Set JavaDoc;
5
6 import de.java2html.options.ConversionOptionsUtilities;
7 import de.java2html.plugin.IParameter;
8
9 /**
10  * @author Markus Gebhard
11  */

12 public final class PluginParameter implements IParameter {
13   private final static Set JavaDoc all = new HashSet JavaDoc();
14   private final static Set JavaDoc allNames = new HashSet JavaDoc();
15
16   public final static PluginParameter _BODY = new PluginParameter("_body", "-", "-");
17   public final static PluginParameter STYLE = new PluginParameter("style", "supported styles are: "
18       + ConversionOptionsUtilities.getPredefinedStyleTableNameString(), "monochrome");
19   public final static PluginParameter ATTACHMENT = new PluginParameter(
20       "attachment",
21       "If specified, the source code from the attached Java file will be used.",
22       "HelloWorld.java");
23   public final static PluginParameter SOURCE = new PluginParameter(
24       "source",
25       "If specified, the source code contained in this parameter value will be used (only valid for one line of code).",
26       "public final static main(String[] args);");
27   public final static PluginParameter URL = new PluginParameter(
28       "url",
29       "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).",
30       "http://www.java2html.de/HelloWorld.java");
31   public static final IParameter CONVERTER = new PluginParameter(
32       "converter",
33       "Name of the converter to use. Default is <code>html</code>.",
34       "xhtml");
35   public final static PluginParameter ALIGNMENT = new PluginParameter(
36       "alignment",
37       "Specifies the horizontal alignment of the output. Supported values are: "
38           + ConversionOptionsUtilities.getAvailableHorizontalAlignmentNameString()
39           + " default is <code>left</code>.",
40       "center");
41   public final static PluginParameter PRINT_VERSION = new PluginParameter(
42       "printVersion",
43       "If specified, the plugin only prints its name an version.",
44       "true");
45   public final static PluginParameter BORDER = new PluginParameter(
46       "border",
47       "boolean flag for rendering a table border around the converted result. Default is <code>false<code>",
48       "true");
49   public final static PluginParameter LINE_NUMBERS = new PluginParameter(
50       "lineNumbers",
51       "boolean flag for rendering line numbers. Default is <code>false</false>",
52       "true");
53   public final static PluginParameter TAB_SIZE = new PluginParameter(
54       "tabSize",
55       "Number of spaces representing a tab character. Default is <code>2</code>.",
56       "4");
57
58   private String JavaDoc name;
59   private String JavaDoc description;
60   private String JavaDoc exampleValue;
61
62   public PluginParameter(String JavaDoc name, String JavaDoc description, String JavaDoc exampleValue) {
63     this.exampleValue = exampleValue;
64     this.name = name;
65     this.description = description;
66     all.add(this);
67     allNames.add(name);
68   }
69
70   public String JavaDoc getName() {
71     return name;
72   }
73
74   public static Set JavaDoc getAll() {
75     return all;
76   }
77
78   public boolean isInternal() {
79     return isInternal(getName());
80   }
81
82   public static boolean isInternal(String JavaDoc parameterName) {
83     return parameterName.startsWith("_");
84   }
85
86   public String JavaDoc getDescription() {
87     return description;
88   }
89
90   public String JavaDoc getExampleValue() {
91     return exampleValue;
92   }
93
94   public static Set JavaDoc getAllNames() {
95     return allNames;
96   }
97 }
Popular Tags