001package com.ericlam.mc.groovier; 002 003import com.google.inject.Injector; 004 005import javax.inject.Provider; 006 007/** 008 * api of groovier 009 */ 010public interface GroovierAPI { 011 012 /** 013 * add new scripts type loader 014 * @param scriptLoader script type loader 015 */ 016 void addScriptLoader(Class<? extends ScriptLoader> scriptLoader); 017 018 /** 019 * add new registrable script type for plugin 020 * @param validator registrable script type 021 * @param ins instance 022 * @param <T> registrable script type 023 */ 024 <T extends ScriptValidator> void bindRegisters(Class<T> validator, T ins); 025 026 /** 027 * bindInstance for guice 028 * @param type class type 029 * @param ins instance 030 * @param <T> class type 031 */ 032 <T> void bindInstance(Class<T> type, T ins); 033 034 /** 035 * bind class type for guice 036 * @param type class type 037 * @param clazz class 038 * @param <T> class type 039 * @param <V> class 040 */ 041 <T, V extends T> void bindType(Class<T> type, Class<V> clazz); 042 043 /** 044 * bind provider for guice 045 * @param type class type 046 * @param clazz class 047 * @param <T> class type 048 * @param <P> provider type 049 */ 050 <T, P extends Provider<T>> void bindProvider(Class<T> type, Class<P> clazz); 051 052 /** 053 * get injector (without service injection) for guice 054 * @return injector 055 */ 056 Injector getBaseInjector(); 057 058 /** 059 * get injector (with service injection) for guice 060 * @return injector 061 */ 062 ServiceInjector getServiceInjector(); 063 064 /** 065 * get argument parser 066 * @return argument parser 067 */ 068 ArgumentParser getArgumentParser(); 069 070}