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 class
Cli.CompileArguments
(package private) static class
Cli.Saving
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
API
protected static java.lang.String
BASE64
protected static java.lang.String
BYTES
protected static java.lang.String
COMPILE
protected static java.lang.String
CP
protected static java.lang.String
DECOMPILE
private java.util.List<java.lang.String>
filteredArgs
protected static java.lang.String
H
protected static java.lang.String
HELP
protected static java.lang.String
INIT
private boolean
isVerbose
protected static java.lang.String
LIST_CLASSES
protected static java.lang.String
LIST_CLASSESDETAILS
protected static java.lang.String
LIST_JVMS
protected static java.lang.String
LIST_PLUGINS
protected static java.lang.String
OVERWRITE
protected static java.lang.String
P
private PluginManager
pluginManager
protected static java.lang.String
R
protected static java.lang.String
SAVE_AS
protected static java.lang.String
SAVE_LIKE
private Cli.Saving
saving
protected static java.lang.String
VERBOSE
protected static java.lang.String
VERSION
private VmManager
vmManager
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
api()
private static java.lang.String
cleanParameter(java.lang.String param)
private void
compile(Cli.CompileArguments args)
void
consumeCli()
private void
decompile()
private DecompilerWrapper
findDecompiler(java.lang.String decompilerName)
static DecompilerWrapper
findDecompiler(java.lang.String decompilerName, PluginManager pluginManager)
(package private) VmInfo
getVmInfo(java.lang.String param)
static java.lang.String
guessName(byte[] fileContents)
private VmInfo.Type
guessType(java.lang.String input)
private void
init()
static void
initClass(VmInfo vmInfo, VmManager vmManager, java.lang.String fqn, java.io.PrintStream outputMessageStream)
private static java.lang.String
invalidityToString(boolean invalidWrapper)
boolean
isGui()
private void
listClasses(boolean details)
private void
listClassesFromVmInfo(VmInfo vmInfo, java.util.List<java.util.regex.Pattern> filter, boolean details)
private void
listJvms()
private void
listPlugins()
private static boolean
matchesAtLeastOne(ClassInfo clazz, java.util.List<java.util.regex.Pattern> filter)
static VmDecompilerStatus
obtainClass(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 boolean
outOrSave(java.lang.String name, java.lang.String extension, byte[] body, boolean forceBytes)
private boolean
outOrSave(java.lang.String name, java.lang.String extension, java.lang.String s)
private void
overwrite()
private java.util.List<java.lang.String>
prefilterArgs(java.lang.String[] originalArgs)
private void
printBytes(boolean justBytes)
private void
printHelp()
private void
printVersion()
private void
returnNonzero(int failures, int total)
boolean
shouldBeVerbose()
-
-
-
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)
-
-