org.eclipse.wst.validation
Class MessageSeveritySetting

java.lang.Object
  extended by org.eclipse.wst.validation.MessageSeveritySetting

public class MessageSeveritySetting
extends java.lang.Object

Associate a message severity with a message category.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Nested Class Summary
static class MessageSeveritySetting.Severity
           
 
Constructor Summary
MessageSeveritySetting(java.lang.String id, java.lang.String label, MessageSeveritySetting.Severity defaultSeverity)
          Create an association between a label and a message severity.
 
Method Summary
 MessageSeveritySetting copy()
          Answer a copy of this object.
 MessageSeveritySetting.Severity getCurrent()
          Answer the current severity for the message.
 MessageSeveritySetting.Severity getDefault()
          Answer the default severity as defined by the validator owner.
 java.lang.String getId()
          The id that the validator owner assigned to the message.
 java.lang.String getLabel()
           
 int hashCode()
           
 boolean setCurrent(MessageSeveritySetting.Severity severity)
          Set the current message severity.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageSeveritySetting

public MessageSeveritySetting(java.lang.String id,
                              java.lang.String label,
                              MessageSeveritySetting.Severity defaultSeverity)
Create an association between a label and a message severity.

Parameters:
id - An id that is used to identify this particular setting. This must be unique within the scope of this particular validator.
label - An end user string, that can describe either an individual message or a message category.
defaultSeverity - The default severity for this label. If the end user doesn't change anything this is what the severity will be.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getLabel

public java.lang.String getLabel()

getDefault

public MessageSeveritySetting.Severity getDefault()
Answer the default severity as defined by the validator owner.


getCurrent

public MessageSeveritySetting.Severity getCurrent()
Answer the current severity for the message. The end user may have changed this through a preference dialog.


getId

public java.lang.String getId()
The id that the validator owner assigned to the message.


setCurrent

public boolean setCurrent(MessageSeveritySetting.Severity severity)
Set the current message severity.

Parameters:
severity -
Returns:
true if the setting changed

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

copy

public MessageSeveritySetting copy()
Answer a copy of this object.