/** * @return representation of value, escaped for use in a filter if required */ public Value<?> getEscapedValue() { if ( !value.isBinary() ) { return AbstractExprNode.escapeFilterValue( value ); } return value; }
public Value<?> normalize( Value<?> value ) throws LdapException { if ( !value.isBinary() ) { return new StringValue( value.getString().toLowerCase() ); } throw new IllegalStateException( I18n.err( I18n.ERR_473 ) ); }
/** * {@inheritDoc} */ public Value<?> normalize( final Value<?> value ) { if ( value == null ) { return null; } if ( !value.isBinary() ) { String str = value.getString(); for ( int i = 0; i < matchers.length; i++ ) { str = matchers[i].replaceAll( str ); } return new StringValue( str ); } return value; }
/** * Get a String representation of a Compare Request * * @return A Compare Request String */ public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " Compare request\n" ); sb.append( " Entry : '" ).append( name.toString() ).append( "'\n" ); sb.append( " Attribute description : '" ).append( attrId ).append( "'\n" ); sb.append( " Attribute value : '" ); if ( !attrVal.isBinary() ) { sb.append( attrVal.get() ); } else { byte[] binVal = attrVal.getBytes(); sb.append( StringTools.utf8ToString( binVal ) ).append( '/' ).append( StringTools.dumpBytes( binVal ) ).append( "'\n" ); } return sb.toString(); } }
if ( !value.isBinary() )
if ( !normValue.isBinary() )
if ( !value.isBinary() )
public Class<?> findClass( String name ) throws ClassNotFoundException { byte[] classBytes = null; Value<?> value = attribute.get(); if ( value.isBinary() ) { classBytes = value.getBytes(); return defineClass( name, classBytes, 0, classBytes.length ); } else { throw new ClassNotFoundException( I18n.err( I18n.ERR_10002 ) ); } } }
public Value<?> normalize( Value<?> value ) throws LdapException { if ( value.isBinary() ) { byte[] val = value.getBytes(); // each byte will be changed to be > 0, and spaces will be trimmed byte[] newVal = new byte[ val.length ]; int i = 0; for ( byte b:val ) { newVal[i++] = (byte)(b & 0x007F); } return new BinaryValue( StringTools.trim( newVal ) ); } throw new IllegalStateException( I18n.err( I18n.ERR_474 ) ); }
if ( ( val instanceof StringValue ) || ( val.isBinary() ) )
/** * <p> * Get the byte[] value, if and only if the value is known to be Binary, * otherwise a InvalidAttributeValueException will be thrown * </p> * <p> * Note that this method returns the first value only. * </p> * * @return The value as a byte[] * @throws LdapInvalidAttributeValueException If the value is a String */ public byte[] getBytes() throws LdapInvalidAttributeValueException { Value<?> value = get(); if ( value.isBinary() ) { return value.getBytes(); } else { String message = I18n.err( I18n.ERR_04130 ); LOG.error( message ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message ); } }
if ( !atav.getNormValue().isBinary() )
out.writeUTF( normType ); boolean isHR = !normValue.isBinary();
if ( value.isBinary() )
if ( !value.isBinary() )
if ( assertion.getAssertionValue().isBinary() )
out.writeUTF( atav.getNormType() ); boolean isHR = !atav.getNormValue().isBinary();