com.github.dactiv.showcase.common
类 SystemVariableUtils

java.lang.Object
  继承者 com.github.dactiv.showcase.common.SystemVariableUtils

@Component
public class SystemVariableUtils
extends Object

系统变量工具类

作者:
maurice

字段摘要
static String DEFAULT_DICTIONARY_VALUE
           
 
构造方法摘要
SystemVariableUtils()
           
 
方法摘要
static org.apache.shiro.session.Session createSessionIfNull()
          创建一个shiro的session,如果存在session就用现有的session,否则创建一个新的session
static String getName(Class<? extends Enum<? extends ValueEnum<?>>> enumClass, Object value)
          通过字典枚举获取字典名称
static String getName(SystemDictionaryCode systemDictionaryCode, Object value)
          获取数据字典名称
static org.apache.shiro.session.Session getSession()
          获取shiro的session
static org.apache.shiro.session.Session getSession(boolean create)
          获取shiro的session
static SessionVariable getSessionVariable()
          获取当前系统常用Session变量实体
static List<DataDictionary> getVariables(Class<? extends Enum<? extends ValueEnum<?>>> enumClass, Object... ignoreValue)
          通过字典枚举获取数据字典集合
static List<DataDictionary> getVariables(SystemDictionaryCode code, String... ignoreValue)
          通过字典类别代码获取数据字典集合
static boolean isAuthenticated()
          判断当前会话是否登录
 void setSystemVariableManager(SystemVariableManager systemDictionaryManager)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

DEFAULT_DICTIONARY_VALUE

public static String DEFAULT_DICTIONARY_VALUE
构造方法详细信息

SystemVariableUtils

public SystemVariableUtils()
方法详细信息

setSystemVariableManager

@Autowired
public void setSystemVariableManager(SystemVariableManager systemDictionaryManager)

getName

public static String getName(SystemDictionaryCode systemDictionaryCode,
                             Object value)
获取数据字典名称

参数:
systemDictionaryCode - 类别代码
value - 值
返回:
String

getName

public static String getName(Class<? extends Enum<? extends ValueEnum<?>>> enumClass,
                             Object value)
通过字典枚举获取字典名称

参数:
enumClass - 字典枚举class
value - 值
返回:
String

getVariables

public static List<DataDictionary> getVariables(SystemDictionaryCode code,
                                                String... ignoreValue)
通过字典类别代码获取数据字典集合

参数:
code - 字典类别
ignoreValue - 忽略字典的值
返回:
List

getVariables

public static List<DataDictionary> getVariables(Class<? extends Enum<? extends ValueEnum<?>>> enumClass,
                                                Object... ignoreValue)
通过字典枚举获取数据字典集合

参数:
enumClass - 字典枚举 class
ignoreValue - 忽略字典的值
返回:
List

getSessionVariable

public static SessionVariable getSessionVariable()
获取当前系统常用Session变量实体

返回:
SessionVariable

createSessionIfNull

public static org.apache.shiro.session.Session createSessionIfNull()
创建一个shiro的session,如果存在session就用现有的session,否则创建一个新的session

返回:
Session

getSession

public static org.apache.shiro.session.Session getSession()
获取shiro的session

返回:
Session

getSession

public static org.apache.shiro.session.Session getSession(boolean create)
获取shiro的session

参数:
create - true表示如果不存在,就创建,否则用现有的
返回:
Session

isAuthenticated

public static boolean isAuthenticated()
判断当前会话是否登录

返回:
boolean


Copyright © 2014. All rights reserved.