Package org.eclipse.jgit.pgm
Class CommandRef
java.lang.Object
org.eclipse.jgit.pgm.CommandRef
Description of a command (a
TextBuiltin
subclass).
These descriptions are lightweight compared to creating a command instance and are therefore suitable for catalogs of "known" commands without linking the command's implementation and creating a dummy instance of the command.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
CommandRef
(Class<? extends TextBuiltin> clazz) private
CommandRef
(Class<? extends TextBuiltin> clazz, String cn) (package private)
CommandRef
(Class<? extends TextBuiltin> clazz, Command cmd) -
Method Summary
Modifier and TypeMethodDescriptioncreate()
Create an instance of the command implementationGet implementation class loaderGet implementation class namegetName()
Get thename
.getUsage()
Getusage
.private static String
guessName
(Class<? extends TextBuiltin> clazz) boolean
isCommon()
Is this command commonly usedtoString()
-
Field Details
-
impl
-
name
-
usage
-
common
boolean common
-
-
Constructor Details
-
CommandRef
CommandRef(Class<? extends TextBuiltin> clazz) -
CommandRef
CommandRef(Class<? extends TextBuiltin> clazz, Command cmd) -
CommandRef
-
-
Method Details
-
guessName
-
getName
Get thename
.- Returns:
- name the command is invoked as from the command line.
-
getUsage
Getusage
.- Returns:
- one line description of the command's feature set.
-
isCommon
public boolean isCommon()Is this command commonly used- Returns:
- true if this command is considered to be commonly used.
-
getImplementationClassName
Get implementation class name- Returns:
- name of the Java class which implements this command.
-
getImplementationClassLoader
Get implementation class loader- Returns:
- loader for
getImplementationClassName()
.
-
create
Create an instance of the command implementation- Returns:
- a new instance of the command implementation.
-
toString
-