Skip to content
Annotation processor for generating inferred objects.
Java Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
inference-basic Refactoring of freemarker model Nov 7, 2019


Travis AppVeyor Codecov

Annotation processor for generating inferred objects. For information about what are inferences and inferred objects and why do they needed, check this page.

How to use it

  1. Add a maven dependency:
  1. Define and annotate an inference:
public @Infers(value = "GithubUser", memoized = true) class GithubUserInference implements Inference<User> {
    private final String apiToken;

    public GithubUserInference(String apiToken) {
        this.apiToken = apiToken;

    public final User inferredInstance() {
        try {
            Github github = new RtGithub(apiToken);
            com.jcabi.github.User self = github.users().self();
            return new StaticUser(self.login(), self.emails().iterate());    
        } catch(IOException ex) {
            throw new RuntimeException(ex);
  1. Build the project

During the project build, sources for inferred class (UserInferred) and inferred alias (GithubUser) for the defined inference will automatically be generated.

  1. Use generated sources
public class App {
    public static void main( String[] args ) throws Exception {
        Memory mem = new MemoryCHM();
        User user = new GithubUser("xxxsomegithubtokenxxx", mem);
You can’t perform that action at this time.