Java Code Examples for org.benf.cfr.reader.state.ClassFileSourceImpl

The following examples show how to use org.benf.cfr.reader.state.ClassFileSourceImpl. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public String decompileClassNode(FileContainer container, ClassNode cn) {
    try {
        byte[] bytes = JDA.getClassBytes(container, cn);
        GetOptParser getOptParser = new GetOptParser();
        Pair processedArgs = getOptParser.parse(generateMainMethod(), OptionsImpl.getFactory());
        List files = (List)processedArgs.getFirst();
        Options options = (Options)processedArgs.getSecond();
        ClassFileSourceImpl classFileSource = new ClassFileSourceImpl(options);
        DCCommonState dcCommonState = new DCCommonState(options, classFileSource);
        return doClass(dcCommonState, bytes);
    } catch (Exception e) {
        return parseException(e);
Example 2
Source Project: cfr   Source File:    License: MIT License 5 votes vote down vote up
private static DCCommonState initDCState(Map<String, String> optionsMap, ClassFileSource classFileSource) {
    OptionsImpl options = new OptionsImpl(optionsMap);
    ClassFileSource2 source = classFileSource == null ?
            new ClassFileSourceImpl(options) :
            new ClassFileSourceWrapper(classFileSource);
    return new DCCommonState(options, source);
Example 3
Source Project: cfr   Source File:    License: MIT License 4 votes vote down vote up
 * @param options Map of options, as per {@link CfrDriver}'s builder.
 * @return CFR's internal implementation of {@link ClassFileSource}
static ClassFileSource createInternalClassFileSource(Map<String, String> options) {
    Options parsedOptions = OptionsImpl.getFactory().create(options);
    return new ClassFileSourceImpl(parsedOptions);