class DefaultObjectDirectoryMapper implements ObjectDirectoryMapper {

    @Override
    public String[] manageClass(Class<?> clazz) {
        // This throws exception if data is invalid
        EntityData entityData = getEntityData(clazz);
        Set<String> managedAttributeNames = new HashSet<String>();
        // extract all relevant attributes
        for (Field field : entityData.metaData) {
            AttributeMetaData attributeMetaData = entityData.metaData.getAttribute(field);
            // skip transient fields
            if (attributeMetaData.isTransient()) {
                continue;
            }
            String[] attributesOfField = attributeMetaData.getAttributes();
            if (attributesOfField != null && attributesOfField.length > 0) {
                // attribute names are either given through annotation
                managedAttributeNames.addAll(Arrays.asList(attributesOfField));
            } else {
                // or implicitly by relying on the field name
                managedAttributeNames.add(field.getName());
            }
        }
        // always add the mandatory attribute objectclass (which is always used for the mapping)
        managedAttributeNames.add(OBJECT_CLASS_ATTRIBUTE);
        return managedAttributeNames.toArray(new String[managedAttributeNames.size()]);
    }

    public  DefaultObjectDirectoryMapper();

}