Top Description Fields Constructors Methods
org.eclipse.jgit.pgm

public Class CommandRef

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .InvocationTargetException, java.text.MessageFormat, org.eclipse.jgit.pgm.internal.CLIText

Description of a command (a org.eclipse.jgit.pgm.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

Modifier and TypeField and Description
pack-priv boolean
private final Class<? extends TextBuiltin>
private final String
private String

Constructor Summary

AccessConstructor and Description
pack-priv
CommandRef(Class<? extends TextBuiltin> clazz)

pack-priv
CommandRef(Class<? extends TextBuiltin> clazz, Command cmd)

private
CommandRef(Class<? extends TextBuiltin> clazz, String cn)

Method Summary

Modifier and TypeMethod and Description
public TextBuiltin

Returns:

a new instance of the command implementation.
create
()

Create an instance of the command implementation

public ClassLoader

Returns:

loader for getImplementationClassName().
getImplementationClassLoader
()

Get implementation class loader

public String

Returns:

name of the Java class which implements this command.
getImplementationClassName
()

Get implementation class name

public String

Returns:

name the command is invoked as from the command line.
getName
()

Get the name.

public String

Returns:

one line description of the command's feature set.
getUsage
()

Get usage.

private static String
guessName(Class<? extends TextBuiltin> clazz)

public boolean

Returns:

true if this command is considered to be commonly used.
isCommon
()

Is this command commonly used

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

commonback to summary
pack-priv boolean common
implback to summary
private final Class<? extends TextBuiltin> impl
nameback to summary
private final String name
usageback to summary
private String usage

Constructor Detail

CommandRefback to summary
pack-priv CommandRef(Class<? extends TextBuiltin> clazz)
CommandRefback to summary
pack-priv CommandRef(Class<? extends TextBuiltin> clazz, Command cmd)
CommandRefback to summary
private CommandRef(Class<? extends TextBuiltin> clazz, String cn)

Method Detail

createback to summary
public TextBuiltin create()

Create an instance of the command implementation

Returns:TextBuiltin

a new instance of the command implementation.

getImplementationClassLoaderback to summary
public ClassLoader getImplementationClassLoader()

Get implementation class loader

Returns:ClassLoader

loader for getImplementationClassName().

getImplementationClassNameback to summary
public String getImplementationClassName()

Get implementation class name

Returns:String

name of the Java class which implements this command.

getNameback to summary
public String getName()

Get the name.

Returns:String

name the command is invoked as from the command line.

getUsageback to summary
public String getUsage()

Get usage.

Returns:String

one line description of the command's feature set.

guessNameback to summary
private static String guessName(Class<? extends TextBuiltin> clazz)
isCommonback to summary
public boolean isCommon()

Is this command commonly used

Returns:boolean

true if this command is considered to be commonly used.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@SuppressWarnings:nls
@Override