提交 89299908 编写于 作者: M mindless

[FIXED HUDSON-3011] Export ParametersAction and values via /api/


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15236 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d4bd806c
......@@ -30,6 +30,8 @@ import hudson.util.VariableResolver;
import java.util.Map;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import net.sf.json.JSONObject;
/**
......@@ -58,6 +60,7 @@ import net.sf.json.JSONObject;
* </ol>
* @see ParameterDefinition
*/
@ExportedBean
public abstract class ParameterValue {
protected final String name;
......@@ -71,6 +74,7 @@ public abstract class ParameterValue {
* This uniquely distinguishes {@link ParameterValue} among other parameters
* for the same build. This must be the same as {@link ParameterDefinition#getName()}.
*/
@Exported(visibility=3)
public final String getName() {
return name;
}
......
......@@ -27,6 +27,8 @@ import hudson.Util;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildStep;
import hudson.util.VariableResolver;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import java.util.Collection;
import java.util.Iterator;
......@@ -40,6 +42,7 @@ import java.util.Map;
* This object is associated with the build record so that we remember what parameters
* were used for what build.
*/
@ExportedBean
public class ParametersAction implements Action, Iterable<ParameterValue> {
private final List<ParameterValue> parameters;
......@@ -94,6 +97,7 @@ public class ParametersAction implements Action, Iterable<ParameterValue> {
return parameters.iterator();
}
@Exported(visibility=2)
public List<ParameterValue> getParameters() {
return parameters;
}
......
......@@ -24,6 +24,7 @@
package hudson.model;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.export.Exported;
import java.util.Map;
......@@ -33,6 +34,7 @@ import hudson.util.VariableResolver;
* {@link ParameterValue} created from {@link StringParameterDefinition}.
*/
public class StringParameterValue extends ParameterValue {
@Exported(visibility=3)
public final String value;
@DataBoundConstructor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册