/** * 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; }
ssParser = new SubtreeSpecificationParser( schemaManager ); AttributeType ocAt = directoryService.getAtProvider().getObjectClass(); ss = ssParser.parse( subtree );
/** * Get the SubtreeSpecification, parse it and stores it into the subentry */ private void setSubtreeSpecification( Subentry subentry, Entry entry ) throws LdapException { String subtree = entry.get( directoryService.getAtProvider().getSubtreeSpecification() ).getString(); SubtreeSpecification ss; try { ss = ssParser.parse( subtree ); } catch ( Exception e ) { String msg = I18n.err( I18n.ERR_307, entry.getDn() ); LOG.warn( msg ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg ); } subentry.setSubtreeSpecification( ss ); }
ssNew = ssParser.parse( subtreeMod.getAttribute().getString() );
/** * 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; }