Class NshBuiltinBase
java.lang.Object
net.thevpc.nsh.cmd.NshBuiltinBase
- All Implemented Interfaces:
NshBuiltin,NComponent,NScorable
- Direct Known Subclasses:
NshBuiltinCore,NshBuiltinDefault
- Author:
- thevpc
-
Field Summary
Fields inherited from interface net.thevpc.nuts.util.NScorable
CUSTOM_SCORE, DEFAULT_SCORE, UNSUPPORTED_SCORE -
Constructor Summary
ConstructorsConstructorDescriptionNshBuiltinBase(String name, int score, Class<?> optionsSupplier) NshBuiltinBase(String name, int score, Supplier<?> optionsSupplier) NshBuiltinBase(String name, Class<?> optionsSupplier) NshBuiltinBase(String name, Supplier<?> optionsSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidautoComplete(NshExecutionContext context, NCmdLineAutoComplete autoComplete) protected NCmdLinecmdLine(String[] args, NshExecutionContext context) protected static ObjectcreateOptions(Class<?> optionsClass) final voidexec(String[] args, NshExecutionContext context) exec and return error codegetHelp()getName()intgetScore(NScorableContext param) protected voidinit(NCmdLine cmdLine, NshExecutionContext context) booleanprotected abstract voidmain(NCmdLine cmdLine, NshExecutionContext context) protected abstract booleannextNonOption(NArg arg, NCmdLine cmdLine, NshExecutionContext context) protected abstract booleannextOption(NArg arg, NCmdLine cmdLine, NshExecutionContext context) voidsetEnabled(boolean enabled) protected voidthrowExecutionException(Object errObject, int errorCode, NSession session) protected voidvalidate(NCmdLine cmdLine, NshExecutionContext context)
-
Constructor Details
-
NshBuiltinBase
-
NshBuiltinBase
-
NshBuiltinBase
-
NshBuiltinBase
-
-
Method Details
-
createOptions
-
nextOption
-
nextNonOption
-
main
-
validate
-
init
-
getScore
- Specified by:
getScorein interfaceNComponent- Specified by:
getScorein interfaceNScorable
-
autoComplete
- Specified by:
autoCompletein interfaceNshBuiltin
-
getHelp
- Specified by:
getHelpin interfaceNshBuiltin
-
getName
- Specified by:
getNamein interfaceNshBuiltin
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceNshBuiltin
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceNshBuiltin
-
getHelpHeader
- Specified by:
getHelpHeaderin interfaceNshBuiltin
-
throwExecutionException
-
exec
Description copied from interface:NshBuiltinexec and return error code- Specified by:
execin interfaceNshBuiltin- Parameters:
args- commandcontext- context
-
cmdLine
-