{
if ( filter == null )
{
String message = I18n.err( I18n.ERR_49 );
LOG.error( message );
throw new LdapException( message );
}
if ( filter.isLeaf() )
{
if ( filter instanceof EqualityNode )
{
EqualityNode node = ( ( EqualityNode ) filter );
Object value = node.getValue();
Value<?> newValue = convert( node.getAttribute(), value );
if ( newValue != null )
{
node.setValue( newValue );
}
}
else if ( filter instanceof SubstringNode )
{
SubstringNode node = ( ( SubstringNode ) filter );
if ( !schemaManager.lookupAttributeTypeRegistry( node.getAttribute() ).getSyntax().isHumanReadable() )
{
String message = I18n.err( I18n.ERR_50 );
LOG.error( message );
throw new LdapException( message );
}
}
else if ( filter instanceof PresenceNode )
{
// Nothing to do
}
else if ( filter instanceof GreaterEqNode )
{
GreaterEqNode node = ( ( GreaterEqNode ) filter );
Object value = node.getValue();
Value<?> newValue = convert( node.getAttribute(), value );
if ( newValue != null )
{
node.setValue( newValue );
}
}
else if ( filter instanceof LessEqNode )
{
LessEqNode node = ( ( LessEqNode ) filter );
Object value = node.getValue();
Value<?> newValue = convert( node.getAttribute(), value );
if ( newValue != null )
{
node.setValue( newValue );
}
}
else if ( filter instanceof ExtensibleNode )
{
ExtensibleNode node = ( ( ExtensibleNode ) filter );
if ( !schemaManager.lookupAttributeTypeRegistry( node.getAttribute() ).getSyntax().isHumanReadable() )
{
String message = I18n.err( I18n.ERR_51 );
LOG.error( message );
throw new LdapException( message );
}
}
else if ( filter instanceof ApproximateNode )
{
ApproximateNode node = ( ( ApproximateNode ) filter );