public class App extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
caller
调用者所在路径,可能是目录,也可能是jar文件
|
static Map<String,ClassResource> |
CLASS
所有扫描到的类缓存
|
static Set<String> |
DIRECTORIES
扫描到的目录
|
static String |
frame
框架所在路径,可能是目录,也可能是jar文件
|
static Set<String> |
I18N
i18n文件名缓存
|
protected static Map<String,Map<Locale,String>> |
I18N_CACHE
i18n值缓存
|
static List<I18nResource> |
I18N_RESOURCE
所有扫描到的i18n缓存
|
static Map<String,List<String>> |
INTERFACE_IMPLEMENTS
所有扫描到的接口实现类列表缓存
|
static String |
PACKAGE
框架包名
|
static String |
root
应用根目录
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
App() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
get(String key)
获取线程变量
|
static String |
getImplement(Class<?>... interfaceOrClasses)
从类或接口的实现类列表的交集(如果是接口,则它的所有实现类参与交集;如果不是接口,它自身参与交集)中取得一个默认实现类,默认实现类的挑选规则由扫描器指定。
|
static String |
getImplement(String... interfaceOrClassNames)
从类或接口的实现类列表的交集(如果是接口,则它的所有实现类参与交集;如果不是接口,它自身参与交集)中取得一个默认实现类,默认实现类的挑选规则由扫描器指定。
|
static List<String> |
getImplements(Class<?>... interfaceOrClasses)
获取类或接口的实现类列表的交集(如果是接口,则它的所有实现类参与交集;如果不是接口,它自身参与交集)。
|
static List<String> |
getImplements(String... interfaceOrClassNames)
获取类或接口的实现类列表的交集(如果是接口,则它的所有实现类参与交集;如果不是接口,它自身参与交集)。
|
static String |
getProperty(Locale locale,
String key,
Object... params)
获取properties值
|
static String |
getProperty(String key,
Object... params)
获取properties值,默认使用请求客户端的locale,如果未设置则使用默认locale
|
static boolean |
getPropertyBoolean(String key,
boolean defaultValue)
获取properties的boolean值,如果获取不到或出错,返回默认值,不抛出异常
|
static double |
getPropertyDouble(String key,
double defaultValue)
获取properties的double值,如果获取不到或出错,返回默认值,不抛出异常
|
static float |
getPropertyFloat(String key,
float defaultValue)
获取properties的float值,如果获取不到或出错,返回默认值,不抛出异常
|
static int |
getPropertyInt(String key,
int defaultValue)
获取properties的int值,如果获取不到或出错,返回默认值,不抛出异常
|
static long |
getPropertyLong(String key,
long defaultValue)
获取properties的long值,如果获取不到或出错,返回默认值,不抛出异常
|
static short |
getPropertyShort(String key,
short defaultValue)
获取properties的short值,如果获取不到或出错,返回默认值,不抛出异常
|
static String |
getPropertyString(Locale locale,
String key,
String defaultValue)
获取properties的字符串值,如果获取不到或出错,返回默认值,不抛出异常
|
static String |
getPropertyString(String key,
String defaultValue)
获取properties的字符串值,如果获取不到或出错,返回默认值,不抛出异常
|
static IProxy |
getProxy()
获取代理接口,建议所有调用入口都通过代理,便于扩展AOP等功能。
|
static IRequest |
getRequest()
在任何地方获取输入请求
|
static IResponse |
getResponse()
在任何地方获取输出接口
|
static void |
set(String key,
Object value)
设置线程变量
|
public static String root
public static String caller
public static String frame
public static final String PACKAGE
public static final List<I18nResource> I18N_RESOURCE
public static final Map<String,ClassResource> CLASS
public static final Map<String,List<String>> INTERFACE_IMPLEMENTS
public static IRequest getRequest()
public static IResponse getResponse()
public static <T> T get(String key)
key - 键public static List<String> getImplements(String... interfaceOrClassNames)
interfaceOrClassNames - 完整类或接口名public static List<String> getImplements(Class<?>... interfaceOrClasses)
interfaceOrClasses - 类或接口们public static String getImplement(String... interfaceOrClassNames)
interfaceOrClassNames - 完整类或接口名public static String getImplement(Class<?>... interfaceOrClasses)
interfaceOrClasses - 类或接口们public static IProxy getProxy()
public static String getProperty(String key, Object... params)
key - keyparams - 传入参数public static String getProperty(Locale locale, String key, Object... params)
locale - localekey - keyparams - 传入参数public static short getPropertyShort(String key, short defaultValue)
key - 键defaultValue - 默认值public static int getPropertyInt(String key, int defaultValue)
key - 键defaultValue - 默认值public static long getPropertyLong(String key, long defaultValue)
key - 键defaultValue - 默认值public static float getPropertyFloat(String key, float defaultValue)
key - 键defaultValue - 默认值public static double getPropertyDouble(String key, double defaultValue)
key - 键defaultValue - 默认值public static boolean getPropertyBoolean(String key, boolean defaultValue)
key - 键defaultValue - 默认值public static String getPropertyString(String key, String defaultValue)
key - 键defaultValue - 默认值Copyright © 2020. All Rights Reserved.