/** * Matches and forgets optional spaces. * * @param name the name * @param pos the pos * @throws LdapInvalidDnException If some invalid chars are found */ private static void matchSpaces( char[] name, Position pos ) throws LdapInvalidDnException { while ( hasMoreChars( pos ) ) { char c = nextChar( name, pos, true ); if ( c != ' ' ) { pos.start--; break; } } }
/** * Matches and forgets optional spaces. * * @param name the name * @param pos the pos * @throws LdapInvalidDnException If some invalid chars are found */ private static void matchSpaces( char[] name, Position pos ) throws LdapInvalidDnException { while ( hasMoreChars( pos ) ) { char c = nextChar( name, pos, true ); if ( c != ' ' ) { pos.start--; break; } } }
/** * Matches and forgets optional spaces. * * @param name the name * @param pos the pos * @throws LdapInvalidDnException If some invalid chars are found */ private static void matchSpaces( char[] name, Position pos ) throws LdapInvalidDnException { while ( hasMoreChars( pos ) ) { char c = nextChar( name, pos, true ); if ( c != ' ' ) { pos.start--; break; } } }
if ( !hasMoreChars( pos ) )
if ( !hasMoreChars( pos ) )
/** * Gets the next character. * * @param name the name * @param pos the pos * @param increment true to increment the position * * @return the character * @throws LdapInvalidDnException If no more characters are available */ private static char nextChar( char[] name, Position pos, boolean increment ) throws LdapInvalidDnException { if ( !hasMoreChars( pos ) ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13610_NO_MORE_CHAR_AVAILABLE, pos.start ) ); } char c = name[pos.start]; if ( increment ) { pos.start++; } return c; }
/** * Gets the next character. * * @param name the name * @param pos the pos * @param increment true to increment the position * * @return the character * @throws LdapInvalidDnException If no more characters are available */ private static char nextChar( char[] name, Position pos, boolean increment ) throws LdapInvalidDnException { if ( !hasMoreChars( pos ) ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13610_NO_MORE_CHAR_AVAILABLE, pos.start ) ); } char c = name[pos.start]; if ( increment ) { pos.start++; } return c; }
/** * Gets the next character. * * @param name the name * @param pos the pos * @param increment true to increment the position * * @return the character * @throws LdapInvalidDnException If no more characters are available */ private static char nextChar( char[] name, Position pos, boolean increment ) throws LdapInvalidDnException { if ( !hasMoreChars( pos ) ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13610_NO_MORE_CHAR_AVAILABLE, pos.start ) ); } char c = name[pos.start]; if ( increment ) { pos.start++; } return c; }
rdns.add( rdn ); if ( !hasMoreChars( pos ) )
rdns.add( rdn ); if ( !hasMoreChars( pos ) )
rdns.add( rdn ); if ( !hasMoreChars( pos ) )
while ( hasMoreChars( pos ) )
while ( hasMoreChars( pos ) )
while ( hasMoreChars( pos ) )