public interface ServiceExceptionUtils
ServiceException
.
ServiceExceptionUtils#getMessage
is used to implement ServiceException#getMessage
and
ServiceExceptionUtils#getLocalizedMessage
is used to implement ServiceException#getLocalizedMessage
respectively.
Modifier and Type | Method and Description |
---|---|
CdsProperties.Errors |
getErrorsProperties() |
String |
getLocalizedMessage(String code,
Object[] args,
Locale locale)
Creates a message based on code and args.
|
String |
getMessage(String code,
Object[] args)
Creates a message based on code and args.
|
MessageTarget |
getMessageTarget(com.sap.cds.ql.cqn.Path path,
com.sap.cds.reflect.CdsElement element)
|
MessageTarget |
getMessageTarget(String target)
Creates a new
MessageTarget with a string-based target |
<E extends com.sap.cds.ql.StructuredType<E>> |
getMessageTarget(String parameter,
Class<E> type,
Function<E,Object> path)
Creates a new
MessageTarget with a target, based on a target
parameter and a CQN path. |
MessageTarget |
getMessageTarget(String parameter,
Function<com.sap.cds.ql.StructuredType<?>,Object> path)
Creates a new
MessageTarget with a target, based on a target
parameter and a CQN path. |
MessageTarget |
getMessageTarget(String prefix,
String entity,
Function<com.sap.cds.ql.StructuredType<?>,Object> path)
Deprecated.
no longer supported, use
getMessageTarget(String, Class, Function)
instead |
String getMessage(String code, Object[] args)
code
may either be a SL4J-message format or a bundle key.
The JVM's default locale is taken to lookup code in resource bundles.code
- The used codeargs
- The arguments for message formats.String getLocalizedMessage(String code, Object[] args, Locale locale)
code
may either be a SL4J-message format or a bundle key.
The specified locale is taken to lookup the code in resource bundles.
If the specified locale is null
the locale provided of the current RequestContext
is usedcode
- The used codeargs
- The arguments for message formats.locale
- The localeMessageTarget getMessageTarget(String target)
MessageTarget
with a string-based targettarget
- the string-based targetMessageTarget
MessageTarget getMessageTarget(String parameter, Function<com.sap.cds.ql.StructuredType<?>,Object> path)
MessageTarget
with a target, based on a target
parameter and a CQN path.parameter
- target parameter serving as the entry point for the
path resolutionpath
- the path to the targetMessageTarget
@Deprecated MessageTarget getMessageTarget(String prefix, String entity, Function<com.sap.cds.ql.StructuredType<?>,Object> path)
getMessageTarget(String, Class, Function)
insteadMessageTarget
with a target, based on a CQN path and a
string-based prefixprefix
- the string-based prefix, prepended to the CQN pathentity
- the root entity of the pathpath
- the path to the targetMessageTarget
<E extends com.sap.cds.ql.StructuredType<E>> MessageTarget getMessageTarget(String parameter, Class<E> type, Function<E,Object> path)
MessageTarget
with a target, based on a target
parameter and a CQN path.E
- the entity typeparameter
- target parameter serving as the entry point for the
path resolutiontype
- the root type of the path. Either an entity or a
structured type.path
- the path to the targetMessageTarget
MessageTarget getMessageTarget(com.sap.cds.ql.cqn.Path path, com.sap.cds.reflect.CdsElement element)
path
- the cqn path to the targeted cds elementelement
- the targeted elementMessageTarget
CdsProperties.Errors getErrorsProperties()
CdsProperties.Errors
propertiesCopyright © 2022. All rights reserved.