net.sf.qualitycheck.exception
Class IllegalPatternArgumentException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.qualitycheck.exception.IllegalPatternArgumentException
All Implemented Interfaces:
Serializable

public class IllegalPatternArgumentException
extends RuntimeException

Thrown to indicate that a method has been passed a sequence of char values as argument that does not matches against the specified pattern. For example, if a method needs a string with a exactly four alphanumeric characters and is passed with a five characters long string.

Author:
André Rouél, Dominik Seichter
See Also:
Serialized Form

Field Summary
protected static String DEFAULT_MESSAGE
          Default message to indicate that the a given argument must match against the specified pattern.
protected static String MESSAGE_WITH_NAME
          Message to indicate that the the given argument with name must match against the specified pattern.
protected static String NO_PATTERN_PLACEHOLDER
          Placeholder for an unset pattern to format a message human readable
 
Constructor Summary
IllegalPatternArgumentException(Pattern pattern)
          Constructs an IllegalNullArgumentException with the default message DEFAULT_MESSAGE including the pattern which the argument must match.
IllegalPatternArgumentException(Pattern pattern, Throwable cause)
          Constructs a new exception with the default message DEFAULT_MESSAGE including the pattern which the argument must match.
IllegalPatternArgumentException(String argumentName, Pattern pattern)
          Constructs an IllegalNullArgumentException with the message MESSAGE_WITH_NAME including the given name of the argument as string representation and pattern which the argument must match.
IllegalPatternArgumentException(String argumentName, Pattern pattern, Throwable cause)
          Constructs a new exception with the message MESSAGE_WITH_NAME including the given name as string representation, the pattern which the argument must match and cause.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MESSAGE

protected static final String DEFAULT_MESSAGE
Default message to indicate that the a given argument must match against the specified pattern.

See Also:
Constant Field Values

MESSAGE_WITH_NAME

protected static final String MESSAGE_WITH_NAME
Message to indicate that the the given argument with name must match against the specified pattern.

See Also:
Constant Field Values

NO_PATTERN_PLACEHOLDER

protected static final String NO_PATTERN_PLACEHOLDER
Placeholder for an unset pattern to format a message human readable

See Also:
Constant Field Values
Constructor Detail

IllegalPatternArgumentException

public IllegalPatternArgumentException(@Nullable
                                       Pattern pattern)
Constructs an IllegalNullArgumentException with the default message DEFAULT_MESSAGE including the pattern which the argument must match.

Parameters:
pattern - Pattern, that a string or character sequence should correspond to

IllegalPatternArgumentException

public IllegalPatternArgumentException(@Nullable
                                       Pattern pattern,
                                       @Nullable
                                       Throwable cause)
Constructs a new exception with the default message DEFAULT_MESSAGE including the pattern which the argument must match.

Parameters:
pattern - Pattern, that a string or character sequence should correspond to
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

IllegalPatternArgumentException

public IllegalPatternArgumentException(@Nullable
                                       String argumentName,
                                       @Nullable
                                       Pattern pattern)
Constructs an IllegalNullArgumentException with the message MESSAGE_WITH_NAME including the given name of the argument as string representation and pattern which the argument must match.

Parameters:
argumentName - the name of the passed argument
pattern - Pattern, that a string or character sequence should correspond to

IllegalPatternArgumentException

public IllegalPatternArgumentException(@Nullable
                                       String argumentName,
                                       @Nullable
                                       Pattern pattern,
                                       @Nullable
                                       Throwable cause)
Constructs a new exception with the message MESSAGE_WITH_NAME including the given name as string representation, the pattern which the argument must match and cause.

Parameters:
argumentName - the name of the passed argument
pattern - Pattern, that a string or character sequence should correspond to
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)


Copyright © 2012-2013. All Rights Reserved.