提交 3dbf8391 编写于 作者: K kohsuke

added cron constructs like @weekly (#1255)


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7012 71c3de6d-444a-0410-be80-ed276b4c234a
上级 39c6f36f
......@@ -20,6 +20,34 @@ throws ANTLRException
table.bits[3]=mnth;
table.dayOfWeek=(int)dow;
}
| "@yearly"
{
table.set("0 0 1 1 *");
}
| "@annually"
{
table.set("0 0 1 1 *");
}
| "@monthly"
{
table.set("0 0 1 * *");
}
| "@weekly"
{
table.set("0 0 * * 0");
}
| "@daily"
{
table.set("0 0 * * *");
}
| "@midnight"
{
table.set("0 0 * * *");
}
| "@hourly"
{
table.set("0 * * * *");
}
;
expr [int field]
......
......@@ -28,6 +28,10 @@ public final class CronTab {
}
public CronTab(String format, int line) throws ANTLRException {
set(format, line);
}
private void set(String format, int line) throws ANTLRException {
CrontabLexer lexer = new CrontabLexer(new StringReader(format));
lexer.setLine(line);
CrontabParser parser = new CrontabParser(lexer);
......@@ -56,6 +60,10 @@ public final class CronTab {
return true;
}
void set(String format) throws ANTLRException {
set(format,1);
}
/**
* Returns true if n-th bit is on.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册