JBoss Logging I18n Tools 1.0.0.Beta7

org.jboss.logging.validation
Class ValidationErrorMessage

java.lang.Object
  extended by org.jboss.logging.validation.ValidationErrorMessage
All Implemented Interfaces:
ValidationMessage

public class ValidationErrorMessage
extends Object
implements ValidationMessage

A message that contains information about the validation error.

The message is message to print and the element was the element that caused the error.

Author:
Kevin Pollet - SERLI - (kevin.pollet@serli.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.logging.validation.ValidationMessage
ValidationMessage.MessageType
 
Constructor Summary
ValidationErrorMessage(Element element, String message)
          Class constructor.
 
Method Summary
 boolean equals(Object obj)
           
 Element getElement()
          Returns the element that caused the error.
 String getMessage()
          Returns the error message.
 int hashCode()
           
static ValidationErrorMessage of(Element element, String message)
          Creates a new validation error message.
static ValidationErrorMessage of(Element element, String messageFormat, Object... args)
          Creates a new formatted validation error message.
 String toString()
           
 ValidationMessage.MessageType type()
          The type of the message.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationErrorMessage

public ValidationErrorMessage(Element element,
                              String message)
Class constructor.

Parameters:
element - the element that caused the error.
message - the error message.
Method Detail

of

public static ValidationErrorMessage of(Element element,
                                        String message)
Creates a new validation error message.

Parameters:
element - the element to create the message for.
message - the message for the error.
Returns:
a new validation error message.

of

public static ValidationErrorMessage of(Element element,
                                        String messageFormat,
                                        Object... args)
Creates a new formatted validation error message.

Parameters:
element - the element to create the message for.
messageFormat - the message format.
args - the replacement arguments for String.format(java.lang.String, java.lang.Object[]).
Returns:
a new validation error message.

type

public ValidationMessage.MessageType type()
Description copied from interface: ValidationMessage
The type of the message.

Specified by:
type in interface ValidationMessage
Returns:
the type of the message.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getElement

public Element getElement()
Description copied from interface: ValidationMessage
Returns the element that caused the error.

Specified by:
getElement in interface ValidationMessage
Returns:
the element that caused the error.

getMessage

public String getMessage()
Description copied from interface: ValidationMessage
Returns the error message.

Specified by:
getMessage in interface ValidationMessage
Returns:
the error message.

JBoss Logging I18n Tools 1.0.0.Beta7

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.