javax.time.calendar
Class CalendricalRuleException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.time.CalendricalException
                  extended by javax.time.calendar.CalendricalRuleException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CalendricalPrintException, IllegalCalendarFieldValueException, InvalidCalendarFieldException

public class CalendricalRuleException
extends CalendricalException

An exception used when an exception is connected to a specified rule.

Many aspects of calendrical processing are rule based. When a rule is the trigger for an exception, the rule field should be populated.

Author:
Stephen Colebourne
See Also:
Serialized Form

Constructor Summary
CalendricalRuleException(java.lang.String message, CalendricalRule<?> rule)
          Constructs a new exception with a message and optional rule.
CalendricalRuleException(java.lang.String message, CalendricalRule<?> rule, java.lang.Throwable cause)
          Constructs a new exception with a message and optional rule.
 
Method Summary
 CalendricalRule<?> getRule()
          Gets the rule that is connected to the exception.
 
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
 

Constructor Detail

CalendricalRuleException

public CalendricalRuleException(java.lang.String message,
                                CalendricalRule<?> rule)
Constructs a new exception with a message and optional rule.

Parameters:
message - the message describing the problem, should not be null
rule - the rule that caused the exception, null if not caused by a specific rule

CalendricalRuleException

public CalendricalRuleException(java.lang.String message,
                                CalendricalRule<?> rule,
                                java.lang.Throwable cause)
Constructs a new exception with a message and optional rule.

Parameters:
message - the message describing the problem, should not be null
rule - the rule that caused the exception, null if not caused by a specific rule
cause - the cause of the exception, may be null
Method Detail

getRule

public CalendricalRule<?> getRule()
Gets the rule that is connected to the exception.

Returns:
the rule, null if unknown