protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
public static CronTabList create(@Nonnull String format, Hash hash) throws ANTLRException { Vector<CronTab> r = new Vector<>(); int lineNumber = 0; String timezone = null; for (String line : format.split("\\r?\\n")) { lineNumber++; line = line.trim(); if(lineNumber == 1 && line.startsWith("TZ=")) { timezone = getValidTimezone(line.replace("TZ=","")); if(timezone != null) { LOGGER.log(Level.CONFIG, "CRON with timezone {0}", timezone); } else { throw new ANTLRException("Invalid or unsupported timezone '" + timezone + "'"); } continue; } if(line.length()==0 || line.startsWith("#")) continue; // ignorable line try { r.add(new CronTab(line,lineNumber,hash,timezone)); } catch (ANTLRException e) { throw new ANTLRException(Messages.CronTabList_InvalidInput(line,e.toString()),e); } } return new CronTabList(r); }
/** * Parses a subtree specification without exhausting the parser. * * @param spec the specification to be parsed * @throws ParseException if there are any recognition errors (bad syntax) */ public synchronized void parse( String spec ) throws ParseException { if ( spec == null || Strings.isEmpty( spec.trim() ) ) { return; } // reset and initialize the parser / lexer pair reset( spec ); try { this.parser.wrapperEntryPoint(); } catch ( TokenStreamException | RecognitionException e ) { String msg = I18n.err( I18n.ERR_13028_SUBTREE_SPEC_PARSER_FAILURE, spec, e.getLocalizedMessage() ); throw new ParseException( msg, 0 ); } } }
if ( inputState.guessing == 0 ) { reportError( "in statement " + ex.toString() ); return null;
/** * Parses a subtree specification without exhausting the parser. * * @param spec the specification to be parsed * @throws ParseException if there are any recognition errors (bad syntax) */ public synchronized void parse( String spec ) throws ParseException { if ( spec == null || Strings.isEmpty( spec.trim() ) ) { return; } // reset and initialize the parser / lexer pair reset( spec ); try { this.parser.wrapperEntryPoint(); } catch ( TokenStreamException | RecognitionException e ) { String msg = I18n.err( I18n.ERR_13028_SUBTREE_SPEC_PARSER_FAILURE, spec, e.getLocalizedMessage() ); throw new ParseException( msg, 0 ); } } }
if (inputState.guessing==0) { reportError("in statement " + ex.toString()); return null;
protected synchronized Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(startTimeSpec); lastChecked = new GregorianCalendar(); this.lastChecked.add(Calendar.MINUTE, -1); nextStop = Long.MIN_VALUE; nextStart = Long.MIN_VALUE; lastStop = Long.MAX_VALUE; lastStart = Long.MAX_VALUE; } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
public static CronTabList create(String format) throws ANTLRException { Vector<CronTab> r = new Vector<CronTab>(); int lineNumber = 0; for (String line : format.split("\\r?\\n")) { lineNumber++; line = line.trim(); if(line.length()==0 || line.startsWith("#")) continue; // ignorable line try { r.add(new CronTab(line,lineNumber)); } catch (ANTLRException e) { throw new ANTLRException(Messages.CronTabList_InvalidInput(line,e.toString()),e); } } return new CronTabList(r); } }
/** * Parses a subtree specification without exhausting the parser. * * @param spec the specification to be parsed * @throws ParseException if there are any recognition errors (bad syntax) */ public synchronized void parse( String spec ) throws ParseException { if ( spec == null || Strings.isEmpty( spec.trim() ) ) { return; } // reset and initialize the parser / lexer pair reset( spec ); try { this.parser.wrapperEntryPoint(); } catch ( TokenStreamException | RecognitionException e ) { String msg = I18n.err( I18n.ERR_13028_SUBTREE_SPEC_PARSER_FAILURE, spec, e.getLocalizedMessage() ); throw new ParseException( msg, 0 ); } } }
/** * Performs syntax check. */ public FormValidation doCheck(@QueryParameter String value) { try { String msg = CronTabList.create(fixNull(value)).checkSanity(); if (msg != null) return FormValidation.warning(msg); return FormValidation.ok(); } catch (ANTLRException e) { return FormValidation.error(e.getMessage()); } } }
public static CronTabList create(String format) throws ANTLRException { Vector<CronTab> r = new Vector<CronTab>(); int lineNumber = 0; for (String line : format.split("\\r?\\n")) { lineNumber++; line = line.trim(); if(line.length()==0 || line.startsWith("#")) continue; // ignorable line try { r.add(new CronTab(line,lineNumber)); } catch (ANTLRException e) { throw new ANTLRException(Messages.CronTabList_InvalidInput(line,e.toString()),e); } } return new CronTabList(r); } }
/** * Parses a subtree specification without exhausting the parser. * * @param spec * the specification to be parsed * @return the specification bean * @throws ParseException * if there are any recognition errors (bad syntax) */ public synchronized SubtreeSpecification parse( String spec ) throws ParseException { SubtreeSpecification ss; if ( ( spec == null ) || Strings.isEmpty( spec.trim() ) ) { return null; } // reset and initialize the parser / lexer pair reset( spec ); try { ss = this.parser.wrapperEntryPoint(); } catch ( TokenStreamException | RecognitionException e ) { String msg = I18n.err( I18n.ERR_13028_SUBTREE_SPEC_PARSER_FAILURE, spec, e.getLocalizedMessage() ); throw new ParseException( msg, 0 ); } return ss; }
/** * Performs syntax check. */ public FormValidation doCheckSpec(@QueryParameter String value, @AncestorInPath Item item) { try { CronTabList ctl = CronTabList.create(fixNull(value), item != null ? Hash.from(item.getFullName()) : null); Collection<FormValidation> validations = new ArrayList<>(); updateValidationsForSanity(validations, ctl); updateValidationsForNextRun(validations, ctl); return FormValidation.aggregate(validations); } catch (ANTLRException e) { if (value.trim().indexOf('\n')==-1 && value.contains("**")) return FormValidation.error(Messages.TimerTrigger_MissingWhitespace()); return FormValidation.error(e.getMessage()); } }
public static CronTabList create(String format) throws ANTLRException { Vector<CronTab> r = new Vector<CronTab>(); int lineNumber = 0; for (String line : format.split("\\r?\\n")) { lineNumber++; line = line.trim(); if(line.length()==0 || line.startsWith("#")) continue; // ignorable line try { r.add(new CronTab(line,lineNumber)); } catch (ANTLRException e) { throw new ANTLRException(Messages.CronTabList_InvalidInput(line,e.toString()),e); } } return new CronTabList(r); } }
/** * Parses a subtree specification without exhausting the parser. * * @param spec * the specification to be parsed * @return the specification bean * @throws ParseException * if there are any recognition errors (bad syntax) */ public synchronized SubtreeSpecification parse( String spec ) throws ParseException { SubtreeSpecification ss; if ( ( spec == null ) || Strings.isEmpty( spec.trim() ) ) { return null; } // reset and initialize the parser / lexer pair reset( spec ); try { ss = this.parser.wrapperEntryPoint(); } catch ( TokenStreamException | RecognitionException e ) { String msg = I18n.err( I18n.ERR_13028_SUBTREE_SPEC_PARSER_FAILURE, spec, e.getLocalizedMessage() ); throw new ParseException( msg, 0 ); } return ss; }
} catch (ANTLRException e) { return FormValidation.error(e, Messages.AbstractProject_AssignedLabelString_InvalidBooleanExpression(e.getMessage()));
public static CronTabList create(@Nonnull String format, Hash hash) throws ANTLRException { Vector<CronTab> r = new Vector<>(); int lineNumber = 0; String timezone = null; for (String line : format.split("\\r?\\n")) { lineNumber++; line = line.trim(); if(lineNumber == 1 && line.startsWith("TZ=")) { timezone = getValidTimezone(line.replace("TZ=","")); if(timezone != null) { LOGGER.log(Level.CONFIG, "CRON with timezone {0}", timezone); } else { throw new ANTLRException("Invalid or unsupported timezone '" + timezone + "'"); } continue; } if(line.length()==0 || line.startsWith("#")) continue; // ignorable line try { r.add(new CronTab(line,lineNumber,hash,timezone)); } catch (ANTLRException e) { throw new ANTLRException(Messages.CronTabList_InvalidInput(line,e.toString()),e); } } return new CronTabList(r); }
/** * Parses a subtree specification without exhausting the parser. * * @param spec * the specification to be parsed * @return the specification bean * @throws ParseException * if there are any recognition errors (bad syntax) */ public synchronized SubtreeSpecification parse( String spec ) throws ParseException { SubtreeSpecification ss; if ( ( spec == null ) || Strings.isEmpty( spec.trim() ) ) { return null; } // reset and initialize the parser / lexer pair reset( spec ); try { ss = this.parser.wrapperEntryPoint(); } catch ( TokenStreamException | RecognitionException e ) { String msg = I18n.err( I18n.ERR_13028_SUBTREE_SPEC_PARSER_FAILURE, spec, e.getLocalizedMessage() ); throw new ParseException( msg, 0 ); } return ss; }
throw new QueryException( e.getMessage(), hql );
public final void whereClause() throws RecognitionException, TokenStreamException, ANTLRException { returnAST = null; ASTPair currentAST = new ASTPair(); AST whereClause_AST = null; try { // for error handling match( WHERE ); searchCondition(); astFactory.addASTChild( currentAST, returnAST ); whereClause_AST = ( AST ) currentAST.root; } catch ( ANTLRException ex ) { if ( inputState.guessing == 0 ) { reportError( ex.toString() ); isCorrectStatement = false; throw new ANTLRException( "this was an invalid IQL statement" ); } else { throw ex; } } returnAST = whereClause_AST; }