/** * 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; }
/** * 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; }
/** * 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; }