Class TestEngineMessageResolver
- All Implemented Interfaces:
IMessageResolver
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAbsentMessageRepresentation(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) Create a suitable representation of an absent message (a message that could not be resolved).resolveMessage(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) Resolve the message, returning the requested message (ornullif not found).Methods inherited from class org.thymeleaf.messageresolver.AbstractMessageResolver
getName, getOrder, setName, setOrder
-
Field Details
-
standardMessageResolver
-
-
Constructor Details
-
TestEngineMessageResolver
public TestEngineMessageResolver()
-
-
Method Details
-
resolveMessage
public String resolveMessage(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) Description copied from interface:IMessageResolverResolve the message, returning the requested message (or
nullif not found).Message resolvers should perform resolution of the
key+messageParameterspair based on thecontextandoriginspecified. The context will provide information about the template and the (optional)originabout the point in template execution from which the message is being requested (usually anIProcessoror theMessageExpressionclass).- Parameters:
context- theITemplateContextobject being used for template processing. Can be null.origin- the origin of the message request, usually a processor or expression class. Can be null.key- the message key.messageParameters- the (optional) message parameters.- Returns:
- the resolved message, or
nullif the message could not be resolved.
-
createAbsentMessageRepresentation
public String createAbsentMessageRepresentation(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) Description copied from interface:IMessageResolverCreate a suitable representation of an absent message (a message that could not be resolved).
Once the entire chain of configured
IMessageResolverobjects is asked for a specific message and all of them returnnull, the engine will call this method on the first resolver in the chain. If the first resolver returnsnullas a representation, the following resolver will be called, and so on until a resolver returns a non-null result. The empty String will be used if all resolvers return null.- Parameters:
context- theITemplateContextobject being used for template processing. Can be null.origin- the origin of the message request, usually a processor or expression class. Can be null.key- the message key.messageParameters- the (optional) message parameters.- Returns:
- the absent message representation, of
nullif the resolver cannot create such representation.
-