Class AbstractSchemaParser<T extends SchemaObject>
java.lang.Object
org.apache.directory.api.ldap.model.schema.parsers.AbstractSchemaParser<T>
- Type Parameters:
T- The type of SchemaObject
- Direct Known Subclasses:
AttributeTypeDescriptionSchemaParser, DitContentRuleDescriptionSchemaParser, DitStructureRuleDescriptionSchemaParser, LdapComparatorDescriptionSchemaParser, LdapSyntaxDescriptionSchemaParser, MatchingRuleDescriptionSchemaParser, MatchingRuleUseDescriptionSchemaParser, NameFormDescriptionSchemaParser, NormalizerDescriptionSchemaParser, ObjectClassDescriptionSchemaParser, SyntaxCheckerDescriptionSchemaParser
Base class of all schema parsers.
- Author:
- Apache Directory Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OpenLdapSchemaParserThe fast schemaObject parserprotected static final org.slf4j.LoggerThe LoggerFactory used by this class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSchemaParser(Class<T> schemaObjectType, org.apache.directory.api.i18n.I18n errorCodeOnNull, org.apache.directory.api.i18n.I18n errorCodeOnParseExceptionWithPosition, org.apache.directory.api.i18n.I18n errorCodeOnParseException) Instantiates a new abstract schema parser. -
Method Summary
Modifier and TypeMethodDescriptionGet the defined macros.booleanChecks if quirks mode is enabled.abstract TParse a SchemaObject description and returns back an instance of SchemaObject.voidsetQuirksMode(boolean enabled) Sets the quirks mode.protected voidupdateSchemaName(SchemaObject schemaObject) Update the schemaName for the given SchemaObject, accordingly to the X-SCHEMA parameter.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGThe LoggerFactory used by this class -
fastParser
The fast schemaObject parser
-
-
Constructor Details
-
AbstractSchemaParser
protected AbstractSchemaParser(Class<T> schemaObjectType, org.apache.directory.api.i18n.I18n errorCodeOnNull, org.apache.directory.api.i18n.I18n errorCodeOnParseExceptionWithPosition, org.apache.directory.api.i18n.I18n errorCodeOnParseException) Instantiates a new abstract schema parser.- Parameters:
schemaObjectType- The Schema object typeerrorCodeOnNull- error code used when schema element is nullerrorCodeOnParseExceptionWithPosition- error code used on parse error when position is knownerrorCodeOnParseException- error code used on parse error when position is unknown
-
-
Method Details
-
setQuirksMode
public void setQuirksMode(boolean enabled) Sets the quirks mode. If enabled the parser accepts non-numeric OIDs and some special characters in descriptions.- Parameters:
enabled- the new quirks mode
-
isQuirksMode
public boolean isQuirksMode()Checks if quirks mode is enabled.- Returns:
- true, if is quirks mode is enabled
-
parse
Parse a SchemaObject description and returns back an instance of SchemaObject.- Parameters:
schemaDescription- The SchemaObject description- Returns:
- A SchemaObject instance
- Throws:
ParseException- If the parsing failed
-
updateSchemaName
Update the schemaName for the given SchemaObject, accordingly to the X-SCHEMA parameter. If not present, default to 'other'- Parameters:
schemaObject- the schema object where the name should be updated
-
getObjectIdentifiers
Get the defined macros.- Returns:
- The map of defined macros
-