Package org.eclipse.jgit.pgm
Class CommandRef
- java.lang.Object
-
- org.eclipse.jgit.pgm.CommandRef
-
public class CommandRef extends java.lang.ObjectDescription of a command (aTextBuiltinsubclass).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 Modifier and Type Field Description (package private) booleancommonprivate java.lang.Class<? extends TextBuiltin>implprivate java.lang.Stringnameprivate java.lang.Stringusage
-
Constructor Summary
Constructors Modifier Constructor Description (package private)CommandRef(java.lang.Class<? extends TextBuiltin> clazz)privateCommandRef(java.lang.Class<? extends TextBuiltin> clazz, java.lang.String cn)(package private)CommandRef(java.lang.Class<? extends TextBuiltin> clazz, Command cmd)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextBuiltincreate()Create an instance of the command implementationjava.lang.ClassLoadergetImplementationClassLoader()Get implementation class loaderjava.lang.StringgetImplementationClassName()Get implementation class namejava.lang.StringgetName()Get thename.java.lang.StringgetUsage()Getusage.private static java.lang.StringguessName(java.lang.Class<? extends TextBuiltin> clazz)booleanisCommon()Is this command commonly usedjava.lang.StringtoString()
-
-
-
Field Detail
-
impl
private final java.lang.Class<? extends TextBuiltin> impl
-
name
private final java.lang.String name
-
usage
private java.lang.String usage
-
common
boolean common
-
-
Constructor Detail
-
CommandRef
CommandRef(java.lang.Class<? extends TextBuiltin> clazz)
-
CommandRef
CommandRef(java.lang.Class<? extends TextBuiltin> clazz, Command cmd)
-
CommandRef
private CommandRef(java.lang.Class<? extends TextBuiltin> clazz, java.lang.String cn)
-
-
Method Detail
-
guessName
private static java.lang.String guessName(java.lang.Class<? extends TextBuiltin> clazz)
-
getName
public java.lang.String getName()
Get thename.- Returns:
- name the command is invoked as from the command line.
-
getUsage
public java.lang.String 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
public java.lang.String getImplementationClassName()
Get implementation class name- Returns:
- name of the Java class which implements this command.
-
getImplementationClassLoader
public java.lang.ClassLoader getImplementationClassLoader()
Get implementation class loader- Returns:
- loader for
getImplementationClassName().
-
create
public TextBuiltin create()
Create an instance of the command implementation- Returns:
- a new instance of the command implementation.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-