Skip to content

Support for interfaces with default methods #38

@rolve

Description

@rolve

I think Java 8 default methods would be a great way to convert or enrich parsed arguments. For example, I tried the following to convert a String to a Path:

public interface Args {
    @Option(shortName = "d")
    String directory();

    default Path directoryPath() {
        return FileSystems.getDefault().getPath(directory());
    }
}

Unfortunately, jewelcli does not seem to support default methods. When calling directoryPath(), I get null.

Without having looked at the code, I feel like this should be easy to implement. All that needs to be done it to not override/implement default methods in proxies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions