提交 c5365fa7 编写于 作者: M mindless

Add @DataBoundConstructor for easier reuse in plugins.

See http://hudson.361315.n4.nabble.com/DataBoundConstructor-td2244199.html


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31861 71c3de6d-444a-0410-be80-ed276b4c234a
上级 bb013d01
/* /*
* The MIT License * The MIT License
* *
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
...@@ -27,6 +27,7 @@ import hudson.FilePath; ...@@ -27,6 +27,7 @@ import hudson.FilePath;
import hudson.Extension; import hudson.Extension;
import hudson.model.AbstractProject; import hudson.model.AbstractProject;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerRequest;
/** /**
...@@ -35,6 +36,7 @@ import org.kohsuke.stapler.StaplerRequest; ...@@ -35,6 +36,7 @@ import org.kohsuke.stapler.StaplerRequest;
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public class BatchFile extends CommandInterpreter { public class BatchFile extends CommandInterpreter {
@DataBoundConstructor
public BatchFile(String command) { public BatchFile(String command) {
super(command); super(command);
} }
......
...@@ -30,6 +30,7 @@ import hudson.Extension; ...@@ -30,6 +30,7 @@ import hudson.Extension;
import hudson.model.AbstractProject; import hudson.model.AbstractProject;
import hudson.util.FormValidation; import hudson.util.FormValidation;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.QueryParameter;
...@@ -43,6 +44,7 @@ import java.util.Arrays; ...@@ -43,6 +44,7 @@ import java.util.Arrays;
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public class Shell extends CommandInterpreter { public class Shell extends CommandInterpreter {
@DataBoundConstructor
public Shell(String command) { public Shell(String command) {
super(fixCrLf(command)); super(fixCrLf(command));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册