public class UIMessage extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
UIMessage(NodeBase errorNode,
String errorLocation,
MsgType type,
BundleRef br,
String code,
Object[] parameters)
Create an error message container.
|
protected |
UIMessage(NodeBase errorNode,
String errorLocation,
MsgType type,
BundleRef br,
String code,
Object[] parameters,
String group) |
| Modifier and Type | Method and Description |
|---|---|
static UIMessage |
create(NodeBase n,
ProblemInstance pi) |
boolean |
equals(Object obj) |
static UIMessage |
error(BundleRef ref,
String code,
Object... param) |
static UIMessage |
error(CodeException x) |
static UIMessage |
error(NodeBase node,
BundleRef ref,
String code,
Object... param) |
static UIMessage |
error(NodeBase node,
String errorLocation,
BundleRef ref,
String code,
Object... param) |
static UIMessage |
error(String errorLocation,
BundleRef ref,
String code,
Object... param) |
static UIMessage |
error(UIException x) |
BundleRef |
getBundle()
Returns the message bundle the code is in, or null if the code is a global message code (deprecated).
|
String |
getCode() |
String |
getErrorLocation()
When set this is used in error messages as an indication of which input field contains the
error.
|
NodeBase |
getErrorNode() |
String |
getGroup() |
String |
getMessage()
Returns the message part of the error message, properly localized for the request's locale.
|
String |
getMessageKey()
Return a unique key for the message as "bundle name" '#' "code".
|
Object[] |
getParameters() |
MsgType |
getType() |
UIMessage |
group(String name) |
int |
hashCode() |
static UIMessage |
info(BundleRef ref,
String code,
Object... param) |
UIMessage |
location(String errorLocation)
Chaining setter for setErrorLocation.
|
void |
setErrorLocation(String errorLocation) |
void |
setErrorNode(NodeBase errorNode) |
String |
toString() |
static UIMessage |
warning(BundleRef ref,
String code,
Object... param) |
static UIMessage |
warning(NodeBase node,
BundleRef ref,
String code,
Object... param) |
static UIMessage |
warning(NodeBase node,
String errorLocation,
BundleRef ref,
String code,
Object... param) |
protected UIMessage(@Nullable NodeBase errorNode, @Nullable String errorLocation, @Nonnull MsgType type, @Nonnull BundleRef br, @Nonnull String code, @Nullable Object[] parameters)
errorNode - If not-null this is the node that "owns" the error. This node will show a visual indication of the fact that it contains an error.errorLocation - If not-null this is a user-understandable name of the input item that contains the error. It usually is the "label" associated with the problem.type - The type of message: error, warning or info.br - The bundle containing the message for the code. If this is null (deprecated) the "global bundle set" is used *WHICH IS DEPRECATED*.code - The code for the message.parameters - If needed a set of parameters to render into the message.public String getMessageKey()
public String getCode()
@Nullable public BundleRef getBundle()
@Nullable public String getErrorLocation()
public void setErrorLocation(String errorLocation)
@Nonnull public UIMessage location(@Nullable String errorLocation)
errorLocation - @Nonnull public String getMessage()
@Nonnull public static UIMessage error(@Nonnull CodeException x)
@Nonnull public static UIMessage error(@Nonnull UIException x)
@Nonnull public static UIMessage error(NodeBase node, String errorLocation, @Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage error(String errorLocation, @Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage error(NodeBase node, @Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage error(@Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage warning(NodeBase node, String errorLocation, @Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage warning(NodeBase node, @Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage warning(@Nonnull BundleRef ref, @Nonnull String code, Object... param)
@Nonnull public static UIMessage info(@Nonnull BundleRef ref, @Nonnull String code, Object... param)
Copyright © 2017 etc.to. All rights reserved.