use of org.apache.directory.api.ldap.model.schema.parsers.NormalizerDescription in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadNormalizers.
private void loadNormalizers(Attribute normalizers) throws LdapException {
if (normalizers == null) {
return;
}
for (Value value : normalizers) {
String desc = value.getValue();
try {
NormalizerDescription normalizer = N_DESCR_SCHEMA_PARSER.parseNormalizerDescription(desc);
updateSchemas(normalizer);
} catch (ParseException pe) {
throw new LdapException(pe);
}
}
}
use of org.apache.directory.api.ldap.model.schema.parsers.NormalizerDescription in project directory-ldap-api by apache.
the class NormalizerDescriptionSchemaParserTest method testFqcn.
@Test
public void testFqcn() throws ParseException {
String value = null;
NormalizerDescription nd = null;
// FQCN simple p
value = "( 1.1 FQCN org.apache.directory.SimpleNormalizer )";
nd = parser.parseNormalizerDescription(value);
assertNotNull(nd.getFqcn());
assertEquals("org.apache.directory.SimpleNormalizer", nd.getFqcn());
}
use of org.apache.directory.api.ldap.model.schema.parsers.NormalizerDescription in project directory-ldap-api by apache.
the class NormalizerDescriptionSchemaParserTest method testBytecode.
@Test
public void testBytecode() throws ParseException {
String value = null;
NormalizerDescription nd = null;
// FQCN simple p
value = "( 1.1 FQCN org.apache.directory.SimpleNormalizer BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )";
nd = parser.parseNormalizerDescription(value);
assertNotNull(nd.getBytecode());
assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", nd.getBytecode());
}
use of org.apache.directory.api.ldap.model.schema.parsers.NormalizerDescription in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadNormalizers.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadNormalizers(Schema... schemas) throws LdapException, IOException {
List<Entry> normalizerEntries = new ArrayList<>();
if (schemas == null) {
return normalizerEntries;
}
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof NormalizerDescription) {
NormalizerDescription normalizerDescription = (NormalizerDescription) schemaObject;
Entry normalizerEntry = getEntry(normalizerDescription);
normalizerEntries.add(normalizerEntry);
}
}
}
return normalizerEntries;
}
Aggregations