Constructor
new Message(summary, detail, severity)
Constructs a message object
.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
summary |
string | Localized summary message text | |
detail |
string | Localized detail message text | |
severity |
number | string |
<optional> |
An optional severity for this message. Use constants oj.Message.SEVERITY_LEVEL for number types and oj.Message.SEVERITY_TYPE for string types. Default is SEVERITY_ERROR if no severity is specified |
- Source:
Fields
-
<static> SEVERITY_LEVEL :number
-
Message severity level
- Source:
Properties:
Name Type Default FATAL
number 5 ERROR
number 4 WARNING
number 3 INFO
number 2 CONFIRMATION
number 1 -
<static> SEVERITY_TYPE :string
-
Indicates the type of severity that the message represents.
- Source:
Properties:
Name Type Default Description CONFIRMATION
string confirmation Indicates a confirmation that an operation or task was completed. This is the lowest severity level. INFO
string info Indicates information or operation messages. This has a lower severity level than warning. WARNING
string warning Indicates an application condition or situation that might require users' attention. This has a lower severity than error. ERROR
string error Used when data inaccuracies occur when completing a field and that needs fixing before user can continue. This has a lower severity level than fatal. fatal. FATAL
string fatal Used when a critical application error or an unknown failure occurs. This is the highest severity level. -
detail :string
-
Localized detail text.
- Default Value:
""
- Source:
-
severity :string
-
Severity type of message. See oj.Message.SEVERITY_TYPE.
- Default Value:
oj.Message.SEVERITY_TYPE.ERROR
- Source:
-
summary :string
-
Localized summary text.
- Default Value:
""
- Source:
Methods
-
<static> getMaxSeverity(messages) → {number}
-
Returns the max severity level in a array of message objects.
Parameters:
Name Type Description messages
Array an array of message instances - Source:
Returns:
-1 if none can be determined; otherwise a severity level as defined by oj.Message.SEVERITY_LEVEL.- Type
- number
-
<static> getSeverityLevel(severity) → {number}
-
A convenience method that returns the severity level when given either a severity level of type number or a severity type of string. If severity level is not provided or is not valid this returns a severity error.
Parameters:
Name Type Description severity
string | number | undefined - Source:
Returns:
- Type
- number
-
<static> getSeverityType(level) → {string}
-
A convenience method that returns the severity type when given either a severity level of type number or a severity type of string. If severity level is not provided or is not valid this return a severity error.
Parameters:
Name Type Description level
string | number | undefined - Source:
Returns:
- Type
- string
-
<static> isValid(messages) → {boolean}
-
Returns false if messages are of severity error or greater.
Parameters:
Name Type Description messages
Array an array of message instances - Source:
Returns:
true if none of the messages are of severity error or greater. false otherwise- Type
- boolean
-
clone() → {Object}
-
Returns an Object that is a clone of this message.
- Since:
- 0.7
- Source:
Returns:
instance of oj.Message- Type
- Object
-
equals(msg)
-
Indicates whether some other oj.Message instance - msg, is "equal to" this one. Method is equivalent to java ".equals()" method.
Parameters:
Name Type Description msg
Object - Source:
-
Init(summary, detail, severity)
-
Initializes Message instance with the set options
Parameters:
Name Type Argument Description summary
string a localized summary message text detail
string a localized detail message text severity
number | string <optional>
An optional severity for this message. Use constants oj.Message.SEVERITY_LEVEL for number types and oj.Message.SEVERITY_TYPE for string types. - Source: