com.atlassian.scheduler.cron
Enum ErrorCode

java.lang.Object
  extended by java.lang.Enum<ErrorCode>
      extended by com.atlassian.scheduler.cron.ErrorCode
All Implemented Interfaces:
Serializable, Comparable<ErrorCode>

public enum ErrorCode
extends Enum<ErrorCode>

Clarifies the reason for failure when a cron expression cannot be parsed.

Since:
v1.4

Enum Constant Summary
COMMA_WITH_LAST_DOM
          The cron expression used multiple expressions for the day-of-month, at least one of which used the L flag.
COMMA_WITH_LAST_DOW
          The cron expression used multiple expressions for the day-of-week, at least one of which used the L flag.
COMMA_WITH_NTH_DOW
          The cron expression used multiple expressions for the day-of-week, at least one of which used the # flag.
COMMA_WITH_WEEKDAY_DOM
          The cron expression used multiple expressions for the day-of-month, at least one of which used the W flag.
ILLEGAL_CHARACTER
          The cron expression contained a character that is not legal in the cron expression syntax.
ILLEGAL_CHARACTER_AFTER_HASH
          The cron expression contained a hash (#) in the day-of-week column that was not followed by an integer value from 1 to 5.
ILLEGAL_CHARACTER_AFTER_INTERVAL
          The cron expression contained a step interval (a value after /) that was followed by additional characters in the same field expression.
ILLEGAL_CHARACTER_AFTER_QM
          The cron expression contained a question-mark (?) followed by another non-whitespace character.
INTERNAL_PARSER_FAILURE
          The reason of the failure could not be determined.
INVALID_NAME
          The cron expression contained a sequence of letters that appears to be meant as the name of a month or day-of-week, but it was malformed.
INVALID_NAME_DAY_OF_WEEK
          The cron expression contained a sequence of letters that appears to be meant as the name of a day-of-week, but the name was not recognized.
INVALID_NAME_FIELD
          The cron expression contained a sequence of letters that appears to be meant as the name of a month or day-of-week, but it was specified in one of the other fields.
INVALID_NAME_MONTH
          The cron expression contained a sequence of letters that appears to be meant as the name of a month, but the name was not recognized.
INVALID_NAME_RANGE
          The cron expression contained a sequence that appears to be meant as a name-based range of a month or day-of-week values, but the end value of the sequence was malformed.
INVALID_NUMBER_DAY_OF_MONTH
          The cron expression contained a number in the day-of-month field that was outside the supported range of [0, 31].
INVALID_NUMBER_DAY_OF_MONTH_OFFSET
          The cron expression contained an L-x or L-xW expression where the value of x was more than 30.
INVALID_NUMBER_DAY_OF_WEEK
          The cron expression contained a number in the day-of-week field that was outside the supported range of [1, 7].
INVALID_NUMBER_HOUR
          The cron expression contained a number in the hour field that was outside the supported range of [0, 23].
INVALID_NUMBER_MONTH
          The cron expression contained a number in the month field that was outside the supported range of [1, 12].
INVALID_NUMBER_SEC_OR_MIN
          The cron expression contained a number in the minute or second field that was outside the supported range of [0, 59].
INVALID_NUMBER_YEAR
          The cron expression contained a number in the year field that was outside the supported range of [1970, 2299].
INVALID_NUMBER_YEAR_RANGE
          The cron expression contains a range in the year field that gave the years in reverse order, such as 2036-2016.
INVALID_STEP
          The cron expression contained a slash (/) that was not followed by an integer value.
INVALID_STEP_DAY_OF_MONTH
          The cron expression contained an interval step for the day-of-month that was greater than or equal to 31.
INVALID_STEP_DAY_OF_WEEK
          The cron expression contained an interval step for the day-of-week that was greater than or equal to 7.
INVALID_STEP_HOUR
          The cron expression contained an interval step for the hour that was greater than or equal to 24.
INVALID_STEP_MONTH
          The cron expression contained an interval step for the month that was greater than or equal to 12.
INVALID_STEP_SECOND_OR_MINUTE
          The cron expression contained an interval step for the second or minute that was greater than or equal to 60.
QM_CANNOT_USE_FOR_BOTH_DAYS
          The cron expression contained a question-mark (?) for both the day-of-month and the day-of-week.
QM_CANNOT_USE_HERE
          The cron expression contained a question-mark (?) in some field other than the day-of-month or day-of-week.
QM_MUST_USE_FOR_ONE_OF_DAYS
          The cron expression specified values other than ? for both the day-of-month and the day-of-week.
UNEXPECTED_END_OF_EXPRESSION
          The cron expression ended without specifying all of the required fields or ended in a way that would require more characters.
UNEXPECTED_TOKEN_FLAG_L
          The cron expression contained what looks like an L flag, but it is in a column that does not support it or is not in a place that makes sense.
UNEXPECTED_TOKEN_FLAG_W
          The cron expression contained what looks like a W flag, but it is in a column that does not support it or is not in a place that makes sense.
UNEXPECTED_TOKEN_HASH
          The cron expression contained what looks like a # flag, but it is in a column that does not support it or is not in a place that makes sense.
UNEXPECTED_TOKEN_HYPHEN
          The cron expression contained an invalid hyphen (-).
 
Method Summary
 String toMessage(String value)
          Renders the standard message for this error code and offending value.
static ErrorCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ErrorCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

COMMA_WITH_LAST_DOM

public static final ErrorCode COMMA_WITH_LAST_DOM
The cron expression used multiple expressions for the day-of-month, at least one of which used the L flag. This is not supported; the L flag can only be used when a single expression is given.


COMMA_WITH_LAST_DOW

public static final ErrorCode COMMA_WITH_LAST_DOW
The cron expression used multiple expressions for the day-of-week, at least one of which used the L flag. This is not supported; the L flag can only be used when a single expression is given.


COMMA_WITH_NTH_DOW

public static final ErrorCode COMMA_WITH_NTH_DOW
The cron expression used multiple expressions for the day-of-week, at least one of which used the # flag. This is not supported; the # flag can only be used when a single expression is given.


COMMA_WITH_WEEKDAY_DOM

public static final ErrorCode COMMA_WITH_WEEKDAY_DOM
The cron expression used multiple expressions for the day-of-month, at least one of which used the W flag. This is not supported; the W flag can only be used when a single expression is given.


INTERNAL_PARSER_FAILURE

public static final ErrorCode INTERNAL_PARSER_FAILURE
The reason of the failure could not be determined. This indicates that the underlying cause is an unexpected runtime exception and indicates a programming error in the cron expression parsing. The value should be the message from cause.


ILLEGAL_CHARACTER

public static final ErrorCode ILLEGAL_CHARACTER
The cron expression contained a character that is not legal in the cron expression syntax. The value should be the illegal character that was encountered.


ILLEGAL_CHARACTER_AFTER_QM

public static final ErrorCode ILLEGAL_CHARACTER_AFTER_QM
The cron expression contained a question-mark (?) followed by another non-whitespace character. This special value can only be used by itself in the day-of-month or day-of-week field; it cannot be combined with any other value. The value should be the illegal character that was encountered.


ILLEGAL_CHARACTER_AFTER_HASH

public static final ErrorCode ILLEGAL_CHARACTER_AFTER_HASH
The cron expression contained a hash (#) in the day-of-week column that was not followed by an integer value from 1 to 5.


ILLEGAL_CHARACTER_AFTER_INTERVAL

public static final ErrorCode ILLEGAL_CHARACTER_AFTER_INTERVAL
The cron expression contained a step interval (a value after /) that was followed by additional characters in the same field expression. The step interval must be the last part of a value. The slash (/) must be followed by an integer. After that, the only legal characters are whitespace or a comma (,) to separate it from the next value for that field.


INVALID_STEP

public static final ErrorCode INVALID_STEP
The cron expression contained a slash (/) that was not followed by an integer value. A step interval value must be specified, such as /5 in the minutes column to indicate that the accept values are spaces five minutes apart.


INVALID_STEP_DAY_OF_MONTH

public static final ErrorCode INVALID_STEP_DAY_OF_MONTH
The cron expression contained an interval step for the day-of-month that was greater than or equal to 31. Since this value is large enough to make it impossible to result in a second value with any starting value in any month, it is not permitted.


INVALID_STEP_DAY_OF_WEEK

public static final ErrorCode INVALID_STEP_DAY_OF_WEEK
The cron expression contained an interval step for the day-of-week that was greater than or equal to 7. Since this value is large enough to make it impossible to result in a second value, it is not permitted.


INVALID_STEP_HOUR

public static final ErrorCode INVALID_STEP_HOUR
The cron expression contained an interval step for the hour that was greater than or equal to 24. Since this value is large enough to make it impossible to result in a second value, it is not permitted.


INVALID_STEP_MONTH

public static final ErrorCode INVALID_STEP_MONTH
The cron expression contained an interval step for the month that was greater than or equal to 12. Since this value is large enough to make it impossible to result in a second value, it is not permitted.


INVALID_STEP_SECOND_OR_MINUTE

public static final ErrorCode INVALID_STEP_SECOND_OR_MINUTE
The cron expression contained an interval step for the second or minute that was greater than or equal to 60. Since this value is large enough to make it impossible to result in a second value, it is not permitted.


INVALID_NAME

public static final ErrorCode INVALID_NAME
The cron expression contained a sequence of letters that appears to be meant as the name of a month or day-of-week, but it was malformed. For example, MO would be invalid because it is too short.


INVALID_NAME_FIELD

public static final ErrorCode INVALID_NAME_FIELD
The cron expression contained a sequence of letters that appears to be meant as the name of a month or day-of-week, but it was specified in one of the other fields.


INVALID_NAME_RANGE

public static final ErrorCode INVALID_NAME_RANGE
The cron expression contained a sequence that appears to be meant as a name-based range of a month or day-of-week values, but the end value of the sequence was malformed. Examples include 3-FRI or MON-4 or FEB-L.


INVALID_NAME_MONTH

public static final ErrorCode INVALID_NAME_MONTH
The cron expression contained a sequence of letters that appears to be meant as the name of a month, but the name was not recognized. Only the three-letter English abbreviations for month names are supported, such as FEB for February or SEP for September.


INVALID_NAME_DAY_OF_WEEK

public static final ErrorCode INVALID_NAME_DAY_OF_WEEK
The cron expression contained a sequence of letters that appears to be meant as the name of a day-of-week, but the name was not recognized. Only the three-letter English abbreviations for day-of-week names are supported, such as MON for Monday or THU for Thursday. Note that THR is not accepted.


INVALID_NUMBER_SEC_OR_MIN

public static final ErrorCode INVALID_NUMBER_SEC_OR_MIN
The cron expression contained a number in the minute or second field that was outside the supported range of [0, 59].


INVALID_NUMBER_HOUR

public static final ErrorCode INVALID_NUMBER_HOUR
The cron expression contained a number in the hour field that was outside the supported range of [0, 23].


INVALID_NUMBER_DAY_OF_MONTH

public static final ErrorCode INVALID_NUMBER_DAY_OF_MONTH
The cron expression contained a number in the day-of-month field that was outside the supported range of [0, 31].


INVALID_NUMBER_DAY_OF_MONTH_OFFSET

public static final ErrorCode INVALID_NUMBER_DAY_OF_MONTH_OFFSET
The cron expression contained an L-x or L-xW expression where the value of x was more than 30. Since 31 or more days before the last day of the month is always in a different month, such an expression could not possibly ever match.


INVALID_NUMBER_MONTH

public static final ErrorCode INVALID_NUMBER_MONTH
The cron expression contained a number in the month field that was outside the supported range of [1, 12].


INVALID_NUMBER_DAY_OF_WEEK

public static final ErrorCode INVALID_NUMBER_DAY_OF_WEEK
The cron expression contained a number in the day-of-week field that was outside the supported range of [1, 7].


INVALID_NUMBER_YEAR

public static final ErrorCode INVALID_NUMBER_YEAR
The cron expression contained a number in the year field that was outside the supported range of [1970, 2299].


INVALID_NUMBER_YEAR_RANGE

public static final ErrorCode INVALID_NUMBER_YEAR_RANGE
The cron expression contains a range in the year field that gave the years in reverse order, such as 2036-2016. Reversed ranges are permitted for the other fields and "wrap around" such that NOV-FEB means November, December, January, or February. There is no really meaningful way to do that for the year ranges, so that is not allowed for this field.


QM_CANNOT_USE_HERE

public static final ErrorCode QM_CANNOT_USE_HERE
The cron expression contained a question-mark (?) in some field other than the day-of-month or day-of-week. This special value cannot be used in any other field.


QM_CANNOT_USE_FOR_BOTH_DAYS

public static final ErrorCode QM_CANNOT_USE_FOR_BOTH_DAYS
The cron expression contained a question-mark (?) for both the day-of-month and the day-of-week. One of these fields must be specified, and it is likely that changing either one to * will give the intended result.


QM_MUST_USE_FOR_ONE_OF_DAYS

public static final ErrorCode QM_MUST_USE_FOR_ONE_OF_DAYS
The cron expression specified values other than ? for both the day-of-month and the day-of-week. Exactly one of these fields must be specified; the other must be disabled by giving ? as its value.


UNEXPECTED_TOKEN_FLAG_L

public static final ErrorCode UNEXPECTED_TOKEN_FLAG_L
The cron expression contained what looks like an L flag, but it is in a column that does not support it or is not in a place that makes sense. For example, you cannot specify L for the hour field, and while you could say L-3 as the day-of-month to indicate the third-to-last day of the month, 3-L does not make sense.


UNEXPECTED_TOKEN_FLAG_W

public static final ErrorCode UNEXPECTED_TOKEN_FLAG_W
The cron expression contained what looks like a W flag, but it is in a column that does not support it or is not in a place that makes sense. For example, you cannot specify W for the hour field, and while you could say 3W as the day-of-month to indicate the weekday closest to the third day of the month, 3-W does not make sense.


UNEXPECTED_TOKEN_HASH

public static final ErrorCode UNEXPECTED_TOKEN_HASH
The cron expression contained what looks like a # flag, but it is in a column that does not support it or is not in a place that makes sense. For example, you cannot specify # in the hour field, and while you could say MON#3 as the day-of-week to indicate the third Monday of the month, #3 by itself does not make sense.


UNEXPECTED_TOKEN_HYPHEN

public static final ErrorCode UNEXPECTED_TOKEN_HYPHEN
The cron expression contained an invalid hyphen (-). This can only be used for ranges that provide both a starting and ending value, such as 5-8 or MAY-AUG, or in the special syntax L-3 that is available for the day-of-month field.


UNEXPECTED_END_OF_EXPRESSION

public static final ErrorCode UNEXPECTED_END_OF_EXPRESSION
The cron expression ended without specifying all of the required fields or ended in a way that would require more characters. Only the year field is optional; all other fields must be included in the cron expression. This error code can also be used if the cron expression ended in a way that would have required more characters to follow, such as a comma (,) or hyphen (-).

Method Detail

values

public static ErrorCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ErrorCode c : ErrorCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ErrorCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toMessage

@Nonnull
public String toMessage(@Nullable
                                String value)
Renders the standard message for this error code and offending value.



Copyright © 2015 Atlassian. All rights reserved.