@Test ( expected=ParseException.class) public void testWhatDnBasicDnExactNoQuote() throws Exception { System.out.println( "\n--> testWhatDnBasicDnExactNoQuote" ); String dnPattern = "dc=example,dc=com"; OpenLdapAclParser parser = new OpenLdapAclParser(); parser.parse( "access to dn.exact=" + dnPattern + " by *" ); fail(); }
public synchronized AclItem parse( String s ) throws ParseException { try { LexerSharedInputState state = new LexerSharedInputState( new CharBuffer( new StringReader( s ) ) ); this.lexer.setInputState( state ); this.parser.getInputState().reset(); parser.parse(); return parser.getAclItem(); } catch ( TokenStreamException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage(), -1 ); } catch ( RecognitionException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage() + " - [Line:" + e.getLine() + " - Column:" + e.getColumn() + "]", e.getColumn() ); } }
OpenLdapAclParser { public synchronized AclItem parse( String s ) throws ParseException { try { LexerSharedInputState state = new LexerSharedInputState( new CharBuffer( new StringReader( s ) ) ); this.lexer.setInputState( state ); this.parser.getInputState().reset(); parser.parse(); return parser.getAclItem(); } catch ( TokenStreamException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage(), -1 ); } catch ( RecognitionException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage() + " - [Line:" + e.getLine() + " - Column:" + e.getColumn() + "]", e.getColumn() ); } } }
OpenLdapAclParser { public synchronized AclItem parse( String s ) throws ParseException { try { LexerSharedInputState state = new LexerSharedInputState( new CharBuffer( new StringReader( s ) ) ); this.lexer.setInputState( state ); this.parser.getInputState().reset(); parser.parse(); return parser.getAclItem(); } catch ( TokenStreamException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage(), -1 ); } catch ( RecognitionException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage() + " - [Line:" + e.getLine() + " - Column:" + e.getColumn() + "]", e.getColumn() ); } } OpenLdapAclParser(); }
OpenLdapAclParser { public synchronized AclItem parse( String s ) throws ParseException { try { LexerSharedInputState state = new LexerSharedInputState( new CharBuffer( new StringReader( s ) ) ); this.lexer.setInputState( state ); this.parser.getInputState().reset(); parser.parse(); return parser.getAclItem(); } catch ( TokenStreamException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage(), -1 ); } catch ( RecognitionException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage() + " - [Line:" + e.getLine() + " - Column:" + e.getColumn() + "]", e.getColumn() ); } } OpenLdapAclParser(); synchronized AclItem parse( String s ); }
OpenLdapAclParser { public synchronized AclItem parse( String s ) throws ParseException { try { LexerSharedInputState state = new LexerSharedInputState( new CharBuffer( new StringReader( s ) ) ); this.lexer.setInputState( state ); this.parser.getInputState().reset(); parser.parse(); return parser.getAclItem(); } catch ( TokenStreamException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage(), -1 ); } catch ( RecognitionException e ) { throw new ParseException( "Unable to read ACL: " + e.getMessage() + " - [Line:" + e.getLine() + " - Column:" + e.getColumn() + "]", e.getColumn() ); } } OpenLdapAclParser(); synchronized AclItem parse( String s );  }