Package org.apache.wicket.feedback
Class FeedbackMessage
- java.lang.Object
-
- org.apache.wicket.feedback.FeedbackMessage
-
- All Implemented Interfaces:
java.io.Serializable,IDetachable,org.apache.wicket.util.io.IClusterable
public class FeedbackMessage extends java.lang.Object implements IDetachable
Represents a generic message meant for the end-user/ pages.- Author:
- Eelco Hillenius, Jonathan Locke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intDEBUGConstant for debug level.static java.lang.StringDEBUG_CSS_CLASS_KEYstatic intERRORConstant for error level.static java.lang.StringERROR_CSS_CLASS_KEYstatic intFATALConstant for fatal level.static java.lang.StringFATAL_CSS_CLASS_KEYstatic intINFOConstant for info level.static java.lang.StringINFO_CSS_CLASS_KEYstatic intSUCCESSConstant for success level (it indicates the outcome of an operation)static java.lang.StringSUCCESS_CSS_CLASS_KEYstatic intUNDEFINEDConstant for an undefined level; note that components might decide not to render anything when this level is used.static java.lang.StringUNDEFINED_CSS_CLASS_KEYstatic intWARNINGConstant for warning level.static java.lang.StringWARNING_CSS_CLASS_KEY
-
Constructor Summary
Constructors Constructor Description FeedbackMessage(Component reporter, java.io.Serializable message, int level)Construct using fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddetach()Detaches model after use.intgetLevel()Gets the message level; can be used by rendering components.java.lang.StringgetLevelAsString()Gets the current level as a Stringjava.io.SerializablegetMessage()Gets the actual message.ComponentgetReporter()Gets the reporting component.booleanisDebug()Gets whether the current level is DEBUG or up.booleanisError()Gets whether the current level is ERROR or up.booleanisFatal()Gets whether the current level is FATAL or up.booleanisInfo()Gets whether the current level is INFO or up.booleanisLevel(int level)Returns whether this level is greater than or equal to the given level.booleanisRendered()Gets whether or not this message has been renderedbooleanisSuccess()Gets whether the current level is SUCCESS or up.booleanisUndefined()Gets whether the current level is UNDEFINED.booleanisWarning()Gets whether the current level is WARNING or up.voidmarkRendered()Marks this message as rendered.java.lang.StringtoString()
-
-
-
Field Detail
-
UNDEFINED_CSS_CLASS_KEY
public static final java.lang.String UNDEFINED_CSS_CLASS_KEY
-
DEBUG_CSS_CLASS_KEY
public static final java.lang.String DEBUG_CSS_CLASS_KEY
-
INFO_CSS_CLASS_KEY
public static final java.lang.String INFO_CSS_CLASS_KEY
-
SUCCESS_CSS_CLASS_KEY
public static final java.lang.String SUCCESS_CSS_CLASS_KEY
-
WARNING_CSS_CLASS_KEY
public static final java.lang.String WARNING_CSS_CLASS_KEY
-
ERROR_CSS_CLASS_KEY
public static final java.lang.String ERROR_CSS_CLASS_KEY
-
FATAL_CSS_CLASS_KEY
public static final java.lang.String FATAL_CSS_CLASS_KEY
-
UNDEFINED
public static final int UNDEFINED
Constant for an undefined level; note that components might decide not to render anything when this level is used.- See Also:
- Constant Field Values
-
DEBUG
public static final int DEBUG
Constant for debug level.- See Also:
- Constant Field Values
-
INFO
public static final int INFO
Constant for info level.- See Also:
- Constant Field Values
-
SUCCESS
public static final int SUCCESS
Constant for success level (it indicates the outcome of an operation)- See Also:
- Constant Field Values
-
WARNING
public static final int WARNING
Constant for warning level.- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
Constant for error level.- See Also:
- Constant Field Values
-
FATAL
public static final int FATAL
Constant for fatal level.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FeedbackMessage
public FeedbackMessage(Component reporter, java.io.Serializable message, int level)
Construct using fields.- Parameters:
reporter- The message reportermessage- The actual message. Must not benull.level- The level of the message
-
-
Method Detail
-
isRendered
public final boolean isRendered()
Gets whether or not this message has been rendered- Returns:
- true if this message has been rendered, false otherwise
-
markRendered
public final void markRendered()
Marks this message as rendered.
-
getLevel
public final int getLevel()
Gets the message level; can be used by rendering components. Note that what actually happens with the level indication is totally up to the components that render feedback messages.- Returns:
- The message level indicator.
-
getLevelAsString
public java.lang.String getLevelAsString()
Gets the current level as a String- Returns:
- The current level as a String
-
getMessage
public final java.io.Serializable getMessage()
Gets the actual message.- Returns:
- the message.
-
getReporter
public final Component getReporter()
Gets the reporting component.- Returns:
- the reporting component.
-
isDebug
public final boolean isDebug()
Gets whether the current level is DEBUG or up.- Returns:
- whether the current level is DEBUG or up.
-
isInfo
public final boolean isInfo()
Gets whether the current level is INFO or up.- Returns:
- whether the current level is INFO or up.
-
isSuccess
public final boolean isSuccess()
Gets whether the current level is SUCCESS or up.- Returns:
- whether the current level is SUCCESS or up.
-
isWarning
public final boolean isWarning()
Gets whether the current level is WARNING or up.- Returns:
- whether the current level is WARNING or up.
-
isError
public final boolean isError()
Gets whether the current level is ERROR or up.- Returns:
- whether the current level is ERROR or up.
-
isFatal
public final boolean isFatal()
Gets whether the current level is FATAL or up.- Returns:
- whether the current level is FATAL or up.
-
isLevel
public final boolean isLevel(int level)
Returns whether this level is greater than or equal to the given level.- Parameters:
level- the level- Returns:
- whether this level is greater than or equal to the given level
-
isUndefined
public final boolean isUndefined()
Gets whether the current level is UNDEFINED.- Returns:
- whether the current level is UNDEFINED.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
detach
public void detach()
Description copied from interface:IDetachableDetaches model after use. This is generally used to null out transient references that can be re-attached later.- Specified by:
detachin interfaceIDetachable
-
-