com.atlassian.scheduler.cron
Class CronSyntaxException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.atlassian.scheduler.SchedulerServiceException
              extended by com.atlassian.scheduler.cron.CronSyntaxException
All Implemented Interfaces:
Serializable

public class CronSyntaxException
extends SchedulerServiceException

Signals that there is a syntax error in a given cron expression.

Since:
v1.4
See Also:
Serialized Form

Nested Class Summary
static class CronSyntaxException.Builder
          A builder for constructing a CronSyntaxException.
 
Method Summary
static CronSyntaxException.Builder builder()
          Returns a builder for constructing a CronSyntaxExpression.
 String getCronExpression()
          Returns the cron expression that could not be parsed.
 ErrorCode getErrorCode()
          Returns the error code identifying the underlying cause of the parse failure.
 int getErrorOffset()
          Returns the 0-based index of the character at which the parse error was identified.
 String getValue()
          Returns the value that caused the exception to be thrown, if that information is available.
 
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
 

Method Detail

getErrorCode

@Nonnull
public ErrorCode getErrorCode()
Returns the error code identifying the underlying cause of the parse failure.

Returns:
the error code identifying the underlying cause of the parse failure.

getCronExpression

@Nonnull
public String getCronExpression()
Returns the cron expression that could not be parsed.

Returns:
the cron expression that could not be parsed.

getValue

@Nullable
public String getValue()
Returns the value that caused the exception to be thrown, if that information is available. For example, if the day-of-month field specified 4,10-13,42-47, then the value would be "42" because 31 is the maximum value permitted for that field.

Returns:
the value that caused the exception to be thrown, or null if that is irrelevant to the error or if the cause is unknown

getErrorOffset

public int getErrorOffset()
Returns the 0-based index of the character at which the parse error was identified.

Returns:
the 0-based index of the character at which the parse error was identified, or -1 if the index is not known.

builder

public static CronSyntaxException.Builder builder()
Returns a builder for constructing a CronSyntaxExpression.

Returns:
a builder for constructing a CronSyntaxExpression.


Copyright © 2015 Atlassian. All rights reserved.