public class CronExpressionDescriptor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CronExpressionDescriptor.DescriptionType |
| Constructor and Description |
|---|
CronExpressionDescriptor()
Empty constructor
|
CronExpressionDescriptor(java.lang.String expression)
Constructor (default system locale)
|
CronExpressionDescriptor(java.lang.String expression,
CronExpressionParser.Options options)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
formatTime(java.lang.String hourExpression,
java.lang.String minuteExpression)
Given time parts, will contruct a formatted time description
|
protected java.lang.String |
formatTime(java.lang.String hourExpression,
java.lang.String minuteExpression,
java.lang.String secondExpression)
Given time parts, will contruct a formatted time description
|
protected java.lang.String |
GenerateBetweenSegmentDescription(java.lang.String betweenExpression,
it.burning.cron.CronExpressionDescriptor.GetDescription getBetweenDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getSingleItemDescription)
Generates the between segment description
|
protected java.lang.String |
GetDayOfMonthDescription()
Generates a description for only the DAYOFMONTH portion of the expression
|
protected java.lang.String |
GetDayOfWeekDescription()
Generates a description for only the DAYOFWEEK portion of the expression
|
java.lang.String |
getDescription()
Get the full description for the currently configured expression and options
|
java.lang.String |
getDescription(CronExpressionDescriptor.DescriptionType type)
Generates a human readable String for the Cron Expression
|
static java.lang.String |
getDescription(java.lang.String expression)
Generates a human readable String for the Cron Expression
|
static java.lang.String |
getDescription(java.lang.String expression,
CronExpressionParser.Options options)
Generates a human readable String for the Cron Expression
|
protected java.lang.String |
getFullDescription()
Generates the FULL description
|
protected java.lang.String |
GetHoursDescription()
Generates a description for only the HOUR portion of the expression
|
java.util.Locale |
getLocale() |
java.util.ResourceBundle |
getLocalization() |
protected java.lang.String |
GetMinutesDescription()
Generates a description for only the MINUTE portion of the expression
|
protected java.lang.String |
GetMonthDescription()
Generates a description for only the MONTH portion of the expression
|
CronExpressionParser.Options |
getOptions() |
protected java.lang.String |
GetSecondsDescription()
Generates a description for only the SECONDS portion of the expression
|
protected java.lang.String |
getSegmentDescription(java.lang.String expression,
java.lang.String allDescription,
it.burning.cron.CronExpressionDescriptor.GetDescription getSingleItemDescription,
it.burning.cron.CronExpressionDescriptor.GetDescription getIntervalDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getBetweenDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getRangeFormat)
Generates the segment description
|
protected java.lang.String |
getString(java.lang.String resourceName)
Gets a localized String resource
|
protected java.lang.String |
getString(java.lang.String resourceName,
boolean emptyIfNotFound)
Gets a localized String resource, optionally returns an empty string or the requested
resource name if the resource is not found within the localzation packages
|
protected java.lang.String |
GetTimeOfDayDescription()
Generates a description for only the TIMEOFDAY portion of the expression
|
boolean |
isUse24HourTimeFormat() |
static void |
setDefaultLocale()
Set the default locale of the JVM instance we're running in
|
static void |
setDefaultLocale(java.util.Locale locale)
Set the default locale to be used
|
static void |
setDefaultLocale(java.lang.String language)
Set the default locale to be used
|
void |
setExpression(java.lang.String expression)
Set the expression that this instance will process next time the
getDescription(DescriptionType) is
called. |
void |
setExpression(java.lang.String expression,
CronExpressionParser.Options options)
Set the expression and options that this instance will process next time the
getDescription(DescriptionType) is
called. |
void |
setOptions(CronExpressionParser.Options options) |
protected java.lang.String |
transformVerbosity(java.lang.String description,
boolean useVerboseFormat)
Transforms the verbosity of the expression description by stripping verbosity from original description
|
public CronExpressionDescriptor()
public CronExpressionDescriptor(java.lang.String expression)
expression - The complete cron expressionpublic CronExpressionDescriptor(java.lang.String expression,
CronExpressionParser.Options options)
expression - The cron expression to describeoptions - The options to use when parsing the expressionpublic void setOptions(CronExpressionParser.Options options)
public CronExpressionParser.Options getOptions()
public java.util.Locale getLocale()
public java.util.ResourceBundle getLocalization()
public boolean isUse24HourTimeFormat()
public void setExpression(java.lang.String expression)
getDescription(DescriptionType) is
called. Default options will be used.expression - The expression to be parsedpublic void setExpression(java.lang.String expression,
CronExpressionParser.Options options)
getDescription(DescriptionType) is
called.expression - The new expression to describeoptions - The options to usepublic java.lang.String getDescription()
public java.lang.String getDescription(CronExpressionDescriptor.DescriptionType type)
type - Which part(s) of the expression to describeprotected java.lang.String getFullDescription()
protected java.lang.String GetTimeOfDayDescription()
protected java.lang.String GetSecondsDescription()
protected java.lang.String GetMinutesDescription()
protected java.lang.String GetHoursDescription()
protected java.lang.String GetDayOfWeekDescription()
protected java.lang.String GetMonthDescription()
protected java.lang.String GetDayOfMonthDescription()
protected java.lang.String getSegmentDescription(java.lang.String expression,
java.lang.String allDescription,
it.burning.cron.CronExpressionDescriptor.GetDescription getSingleItemDescription,
it.burning.cron.CronExpressionDescriptor.GetDescription getIntervalDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getBetweenDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getRangeFormat)
Range expressions used the 'ComaX0ThroughX1' resource
However Romanian language has different idioms for
1. 'from number to number' (minutes, seconds, hours, days) -- ComaMinX0ThroughMinX1 optional resource
2. 'from month to month' -- ComaMonthX0ThroughMonthX1 optional resource
3. 'from year to year' -- ComaYearX0ThroughYearX1 optional resource
therefore the getRangeFormat parameter was introduced
expression - The expressionallDescription - The complete descriptiongetSingleItemDescription - Functional implementationgetIntervalDescriptionFormat - Functional implementationgetBetweenDescriptionFormat - Functional implementationgetDescriptionFormat - Functional implementationgetRangeFormat - Functional implementation that formats range expressions depending on cron partsprotected java.lang.String GenerateBetweenSegmentDescription(java.lang.String betweenExpression,
it.burning.cron.CronExpressionDescriptor.GetDescription getBetweenDescriptionFormat,
it.burning.cron.CronExpressionDescriptor.GetDescription getSingleItemDescription)
betweenExpression - Between range expressiongetBetweenDescriptionFormat - Functional implementationgetSingleItemDescription - Functional implementationprotected java.lang.String formatTime(java.lang.String hourExpression,
java.lang.String minuteExpression)
hourExpression - Hours partminuteExpression - Minutes partprotected java.lang.String formatTime(java.lang.String hourExpression,
java.lang.String minuteExpression,
java.lang.String secondExpression)
hourExpression - Hours partminuteExpression - Minutes partsecondExpression - Seconds partprotected java.lang.String transformVerbosity(java.lang.String description,
boolean useVerboseFormat)
description - The description to transformuseVerboseFormat - If true, will leave description as it, if false, will strip verbose parts.
The transformed description with proper verbosityprotected java.lang.String getString(java.lang.String resourceName)
resourceName - The name of the resource String to retrieveprotected java.lang.String getString(java.lang.String resourceName,
boolean emptyIfNotFound)
resourceName - The name of the resource String to retrieveemptyIfNotFound - True to return an empty string if the resource wasn't foundpublic static java.lang.String getDescription(java.lang.String expression)
expression - The cron expression Stringpublic static java.lang.String getDescription(java.lang.String expression,
CronExpressionParser.Options options)
expression - The cron expression Stringoptions - Options to control the output descriptionpublic static void setDefaultLocale(java.lang.String language)
language - The language identifier string for the desired locale: "en", "it", etc..public static void setDefaultLocale(java.util.Locale locale)
locale - The constant representing a default locale stringpublic static void setDefaultLocale()