{
AttributeType attributeType = schemaManager.getAttributeType( attribute );
if ( attributeType == null )
{
return new BinaryValue( result );
}
if ( attributeType.getSyntax().isHumanReadable() )
{
return new StringValue( Strings.utf8ToString( result ) );
}
else
{
return new BinaryValue( result );
}
}
else
{
return new BinaryValue( result );
}
}
else
{
if ( schemaManager != null )
{
AttributeType attributeType = schemaManager.getAttributeType( attribute );
if ( attributeType.getEquality().getSyntax().isHumanReadable() )
{
return new StringValue( null );
}
else
{
return new BinaryValue( null );
}
}
else
{
return new BinaryValue( ( byte[] ) null );
}
}
}