caltool.schedule
Class ScheduleEventPrecondViolation

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by caltool.schedule.ScheduleEventPrecondViolation
All Implemented Interfaces:
PrecondViolation, java.io.Serializable

public class ScheduleEventPrecondViolation
extends java.lang.Exception
implements PrecondViolation

Class ScheduleEventPrecondViolation defines and exception containing error conditions for the Schedule.scheduleEvent method. It contains a list of the specific error messages that may be output in response to a precondition having been violated by a call th scheduleEvent.

See Also:
Serialized Form

Field Summary
protected  java.lang.String alreadyScheduledMessage
          Error message for event of same date,title already scheduled
protected  java.lang.String emptyTitleMessage
          Error message for empty title
protected  java.util.ArrayList errors
          List of current error messages
protected  java.lang.String invalidEndDateMessage
          Error message for invalid end date
protected  java.lang.String invalidStartDateMessage
          Error message for invalid start date
protected  java.lang.String noActiveCalendarMessage
          Error message for no currently active calendar in the workspace
protected  int numErrors
          Error message count
 
Constructor Summary
ScheduleEventPrecondViolation()
          Construct this by initializing the error message list to an empty list, initializing the numErrors count to 0, and initializing local copies of the error message text for each of the possible errors from Schedule.scheduleEvent.
 
Method Summary
 boolean anyErrors()
          Return true if any errors have been set.
 void clear()
          Clear all error messages.
 java.lang.String[] getErrors()
          Return the error list.
 int numberOfErrors()
          Return the number of errors.
 void setAlreadyScheduledError()
          Set the already scheduled error message.
 void setEmptyTitleError()
          Set the empty title error message.
 void setInvalidEndDateError()
          Set the invalid end date error message.
 void setInvalidStartDateError()
          Set the invalid start date error message.
 void setNoActiveCalendarError()
          Set the no active calendar error message.
 
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

errors

protected java.util.ArrayList errors
List of current error messages


numErrors

protected int numErrors
Error message count


emptyTitleMessage

protected java.lang.String emptyTitleMessage
Error message for empty title


alreadyScheduledMessage

protected java.lang.String alreadyScheduledMessage
Error message for event of same date,title already scheduled


invalidStartDateMessage

protected java.lang.String invalidStartDateMessage
Error message for invalid start date


invalidEndDateMessage

protected java.lang.String invalidEndDateMessage
Error message for invalid end date


noActiveCalendarMessage

protected java.lang.String noActiveCalendarMessage
Error message for no currently active calendar in the workspace

Constructor Detail

ScheduleEventPrecondViolation

public ScheduleEventPrecondViolation()
Construct this by initializing the error message list to an empty list, initializing the numErrors count to 0, and initializing local copies of the error message text for each of the possible errors from Schedule.scheduleEvent.

Method Detail

getErrors

public java.lang.String[] getErrors()
Return the error list.

Specified by:
getErrors in interface PrecondViolation

clear

public void clear()
Clear all error messages.

Specified by:
clear in interface PrecondViolation

anyErrors

public boolean anyErrors()
Return true if any errors have been set.

Specified by:
anyErrors in interface PrecondViolation

numberOfErrors

public int numberOfErrors()
Return the number of errors.

Specified by:
numberOfErrors in interface PrecondViolation

setEmptyTitleError

public void setEmptyTitleError()
Set the empty title error message.


setAlreadyScheduledError

public void setAlreadyScheduledError()
Set the already scheduled error message.


setInvalidStartDateError

public void setInvalidStartDateError()
Set the invalid start date error message.


setInvalidEndDateError

public void setInvalidEndDateError()
Set the invalid end date error message.


setNoActiveCalendarError

public void setNoActiveCalendarError()
Set the no active calendar error message.