From 1642a98e640880ebdc694da5ce890eacfdfea2df Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 3 Sep 2009 23:46:24 +0000 Subject: [PATCH] turns out these are unnecessary. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21446 71c3de6d-444a-0410-be80-ed276b4c234a --- .../cli/declarative/CLIInstanceResolver.java | 43 ------------------- .../CLIInstanceResolverFactory.java | 25 ----------- 2 files changed, 68 deletions(-) delete mode 100644 core/src/main/java/hudson/cli/declarative/CLIInstanceResolver.java delete mode 100644 core/src/main/java/hudson/cli/declarative/CLIInstanceResolverFactory.java diff --git a/core/src/main/java/hudson/cli/declarative/CLIInstanceResolver.java b/core/src/main/java/hudson/cli/declarative/CLIInstanceResolver.java deleted file mode 100644 index 19cd97f6c7..0000000000 --- a/core/src/main/java/hudson/cli/declarative/CLIInstanceResolver.java +++ /dev/null @@ -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. - * - *

- * 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. - * - *

- * 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 { - /** - * Fills the given {@link CmdLineParser} by defining options and arguments that this resolver uses. - * - *

- * 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; -} diff --git a/core/src/main/java/hudson/cli/declarative/CLIInstanceResolverFactory.java b/core/src/main/java/hudson/cli/declarative/CLIInstanceResolverFactory.java deleted file mode 100644 index f4b3264dec..0000000000 --- a/core/src/main/java/hudson/cli/declarative/CLIInstanceResolverFactory.java +++ /dev/null @@ -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. - * - *

- * 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 CLIInstanceResolver create(Class type); -}