Package org.ldaptive.schema
Class SchemaParser
- java.lang.Object
-
- org.ldaptive.schema.SchemaParser
-
public final class SchemaParser extends Object
Encapsulates aSchemaFunctionand exposes a convenience static method for parsing schema definitions. The schema function used by this class can be set using the system propertySCHEMA_FUNCTION_PROPERTY.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSchemaParser.DefaultSchemaFunctionCharBuffer based implementation for schema functions.static classSchemaParser.RegexSchemaFunctionRegular expression based implementation for schema functions.
-
Field Summary
Fields Modifier and Type Field Description private static LoggerLOGGERLogger for this class.private static SchemaFunctionSCHEMA_FUNCTIONDefault schema function.private static Constructor<SchemaFunction>SCHEMA_FUNCTION_CONSTRUCTORCustom schema parser constructor.private static StringSCHEMA_FUNCTION_PROPERTYSchema function system property.
-
Constructor Summary
Constructors Modifier Constructor Description privateSchemaParser()Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SchemaFunctiongetSchemaFunction()TheSCHEMA_FUNCTION_PROPERTYproperty is checked and that class is loaded if provided.static <T extends SchemaElement>
Tparse(Class<T> type, String definition)Parses the supplied string representation of a schema element.
-
-
-
Field Detail
-
SCHEMA_FUNCTION_PROPERTY
private static final String SCHEMA_FUNCTION_PROPERTY
Schema function system property.- See Also:
- Constant Field Values
-
LOGGER
private static final Logger LOGGER
Logger for this class.
-
SCHEMA_FUNCTION
private static final SchemaFunction SCHEMA_FUNCTION
Default schema function.
-
SCHEMA_FUNCTION_CONSTRUCTOR
private static final Constructor<SchemaFunction> SCHEMA_FUNCTION_CONSTRUCTOR
Custom schema parser constructor.
-
-
Method Detail
-
getSchemaFunction
public static SchemaFunction getSchemaFunction()
TheSCHEMA_FUNCTION_PROPERTYproperty is checked and that class is loaded if provided. Otherwise, theSchemaParser.DefaultSchemaFunctionis returned.- Returns:
- default filter function
-
parse
public static <T extends SchemaElement> T parse(Class<T> type, String definition) throws SchemaParseException
Parses the supplied string representation of a schema element.- Type Parameters:
T- type of schema element- Parameters:
type- of schema elementdefinition- to parse- Returns:
- parsed schema element
- Throws:
SchemaParseException- if definition is invalid
-
-