org.objectweb.fractal.adl.error
Class ErrorTemplateValidator

java.lang.Object
  extended by org.objectweb.fractal.adl.error.ErrorTemplateValidator

public final class ErrorTemplateValidator
extends java.lang.Object

Helper class that provides static methods to validate ErrorTemplate. In particular it checks that each ErrorTemplate has a unique groupId, errorId pair. These methods can be used in ErrorTemplate constructors in an assertion statement.


Method Summary
static boolean validErrorEnum(java.lang.Class<? extends java.lang.Enum<?>> enumClass)
          Returns true if the given enumeration class is valid.
static boolean validErrorTemplate(ErrorTemplate template)
          Validates that the given template has a unique groupId, errorId pair.
static boolean validErrorTemplate(ErrorTemplate template, java.lang.Object... args)
          Validates the given ErrorTemplate and checks that itf format is valid with the given args (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

validErrorEnum

public static boolean validErrorEnum(java.lang.Class<? extends java.lang.Enum<?>> enumClass)
Returns true if the given enumeration class is valid.

Parameters:
enumClass - an enumeration class. This class must implement ErrorTemplate.
Returns:
true if the given enumeration class is valid.
See Also:
validErrorTemplate(ErrorTemplate)

validErrorTemplate

public static boolean validErrorTemplate(ErrorTemplate template,
                                         java.lang.Object... args)
Validates the given ErrorTemplate and checks that itf format is valid with the given args (i.e. checks that template.getFormatedMessage(args) do not throw a IllegalFormatException).

Parameters:
template - a template.
args - the format arguments.
Returns:
true if the given ErrorTemplate is valid.
See Also:
validErrorTemplate(ErrorTemplate)

validErrorTemplate

public static boolean validErrorTemplate(ErrorTemplate template)
Validates that the given template has a unique groupId, errorId pair.

Parameters:
template - a template.
Returns:
true if the given ErrorTemplate is valid.


Copyright © 2001-2010 ObjectWeb Consortium. All Rights Reserved.