Package org.jrd.backend.data
Class Cli
- java.lang.Object
-
- org.jrd.backend.data.Cli
-
public class Cli extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCli.CompileArguments(package private) static classCli.Saving
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringAPIprotected static java.lang.StringBASE64protected static java.lang.StringBYTESprotected static java.lang.StringCOMPILEprotected static java.lang.StringCPprotected static java.lang.StringDECOMPILEprivate java.util.List<java.lang.String>filteredArgsprotected static java.lang.StringHprotected static java.lang.StringHELPprotected static java.lang.StringINITprivate booleanisVerboseprotected static java.lang.StringLIST_CLASSESprotected static java.lang.StringLIST_CLASSESDETAILSprotected static java.lang.StringLIST_JVMSprotected static java.lang.StringLIST_PLUGINSprotected static java.lang.StringOVERWRITEprotected static java.lang.StringPprivate PluginManagerpluginManagerprotected static java.lang.StringRprotected static java.lang.StringSAVE_ASprotected static java.lang.StringSAVE_LIKEprivate Cli.Savingsavingprotected static java.lang.StringVERBOSEprotected static java.lang.StringVERSIONprivate VmManagervmManager
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidapi()private static java.lang.StringcleanParameter(java.lang.String param)private voidcompile(Cli.CompileArguments args)voidconsumeCli()private voiddecompile()private DecompilerWrapperfindDecompiler(java.lang.String decompilerName)static DecompilerWrapperfindDecompiler(java.lang.String decompilerName, PluginManager pluginManager)(package private) VmInfogetVmInfo(java.lang.String param)static java.lang.StringguessName(byte[] fileContents)private VmInfo.TypeguessType(java.lang.String input)private voidinit()static voidinitClass(VmInfo vmInfo, VmManager vmManager, java.lang.String fqn, java.io.PrintStream outputMessageStream)private static java.lang.StringinvalidityToString(boolean invalidWrapper)booleanisGui()private voidlistClasses(boolean details)private voidlistClassesFromVmInfo(VmInfo vmInfo, java.util.List<java.util.regex.Pattern> filter, boolean details)private voidlistJvms()private voidlistPlugins()private static booleanmatchesAtLeastOne(ClassInfo clazz, java.util.List<java.util.regex.Pattern> filter)static VmDecompilerStatusobtainClass(VmInfo vmInfo, java.lang.String clazz, VmManager manager)static java.lang.String[]obtainClasses(VmInfo vmInfo, VmManager manager)static ClassInfo[]obtainClassesDetails(VmInfo vmInfo, VmManager manager)private static java.util.List<ClassInfo>obtainFilteredClasses(VmInfo vmInfo, VmManager vmManager, java.util.List<java.util.regex.Pattern> filter, boolean details)private booleanoutOrSave(java.lang.String name, java.lang.String extension, byte[] body, boolean forceBytes)private booleanoutOrSave(java.lang.String name, java.lang.String extension, java.lang.String s)private voidoverwrite()private java.util.List<java.lang.String>prefilterArgs(java.lang.String[] originalArgs)private voidprintBytes(boolean justBytes)private voidprintHelp()private voidprintVersion()private voidreturnNonzero(int failures, int total)booleanshouldBeVerbose()
-
-
-
Field Detail
-
VERBOSE
protected static final java.lang.String VERBOSE
- See Also:
- Constant Field Values
-
SAVE_AS
protected static final java.lang.String SAVE_AS
- See Also:
- Constant Field Values
-
SAVE_LIKE
protected static final java.lang.String SAVE_LIKE
- See Also:
- Constant Field Values
-
LIST_JVMS
protected static final java.lang.String LIST_JVMS
- See Also:
- Constant Field Values
-
LIST_PLUGINS
protected static final java.lang.String LIST_PLUGINS
- See Also:
- Constant Field Values
-
LIST_CLASSES
protected static final java.lang.String LIST_CLASSES
- See Also:
- Constant Field Values
-
LIST_CLASSESDETAILS
protected static final java.lang.String LIST_CLASSESDETAILS
- See Also:
- Constant Field Values
-
BASE64
protected static final java.lang.String BASE64
- See Also:
- Constant Field Values
-
BYTES
protected static final java.lang.String BYTES
- See Also:
- Constant Field Values
-
DECOMPILE
protected static final java.lang.String DECOMPILE
- See Also:
- Constant Field Values
-
COMPILE
protected static final java.lang.String COMPILE
- See Also:
- Constant Field Values
-
OVERWRITE
protected static final java.lang.String OVERWRITE
- See Also:
- Constant Field Values
-
INIT
protected static final java.lang.String INIT
- See Also:
- Constant Field Values
-
API
protected static final java.lang.String API
- See Also:
- Constant Field Values
-
VERSION
protected static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
HELP
protected static final java.lang.String HELP
- See Also:
- Constant Field Values
-
H
protected static final java.lang.String H
- See Also:
- Constant Field Values
-
R
protected static final java.lang.String R
- See Also:
- Constant Field Values
-
P
protected static final java.lang.String P
- See Also:
- Constant Field Values
-
CP
protected static final java.lang.String CP
- See Also:
- Constant Field Values
-
filteredArgs
private final java.util.List<java.lang.String> filteredArgs
-
vmManager
private final VmManager vmManager
-
pluginManager
private final PluginManager pluginManager
-
saving
private Cli.Saving saving
-
isVerbose
private boolean isVerbose
-
-
Constructor Detail
-
Cli
public Cli(java.lang.String[] orig, Model model)
-
-
Method Detail
-
cleanParameter
private static java.lang.String cleanParameter(java.lang.String param)
-
shouldBeVerbose
public boolean shouldBeVerbose()
-
isGui
public boolean isGui()
-
prefilterArgs
private java.util.List<java.lang.String> prefilterArgs(java.lang.String[] originalArgs)
-
consumeCli
public void consumeCli() throws java.lang.Exception- Throws:
java.lang.Exception
-
overwrite
private void overwrite() throws java.lang.Exception- Throws:
java.lang.Exception
-
api
private void api() throws java.lang.Exception- Throws:
java.lang.Exception
-
init
private void init() throws java.lang.Exception- Throws:
java.lang.Exception
-
initClass
public static void initClass(VmInfo vmInfo, VmManager vmManager, java.lang.String fqn, java.io.PrintStream outputMessageStream)
-
compile
private void compile(Cli.CompileArguments args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
guessName
public static java.lang.String guessName(byte[] fileContents) throws java.io.IOException- Throws:
java.io.IOException
-
decompile
private void decompile() throws java.lang.Exception- Throws:
java.lang.Exception
-
returnNonzero
private void returnNonzero(int failures, int total)
-
outOrSave
private boolean outOrSave(java.lang.String name, java.lang.String extension, java.lang.String s) throws java.io.IOException- Throws:
java.io.IOException
-
outOrSave
private boolean outOrSave(java.lang.String name, java.lang.String extension, byte[] body, boolean forceBytes) throws java.io.IOException- Throws:
java.io.IOException
-
findDecompiler
private DecompilerWrapper findDecompiler(java.lang.String decompilerName)
-
findDecompiler
public static DecompilerWrapper findDecompiler(java.lang.String decompilerName, PluginManager pluginManager)
-
printBytes
private void printBytes(boolean justBytes) throws java.lang.Exception- Throws:
java.lang.Exception
-
listClasses
private void listClasses(boolean details) throws java.io.IOException- Throws:
java.io.IOException
-
obtainFilteredClasses
private static java.util.List<ClassInfo> obtainFilteredClasses(VmInfo vmInfo, VmManager vmManager, java.util.List<java.util.regex.Pattern> filter, boolean details) throws java.io.IOException
- Throws:
java.io.IOException
-
listClassesFromVmInfo
private void listClassesFromVmInfo(VmInfo vmInfo, java.util.List<java.util.regex.Pattern> filter, boolean details) throws java.io.IOException
- Throws:
java.io.IOException
-
matchesAtLeastOne
private static boolean matchesAtLeastOne(ClassInfo clazz, java.util.List<java.util.regex.Pattern> filter)
-
listPlugins
private void listPlugins() throws java.io.IOException- Throws:
java.io.IOException
-
listJvms
private void listJvms() throws java.io.IOException- Throws:
java.io.IOException
-
printVersion
private void printVersion()
-
printHelp
private void printHelp()
-
invalidityToString
private static java.lang.String invalidityToString(boolean invalidWrapper)
-
obtainClassesDetails
public static ClassInfo[] obtainClassesDetails(VmInfo vmInfo, VmManager manager)
-
obtainClass
public static VmDecompilerStatus obtainClass(VmInfo vmInfo, java.lang.String clazz, VmManager manager)
-
guessType
private VmInfo.Type guessType(java.lang.String input)
-
getVmInfo
VmInfo getVmInfo(java.lang.String param)
-
-