org.apache.directory.api.ldap.codec.api
Class DefaultConfigurableBinaryAttributeDetector

java.lang.Object
  extended by org.apache.directory.api.ldap.codec.api.SchemaBinaryAttributeDetector
      extended by org.apache.directory.api.ldap.codec.api.DefaultConfigurableBinaryAttributeDetector
All Implemented Interfaces:
BinaryAttributeDetector, ConfigurableBinaryAttributeDetector

public class DefaultConfigurableBinaryAttributeDetector
extends SchemaBinaryAttributeDetector
implements ConfigurableBinaryAttributeDetector

An implementation of the BinaryAttributeDetector interface. It's used on the client side to detect if an Attribute is HumanRedable.
One can inject some new attributes, replace the existing list, remove some attributes.
We provide a list of Attributes which are known to be binary :


In order to reset the detector to get back to those default value, it's enough to call the setBinaryAttributes() with null as a parameter.

Author:
Apache Directory Project

Field Summary
static String[] DEFAULT_BINARY_ATTRIBUTES
          A list of all the known binary attributes
 
Constructor Summary
DefaultConfigurableBinaryAttributeDetector()
          Creates a new instance of a ConfigurableBinaryAttributeDetector.
 
Method Summary
 void addBinaryAttribute(String... binaryAttributes)
          Add some binary Attributes Id to the list of attributes
 boolean isBinary(String attributeId)
          Returns true if the attribute specified is not human readible.
 void removeBinaryAttribute(String... binaryAttributes)
          Remove some binary Attributes Id from the list of attributes
 void setBinaryAttributes(String... binaryAttributes)
          Inject a new set of binary attributes that will replace the old one.
 
Methods inherited from class org.apache.directory.api.ldap.codec.api.SchemaBinaryAttributeDetector
setSchemaManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BINARY_ATTRIBUTES

public static final String[] DEFAULT_BINARY_ATTRIBUTES
A list of all the known binary attributes

Constructor Detail

DefaultConfigurableBinaryAttributeDetector

public DefaultConfigurableBinaryAttributeDetector()
Creates a new instance of a ConfigurableBinaryAttributeDetector. This will load a set of default attribute ID that are known to be binary.

Method Detail

isBinary

public boolean isBinary(String attributeId)
Returns true if the attribute specified is not human readible.

Specified by:
isBinary in interface BinaryAttributeDetector
Overrides:
isBinary in class SchemaBinaryAttributeDetector
Parameters:
attributeId - the identifier/descriptor for the attribute to be checked.
Returns:
true if the attribute specified is not human readible, false otherwise

addBinaryAttribute

public void addBinaryAttribute(String... binaryAttributes)
Add some binary Attributes Id to the list of attributes

Specified by:
addBinaryAttribute in interface ConfigurableBinaryAttributeDetector
Parameters:
binaryAttributes - The added binary attributes Id

removeBinaryAttribute

public void removeBinaryAttribute(String... binaryAttributes)
Remove some binary Attributes Id from the list of attributes

Specified by:
removeBinaryAttribute in interface ConfigurableBinaryAttributeDetector
Parameters:
binaryAttributes - The binary attributes Id to remove

setBinaryAttributes

public void setBinaryAttributes(String... binaryAttributes)
Inject a new set of binary attributes that will replace the old one. If one inject a null set of attributes, the list of attributes will be cleared, and reset to the default list of binary attributes. If one injects an empty String array, then all the attributes will be removed from the list, and we won't inject the default attributes into it.

Specified by:
setBinaryAttributes in interface ConfigurableBinaryAttributeDetector
Parameters:
binaryAttributes - The new set of binary attributes


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.