Package com.easydesk.localization
Class EasyDeskMessageSource
java.lang.Object
org.springframework.context.support.MessageSourceSupport
org.springframework.context.support.AbstractMessageSource
com.easydesk.localization.EasyDeskMessageSource
- All Implemented Interfaces:
org.springframework.context.HierarchicalMessageSource,org.springframework.context.MessageSource
public class EasyDeskMessageSource
extends org.springframework.context.support.AbstractMessageSource
EasyDeskLocalizationService 를 Spring MessageSource 로 쓰기 위한 adapter.
Thymeleaf(#{key}) 처럼 MessageSource 를 받는 곳에서 EasyDesk bundle 을 같은 규칙(여러 bundle 검색, 번역이 없으면
기본 locale)으로 쓰게 해 준다. 기본 생성자는 매번 Localization.getService() 를 쓰므로, 나중에 Spring bean 이 등록되면 그
bean 을 따라간다.
일부러 bean 이름 messageSource 로 등록하지 않는다 - web 쪽(Spring Boot) 의 화면용 MessageSource 를 덮어쓰지 않도록.
- Author:
- Youngho Cho
-
Field Summary
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected MessageFormatresolveCode(String code, Locale locale) protected StringresolveCodeWithoutArguments(String code, Locale locale) Methods inherited from class org.springframework.context.support.AbstractMessageSource
getCommonMessages, getDefaultMessage, getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, getParentMessageSource, isUseCodeAsDefaultMessage, resolveArguments, setCommonMessages, setParentMessageSource, setUseCodeAsDefaultMessageMethods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, renderDefaultMessage, setAlwaysUseMessageFormat
-
Constructor Details
-
EasyDeskMessageSource
public EasyDeskMessageSource() -
EasyDeskMessageSource
-
EasyDeskMessageSource
-
-
Method Details
-
resolveCodeWithoutArguments
- Overrides:
resolveCodeWithoutArgumentsin classorg.springframework.context.support.AbstractMessageSource
-
resolveCode
- Specified by:
resolveCodein classorg.springframework.context.support.AbstractMessageSource
-