mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
turns out these are unnecessary.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21446 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
65de7809ba
commit
1642a98e64
2 files changed
-68
No files matched your search
@@ -1,43 +0,0 @@
|
||||
package hudson.cli.declarative;
|
||||
|
||||
import org.kohsuke.args4j.CmdLineParser;
|
||||
import org.kohsuke.args4j.ClassParser;
|
||||
import org.kohsuke.args4j.CmdLineException;
|
||||
import hudson.model.Hudson;
|
||||
|
||||
/**
|
||||
* Used to parse a portion of arguments to resolve to a model object, for which {@link CLIMethod} will be invoked.
|
||||
*
|
||||
* <p>
|
||||
* This object is stateful. Typical subtype contains a number of fields and setter methods with args4j annotations.
|
||||
* The CLI framework creates an instance of {@link CLIInstanceResolver} from {@link CLIInstanceResolverFactory},
|
||||
* call {@link #defineOptionsTo(CmdLineParser)}, then let {@link CmdLineParser} parses the arguments, which
|
||||
* fills this object with parameters and arguments.
|
||||
*
|
||||
* <p>
|
||||
* Finally, the CLI framework will call {@link #resolve()} to obtain the object, and that is the object
|
||||
* that the command will act on.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
* @see CLIInstanceResolverFactory
|
||||
* @since 1.324
|
||||
*/
|
||||
public abstract class CLIInstanceResolver<T> {
|
||||
/**
|
||||
* Fills the given {@link CmdLineParser} by defining options and arguments that this resolver uses.
|
||||
*
|
||||
* <p>
|
||||
* The default implementation expects the resolver instance itself to be annotated with args4j annotations.
|
||||
*/
|
||||
public void defineOptionsTo(CmdLineParser parser) {
|
||||
new ClassParser().parse(this,parser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after {@link CmdLineParser} parsed arguments, to resolve the instance.
|
||||
*
|
||||
* @return
|
||||
* must not be null.
|
||||
*/
|
||||
public abstract T resolve() throws CmdLineException;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package hudson.cli.declarative;
|
||||
|
||||
import hudson.ExtensionPoint;
|
||||
import hudson.Extension;
|
||||
|
||||
|
||||
/**
|
||||
* Extension point for resolving an instance of a model object, from the arguments and options given to CLI.
|
||||
*
|
||||
* <p>
|
||||
* To have your implementation registered, put {@link Extension} on your implementation.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
* @since 1.324
|
||||
*/
|
||||
public abstract class CLIInstanceResolverFactory implements ExtensionPoint {
|
||||
/**
|
||||
* Creates a new instance of {@link CLIInstanceResolver} that can resolve the given type.
|
||||
*
|
||||
* @return
|
||||
* null if this factory doens't understand the given type, in which case the caller
|
||||
* will continue to search the rest of the factories for a match.
|
||||
*/
|
||||
public abstract <T> CLIInstanceResolver<? extends T> create(Class<T> type);
|
||||
}
|
||||
Reference in new issue
Block a user