Class Messages
java.lang.Object
org.ctan.site.services.upload.util.Messages
This class is a container for messages. The messages may have the type
ERROR
, WARNING
, or INFO
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
The fieldserialVersionUID
contains the version number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method adds an error message with the given parameters.static Messages
errorMessage
(String... msg) The methoderrorMessage
provides means to create a new Messages instance populated with an error.errorOrWarning
(String... msg) This method adds an error message with the given parameters.boolean
The methodhasErrors
returns the indicator whether the messages contain at least one error message.This method adds an info message with the given parameters.void
infoMode()
The methodinfoMode
provides means to switch to info mode.iterator()
int
size()
The methodsize
provides means to get the number of messages.toHtml()
The methodtoHtml
provides means to format the messages as HTML.toString()
toText()
The methodtoText
provides means to format the messages as text.This method adds a warning message with the given parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
serialVersionUID
public static final long serialVersionUIDThe fieldserialVersionUID
contains the version number.- See Also:
-
-
Constructor Details
-
Messages
public Messages()
-
-
Method Details
-
errorMessage
The methoderrorMessage
provides means to create a new Messages instance populated with an error.- Parameters:
msg
- the error attributes- Returns:
- a new Messages
-
error
This method adds an error message with the given parameters.- Parameters:
msg
- the parameters- Returns:
- this
-
errorOrWarning
This method adds an error message with the given parameters.- Parameters:
msg
- the parameters- Returns:
- this
-
hasErrors
public boolean hasErrors()The methodhasErrors
returns the indicator whether the messages contain at least one error message.- Returns:
- the indicator whether errors are contained
-
info
This method adds an info message with the given parameters.- Parameters:
msg
- the parameters- Returns:
- this
-
infoMode
public void infoMode()The methodinfoMode
provides means to switch to info mode. -
iterator
-
size
public int size()The methodsize
provides means to get the number of messages.- Returns:
- the number of messages
-
toHtml
The methodtoHtml
provides means to format the messages as HTML.- Returns:
- the formatted messages
-
toString
-
toText
The methodtoText
provides means to format the messages as text.- Returns:
- the formatted messages
-
warning
This method adds a warning message with the given parameters.- Parameters:
msg
- the parameters- Returns:
- this
-