From 7b8f27fd18b76bd6bc217edc25b98b00da43ddab Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 7 Aug 2008 05:44:45 +0000 Subject: [PATCH] doc improvement. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11316 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Plugin.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/core/src/main/java/hudson/Plugin.java b/core/src/main/java/hudson/Plugin.java index 3c0f6abd6e..a864f8f416 100644 --- a/core/src/main/java/hudson/Plugin.java +++ b/core/src/main/java/hudson/Plugin.java @@ -122,6 +122,25 @@ public abstract class Plugin { * If this class defines config.jelly view, be sure to * override this method and persists the submitted values accordingly. * + *

+ * The following is a sample config.jelly that you can start yours with: + *


+     * <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
+     *   <f:section title="Locale">
+     *     <f:entry title="${%Default Language}" help="/plugin/locale/help/default-language.html">
+     *       <f:textbox name="systemLocale" value="${it.systemLocale}" />
+     *     </f:entry>
+     *   </f:section>
+     * </j:jelly>
+     * 
+ * + *

+ * This allows you to access data as {@code formData.getString("systemLocale")} + * + *

+ * If you are using this method, you'll likely be interested in + * using {@link #save()} and {@link #load()}. + * * @since 1.233 */ public void configure(JSONObject formData) throws IOException, ServletException, FormException { @@ -154,6 +173,8 @@ public abstract class Plugin { * *

* If there was no previously persisted state, this method is no-op. + * + * @since 1.245 */ protected void load() throws IOException { XmlFile xml = getConfigXml(); @@ -163,6 +184,8 @@ public abstract class Plugin { /** * Saves serializable fields of this instance to the persisted storage. + * + * @since 1.245 */ protected void save() throws IOException { getConfigXml().write(this); @@ -174,6 +197,8 @@ public abstract class Plugin { * * This method can be also overriden if the plugin wants to * use a custom {@link XStream} instance to persist data. + * + * @since 1.245 */ protected XmlFile getConfigXml() { return new XmlFile(Hudson.XSTREAM, -- GitLab