All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dellroad.jct.jshell.command.Bundle Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version

/*
 * Copyright (C) 2023 Archie L. Cobbs. All rights reserved.
 */

package org.dellroad.jct.jshell.command;

import org.dellroad.jct.core.simple.TreeMapBundle;
import org.dellroad.jct.core.util.ConsoleUtil;

@SuppressWarnings("serial")
public class Bundle extends TreeMapBundle {

    public Bundle() {
        super("Java Console Toolkit JShell commands");

        // Require JDK 9+
        if (ConsoleUtil.getJavaVersion() >= 9)
            this.put("jshell", new JShellCommandCreator().create());
    }

    // Using a separate class avoids a class resolution error if JDK version < 9
    private static final class JShellCommandCreator {
        JShellCommand create() {
            return new JShellCommand();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy