Class OpenLdapSchemaParser

    • Constructor Detail

      • OpenLdapSchemaParser

        public OpenLdapSchemaParser()
        Creates a reusable instance of an OpenLdapSchemaParser.
    • Method Detail

      • clear

        public void clear()
        Reset the parser
      • getAttributeTypes

        public List<AttributeType> getAttributeTypes()
        Gets the attribute types.
        Returns:
        the attribute types
      • getObjectClasses

        public List<ObjectClass> getObjectClasses()
        Gets the object class types.
        Returns:
        the object class types
      • afterParse

        private void afterParse()
                         throws ParseException
        Splits parsed schema descriptions and resolved object identifier macros.
        Throws:
        ParseException - the parse exception
      • getResolveOid

        private String getResolveOid​(String oid)
        Return a complete OID from a macro followed by an OID.
        Parameters:
        oid - The OID to find
        Returns:
        The extended OID
      • parse

        public SchemaObject parse​(String schemaObject)
                           throws ParseException
        Parses an OpenLDAP schemaObject element/object.
        Parameters:
        schemaObject - the String image of a complete schema object
        Returns:
        the schema object
        Throws:
        ParseException - If the schemaObject can't be parsed
      • isComment

        private static boolean isComment​(OpenLdapSchemaParser.PosSchema pos)
        Parameters:
        pos - The position in the Schema
        Returns:
        true if this is a comment
      • isEmpty

        private static boolean isEmpty​(OpenLdapSchemaParser.PosSchema pos)
        Parameters:
        pos - The position in the Schema
        Returns:
        true of the line is empty
      • startsWith

        private static boolean startsWith​(OpenLdapSchemaParser.PosSchema pos,
                                          String text)
        Parameters:
        pos - The position in the Schema
        text - The text to find at the beginning of the line
        Returns:
        true if teh line starts with the given text
      • startsWith

        private static boolean startsWith​(Reader reader,
                                          OpenLdapSchemaParser.PosSchema pos,
                                          char c)
                                   throws IOException,
                                          LdapSchemaException
        Check if the stream starts with a given char at a given position
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        c - The char to check
        Returns:
        true if the stream starts with the given char at the given position
        Throws:
        IOException - If we can't read the stream
        LdapSchemaException - If we have no char to read
      • startsWith

        private static boolean startsWith​(Reader reader,
                                          OpenLdapSchemaParser.PosSchema pos,
                                          char c,
                                          boolean quoted)
                                   throws IOException,
                                          LdapSchemaException
        Check if the stream at the given position starts with a given char
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        c - The char to check
        quoted - true if the char is quoted
        Returns:
        true if the stream starts with the given char at the given position
        Throws:
        IOException - If we can't read the stream
        LdapSchemaException - If we have no char to read
      • startsWith

        private static boolean startsWith​(OpenLdapSchemaParser.PosSchema pos,
                                          char c)
        Parameters:
        pos - The position in the Schema
        c - The char to find at the beginning of the line
        Returns:
        true if the char is found at the beginning of the line
      • isAlpha

        private static boolean isAlpha​(OpenLdapSchemaParser.PosSchema pos)
        Parameters:
        pos - The position in the Schema
        Returns:
        true if the first char is alphabetic
      • isDigit

        private static boolean isDigit​(OpenLdapSchemaParser.PosSchema pos)
        Parameters:
        pos - The position in the Schema
        Returns:
        true if the first char is a digit
      • getNumericOid

        private static String getNumericOid​(OpenLdapSchemaParser.PosSchema pos)
                                     throws LdapSchemaException
         numericoid   ::= number ( DOT number )+
         number       ::= DIGIT | LDIGIT DIGIT+
         DIGIT        ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT       ::= %x31-39             ; "1"-"9"
         DOT          ::= %x2E                ; period (".")
         
        Parameters:
        pos - The position in the Schema
        Returns:
        The numeric OID
        Throws:
        LdapSchemaException - If the schema is wrong
      • getPartialNumericOid

        private static String getPartialNumericOid​(OpenLdapSchemaParser.PosSchema pos)
                                            throws LdapSchemaException
         partialNumericoid   ::= number ( DOT number )*
         number              ::= DIGIT | LDIGIT DIGIT+
         DIGIT               ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT              ::= %x31-39             ; "1"-"9"
         DOT                 ::= %x2E                ; period (".")
         
        Parameters:
        pos - The position in the Schema
        Returns:
        The found OID
        Throws:
        LdapSchemaException - If the schema is wrong
      • getOidAndMacroRelaxed

        private static String getOidAndMacroRelaxed​(OpenLdapSchemaParser.PosSchema pos,
                                                    Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                             throws LdapSchemaException
        In relaxed mode :
         oid          ::= descr | numericoid
         descr        ::= descrQ (COLON numericoid)
         descrQ       ::= keystringQ
         keystringQ   ::= LkeycharQ keycharQ*
         LkeycharQ    ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         keycharQ     ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         numericoid   ::= number ( DOT number )+
         number       ::= DIGIT | LDIGIT DIGIT+
         ALPHA        ::= %x41-5A | %x61-7A   ; "A"-"Z" / "a"-"z"
         DIGIT        ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT       ::= %x31-39             ; "1"-"9"
         HYPHEN       ::= %x2D                ; hyphen ("-")
         UNDERSCORE   ::= %x5F                ; underscore ("_")
         DOT          ::= %x2E                ; period (".")
         COLON        ::= %x3A                ; colon (":")
         SEMI_COLON   ::= %x3B                ; semi-colon(";")
         SHARP        ::= %x23                ; octothorpe (or sharp sign) ("#")
         
        Parameters:
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        The found OID
        Throws:
        LdapSchemaException - If the schema is wrong
      • getOidStrict

        private static String getOidStrict​(OpenLdapSchemaParser.PosSchema pos)
                                    throws LdapSchemaException
        In normal mode :
         oid          ::= descr | numericoid
         descr        ::= keystring
         keystring    ::= leadkeychar keychar*
         leadkeychar  ::= ALPHA
         keychar      ::= ALPHA | DIGIT | HYPHEN
         numericoid   ::= number ( DOT number )+ |
         number       ::= DIGIT | LDIGIT DIGIT+
         ALPHA        ::= %x41-5A | %x61-7A   ; "A"-"Z" / "a"-"z"
         DIGIT        ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT       ::= %x31-39             ; "1"-"9"
         DOT          ::= %x2E                ; period (".")
         HYPHEN       ::= %x2D                ; hyphen ("-")
         
        Parameters:
        pos - The position in the Schema
        Returns:
        The found OID
        Throws:
        LdapSchemaException - If the schema is wrong
      • getOidRelaxed

        private static String getOidRelaxed​(OpenLdapSchemaParser.PosSchema pos,
                                            boolean hadQuote)
                                     throws LdapSchemaException
        In quirks mode :
         oid          ::= descr-relaxed | numericoid | SQUOTE descr-relaxed SQUOTE |
                          DQUOTE descr-relaxed DQUOTE | SQUOTE numericoid SQUOTE |
                          DQUOTE numericoid DQUOTE
         descr-relaxed::= macro (COLON numericoid)
         macro        ::= keystring
         keystring    ::= Lkeychar  keychar*
         Lkeychar     ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         keychar      ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         numericoid   ::= number ( DOT number )+
         number       ::= DIGIT | LDIGIT DIGIT+
         ALPHA        ::= %x41-5A | %x61-7A   ; "A"-"Z" / "a"-"z"
         DIGIT        ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT       ::= %x31-39             ; "1"-"9"
         HYPHEN       ::= %x2D                ; hyphen ("-")
         UNDERSCORE   ::= %x5F                ; underscore ("_")
         DOT          ::= %x2E                ; period (".")
         COLON        ::= %x3A                ; colon (":")
         SEMI_COLON   ::= %x3B                ; semi-colon(";")
         SHARP        ::= %x23                ; octothorpe (or sharp sign) ("#")
         
        Parameters:
        pos - The position in the Schema
        hadQuote - If we have had a quote
        Returns:
        the found OID
        Throws:
        LdapSchemaException - If the schema is wrong
      • getDescrStrict

        private static String getDescrStrict​(OpenLdapSchemaParser.PosSchema pos)
                                      throws LdapSchemaException
        In strict mode :
         descr        ::= keystring
         keystring    ::= leadkeychar keychar*
         leadkeychar  ::= ALPHA
         keychar      ::= ALPHA | DIGIT | HYPHEN
         numericoid   ::= number ( DOT number )+ |
         number       ::= DIGIT | LDIGIT DIGIT+
         ALPHA        ::= %x41-5A | %x61-7A   ; "A"-"Z" / "a"-"z"
         DIGIT        ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT       ::= %x31-39             ; "1"-"9"
         DOT          ::= %x2E                ; period (".")
         HYPHEN       ::= %x2D                ; hyphen ("-")
         
        Parameters:
        pos - The position in the Schema
        Returns:
        The descr
        Throws:
        LdapSchemaException - If the schema is wrong
      • getDescrRelaxed

        private static String getDescrRelaxed​(OpenLdapSchemaParser.PosSchema pos)
                                       throws LdapSchemaException
        In quirksMode :
         descr        ::= descrQ (COLON numericoid)
         descrQ       ::= keystringQ
         keystringQ   ::= LkeycharQ keycharQ*
         LkeycharQ    ::= ALPHA | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         keycharQ     ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         numericoid   ::= number ( DOT number )+
         number       ::= DIGIT | LDIGIT DIGIT+
         ALPHA        ::= %x41-5A | %x61-7A   ; "A"-"Z" / "a"-"z"
         DIGIT        ::= %x30 | LDIGIT       ; "0"-"9"
         LDIGIT       ::= %x31-39             ; "1"-"9"
         HYPHEN       ::= %x2D                ; hyphen ("-")
         UNDERSCORE   ::= %x5F                ; underscore ("_")
         DOT          ::= %x2E                ; period (".")
         COLON        ::= %x3A                ; colon (":")
         SEMI_COLON   ::= %x3B                ; semi-colon(";")
         SHARP        ::= %x23                ; octothorpe (or sharp sign) ("#")
         
        Parameters:
        pos - The position in the Schema
        Returns:
        The descr
        Throws:
        LdapSchemaException - If the schema is wrong
      • getQDescrStrict

        private static String getQDescrStrict​(Reader reader,
                                              OpenLdapSchemaParser.PosSchema pos)
                                       throws LdapSchemaException,
                                              IOException
         qdescr ::== SQUOTE descr SQUOTE
         descr ::= keystring
         keystring ::= leadkeychar *keychar
         leadkeychar ::= ALPHA
         keychar ::= ALPHA | DIGIT | HYPHEN
         
        In quirksMode :
         qdescr ::== SQUOTE descr SQUOTE | descr | SQUOTE numericoid SQUOTE
         descr ::= keystring
         keystring ::= keychar+
         keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        Returns:
        The QDescr
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • getQDescrRelaxed

        private static String getQDescrRelaxed​(Reader reader,
                                               OpenLdapSchemaParser.PosSchema pos)
                                        throws LdapSchemaException,
                                               IOException
         qdescr ::== SQUOTE descr SQUOTE
         descr ::= keystring
         keystring ::= leadkeychar *keychar
         leadkeychar ::= ALPHA
         keychar ::= ALPHA | DIGIT | HYPHEN
         
        In quirksMode :
         qdescr ::== SQUOTE descr SQUOTE | descr | SQUOTE numericoid SQUOTE
         descr ::= keystring
         keystring ::= keychar+
         keychar ::= ALPHA | DIGIT | HYPHEN | UNDERSCORE | SEMI_COLON | DOT | COLON | SHARP 
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        Returns:
        the QDescr
        Throws:
        IOException - If the stream can't be read
        LdapSchemaException - If the schema is wrong
      • getQDString

        private static String getQDString​(Reader reader,
                                          OpenLdapSchemaParser.PosSchema pos)
                                   throws LdapSchemaException,
                                          IOException
        No relaxed version.
         qdstring ::== SQUOTE dstring SQUOTE
         dstring  ::= ( QS | QQ | QUTF8 )+            ; escaped UTF-8 string
         QS       ::= ESC %x35 ( %x43 | %x63 )        ; "\5C" | "\5c", escape char
         QQ       ::= ESC %x32 %x37                   ; "\27", simple quote char
         QUTF8    ::= QUTF1 | UTFMB
         QUTF1    ::= %x00-26 | %x28-5B | %x5D-7F     ; All ascii but ' and \
         UTFMB    ::= UTF2 | UTF3 | UTF4
         UTF0     ::= %x80-BF
         UTF2     ::= %xC2-DF UTF0
         UTF3     ::= %xE0 %xA0-BF UTF0 | %xE1-EC UTF0 UTF0 | %xED %x80-9F UTF0 | %xEE-EF UTF0 UTF0
         UTF4     ::= %xF0 %x90-BF UTF0 UTF0 | %xF1-F3 UTF0 UTF0 UTF0 | %xF4 %x80-8F UTF0 UTF0
         ESC      ::= %x5C                            ; backslash ("\")
         
        In quirksMode :
         qdstring ::== SQUOTE dstring SQUOTE
         dstring  ::= ( QS | QQ | QUTF8 | ESC )+      ; escaped UTF-8 string or backslash
         QS       ::= ESC %x35 ( %x43 | %x63 )        ; "\5C" | "\5c", escape char
         QQ       ::= ESC %x32 %x37                   ; "\27", simple quote char
         QUTF8    ::= QUTF1 | UTFMB
         QUTF1    ::= %x00-26 | %x28-5B | %x5D-7F     ; All ascii but ' and \
         UTFMB    ::= UTF2 | UTF3 | UTF4
         UTF0     ::= %x80-BF
         UTF2     ::= %xC2-DF UTF0
         UTF3     ::= %xE0 %xA0-BF UTF0 | %xE1-EC UTF0 UTF0 | %xED %x80-9F UTF0 | %xEE-EF UTF0 UTF0
         UTF4     ::= %xF0 %x90-BF UTF0 UTF0 | %xF1-F3 UTF0 UTF0 UTF0 | %xF4 %x80-8F UTF0 UTF0
         ESC      ::= %x5C                            ; backslash ("\")
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        Returns:
        The QDString
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • getQDescrs

        private static List<String> getQDescrs​(Reader reader,
                                               OpenLdapSchemaParser.PosSchema pos,
                                               boolean relaxed)
                                        throws LdapSchemaException,
                                               IOException
         qdescrs ::= qdescr | LPAREN WSP qdescrlist WSP RPAREN
         qdescrlist ::= [ qdescr *( SP qdescr ) ]
         qdescr ::== SQUOTE descr SQUOTE
         descr ::= keystring
         keystring ::= leadkeychar *keychar
         leadkeychar ::= ALPHA
         keychar ::= ALPHA / DIGIT / HYPHEN
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        relaxed - If the schema is to be processed in relaxed mode
        Returns:
        The list of QDescr
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • getQDStrings

        private static List<String> getQDStrings​(Reader reader,
                                                 OpenLdapSchemaParser.PosSchema pos)
                                          throws LdapSchemaException,
                                                 IOException
         qdstrings    ::= qdstring | ( LPAREN WSP qdstringlist WSP RPAREN )
         qdstringlist ::= qdstring *( SP qdstring )*
         qdstring     ::= SQUOTE dstring SQUOTE
         dstring      ::= 1*( QS / QQ / QUTF8 )   ; escaped UTF-8 string
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        Returns:
        The list of QDString
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • processExtension

        private static void processExtension​(Reader reader,
                                             OpenLdapSchemaParser.PosSchema pos,
                                             SchemaObject schemaObject)
                                      throws LdapSchemaException,
                                             IOException
         extension    ::= xstring SP qdstrings
         xstring      ::= "X" HYPHEN ( ALPHA | HYPHEN | USCORE )+
         qdstrings    ::= qdstring | ( LPAREN WSP qdstringlist WSP RPAREN )
         qdstringlist ::= qdstring *( SP qdstring )*
         qdstring     ::= SQUOTE dstring SQUOTE
         dstring      ::= 1*( QS / QQ / QUTF8 )   ; escaped UTF-8 string
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        schemaObject - The SchemaObject
        Throws:
        IOException - If the stream can't be read
        LdapSchemaException - If the schema is wrong
      • getByteCode

        private static String getByteCode​(OpenLdapSchemaParser.PosSchema pos)
        A base64 string
         byteCode ::= ( [a-z] | [A-Z] | [0-9] | '+' | '/' | '=' )*
         
        Parameters:
        pos - The position in the Schema
        Returns:
        The ByteCode
      • parseAttributeType

        public AttributeType parseAttributeType​(String attributeTypeDescription)
                                         throws ParseException
        Production for matching attribute type descriptions. It is fault-tolerant against element ordering.
         AttributeTypeDescription = LPAREN WSP
             numericoid                    ; object identifier
             [ SP "NAME" SP qdescrs ]      ; short names (descriptors)
             [ SP "DESC" SP qdstring ]     ; description
             [ SP "OBSOLETE" ]             ; not active
             [ SP "SUP" SP oid ]           ; supertype
             [ SP "EQUALITY" SP oid ]      ; equality matching rule
             [ SP "ORDERING" SP oid ]      ; ordering matching rule
             [ SP "SUBSTR" SP oid ]        ; substrings matching rule
             [ SP "SYNTAX" SP noidlen ]    ; value syntax
             [ SP "SINGLE-VALUE" ]         ; single-value
             [ SP "COLLECTIVE" ]           ; collective
             [ SP "NO-USER-MODIFICATION" ] ; not user modifiable
             [ SP "USAGE" SP usage ]       ; usage
             extensions WSP RPAREN         ; extensions
         
         usage = "userApplications"     /  ; user
                 "directoryOperation"   /  ; directory operational
                 "distributedOperation" /  ; DSA-shared operational
                 "dSAOperation"            ; DSA-specific operational     
         
         extensions = *( SP xstring SP qdstrings )
         xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE ) 
         
        Parameters:
        attributeTypeDescription - The String containing the AttributeTypeDescription
        Returns:
        An instance of AttributeType
        Throws:
        ParseException - If the element was invalid
      • parseAttributeTypeStrict

        private static AttributeType parseAttributeTypeStrict​(Reader reader,
                                                              OpenLdapSchemaParser.PosSchema pos,
                                                              Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                       throws IOException,
                                                              LdapSchemaException
        Production for matching attribute type descriptions. It is fault-tolerant against element ordering. It's strict.
         AttributeTypeDescription = LPAREN WSP
             numericoid                    ; object identifier
             [ SP "NAME" SP qdescrs ]      ; short names (descriptors)
             [ SP "DESC" SP qdstring ]     ; description
             [ SP "OBSOLETE" ]             ; not active
             [ SP "SUP" SP oid ]           ; supertype
             [ SP "EQUALITY" SP oid ]      ; equality matching rule
             [ SP "ORDERING" SP oid ]      ; ordering matching rule
             [ SP "SUBSTR" SP oid ]        ; substrings matching rule
             [ SP "SYNTAX" SP noidlen ]    ; value syntax
             [ SP "SINGLE-VALUE" ]         ; single-value
             [ SP "COLLECTIVE" ]           ; collective
             [ SP "NO-USER-MODIFICATION" ] ; not user modifiable
             [ SP "USAGE" SP usage ]       ; usage
             extensions WSP RPAREN         ; extensions
         
         usage = "userApplications"     /  ; user
                 "directoryOperation"   /  ; directory operational
                 "distributedOperation" /  ; DSA-shared operational
                 "dSAOperation"            ; DSA-specific operational     
         
         extensions = *( SP xstring SP qdstrings )
         xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE ) 
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of AttributeType
        Throws:
        IOException - If the stream can't be read
        LdapSchemaException - If the schema is wrong
      • parseAttributeTypeRelaxed

        private static AttributeType parseAttributeTypeRelaxed​(Reader reader,
                                                               OpenLdapSchemaParser.PosSchema pos,
                                                               Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                        throws IOException,
                                                               LdapSchemaException
        Production for matching attribute type descriptions. It is fault-tolerant against element ordering. It's relaxed.
         AttributeTypeDescription = LPAREN WSP
             numericoid                    ; object identifier
             [ SP "NAME" SP qdescrs ]      ; short names (descriptors)
             [ SP "DESC" SP qdstring ]     ; description
             [ SP "OBSOLETE" ]             ; not active
             [ SP "SUP" SP oid ]           ; supertype
             [ SP "EQUALITY" SP oid ]      ; equality matching rule
             [ SP "ORDERING" SP oid ]      ; ordering matching rule
             [ SP "SUBSTR" SP oid ]        ; substrings matching rule
             [ SP "SYNTAX" SP noidlen ]    ; value syntax
             [ SP "SINGLE-VALUE" ]         ; single-value
             [ SP "COLLECTIVE" ]           ; collective
             [ SP "NO-USER-MODIFICATION" ] ; not user modifiable
             [ SP "USAGE" SP usage ]       ; usage
             extensions WSP RPAREN         ; extensions
         
         usage = "userApplications"     /  ; user
                 "directoryOperation"   /  ; directory operational
                 "distributedOperation" /  ; DSA-shared operational
                 "dSAOperation"            ; DSA-specific operational     
         
         extensions = *( SP xstring SP qdstrings )
         xstring = "X" HYPHEN 1*( ALPHA / HYPHEN / USCORE ) 
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of AttributeType
        Throws:
        IOException - If the stream can't be read
        LdapSchemaException - If the schema is wrong
      • parseDitContentRule

        public DitContentRule parseDitContentRule​(String ditContentRuleDescription)
                                           throws ParseException
        Production for matching DitContentRule descriptions. It is fault-tolerant against element ordering.
         DITContentRuleDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            [ SP "AUX" SP oids ]       ; auxiliary object classes
            [ SP "MUST" SP oids ]      ; attribute types
            [ SP "MAY" SP oids ]       ; attribute types
            [ SP "NOT" SP oids ]       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        ditContentRuleDescription - The String containing the DitContentRuleDescription
        Returns:
        An instance of ditContentRule
        Throws:
        ParseException - If the element was invalid
      • parseDitContentRuleStrict

        private static DitContentRule parseDitContentRuleStrict​(Reader reader,
                                                                OpenLdapSchemaParser.PosSchema pos,
                                                                Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                         throws IOException,
                                                                LdapSchemaException
        Production for DitContentRule descriptions. It is fault-tolerant against element ordering.
         DITContentRuleDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            [ SP "AUX" SP oids ]       ; auxiliary object classes
            [ SP "MUST" SP oids ]      ; attribute types
            [ SP "MAY" SP oids ]       ; attribute types
            [ SP "NOT" SP oids ]       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of DitContentRule
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseDitContentRuleRelaxed

        private static DitContentRule parseDitContentRuleRelaxed​(Reader reader,
                                                                 OpenLdapSchemaParser.PosSchema pos,
                                                                 Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                          throws IOException,
                                                                 LdapSchemaException
        Production for DitContentRule descriptions. It is fault-tolerant against element ordering.
         DITContentRuleDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            [ SP "AUX" SP oids ]       ; auxiliary object classes
            [ SP "MUST" SP oids ]      ; attribute types
            [ SP "MAY" SP oids ]       ; attribute types
            [ SP "NOT" SP oids ]       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of DitContentRule
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseDitStructureRule

        public DitStructureRule parseDitStructureRule​(String ditStructureRuleDescription)
                                               throws ParseException
        Production for matching DitStructureRule descriptions. It is fault-tolerant against element ordering.
         DITStructureRuleDescription = LPAREN WSP
           ruleid                     ; rule identifier
           [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
           [ SP "DESC" SP qdstring ]  ; description
           [ SP "OBSOLETE" ]          ; not active
           SP "FORM" SP oid           ; NameForm
           [ SP "SUP" ruleids ]       ; superior rules
           extensions WSP RPAREN      ; extensions
        
         ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN )
         ruleidlist = ruleid *( SP ruleid )
         ruleid = number
         
        Parameters:
        ditStructureRuleDescription - The String containing the DitStructureRuleDescription
        Returns:
        An instance of DitStructureRule
        Throws:
        ParseException - If the element was invalid
      • parseDitStructureRuleStrict

        private static DitStructureRule parseDitStructureRuleStrict​(Reader reader,
                                                                    OpenLdapSchemaParser.PosSchema pos)
                                                             throws IOException,
                                                                    LdapSchemaException
        Production for DitStructureRule descriptions. It is fault-tolerant against element ordering.
         DITStructureRuleDescription = LPAREN WSP
           ruleid                     ; rule identifier
           [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
           [ SP "DESC" SP qdstring ]  ; description
           [ SP "OBSOLETE" ]          ; not active
           SP "FORM" SP oid           ; NameForm
           [ SP "SUP" ruleids ]       ; superior rules
           extensions WSP RPAREN      ; extensions
        
         ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN )
         ruleidlist = ruleid *( SP ruleid )
         ruleid = number
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        Returns:
        An instance of DitStructureRule
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseDitStructureRuleRelaxed

        private static DitStructureRule parseDitStructureRuleRelaxed​(Reader reader,
                                                                     OpenLdapSchemaParser.PosSchema pos,
                                                                     Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                              throws IOException,
                                                                     LdapSchemaException
        Production for DitStructureRule descriptions. It is fault-tolerant against element ordering.
         DITStructureRuleDescription = LPAREN WSP
           ruleid                     ; rule identifier
           [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
           [ SP "DESC" SP qdstring ]  ; description
           [ SP "OBSOLETE" ]          ; not active
           SP "FORM" SP oid           ; NameForm
           [ SP "SUP" ruleids ]       ; superior rules
           extensions WSP RPAREN      ; extensions
        
         ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN )
         ruleidlist = ruleid *( SP ruleid )
         ruleid = number
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of DitStructureRule
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseLdapComparator

        public LdapComparatorDescription parseLdapComparator​(String ldapComparatorDescription)
                                                      throws ParseException
        Production for LdapComparator descriptions. It is fault-tolerant against element ordering.
         LdapComparatorDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        ldapComparatorDescription - The String containing the LdapComparatorDescription
        Returns:
        An instance of LdapComparatorDescription
        Throws:
        ParseException - If the element was invalid
      • parseLdapComparatorStrict

        private static LdapComparatorDescription parseLdapComparatorStrict​(Reader reader,
                                                                           OpenLdapSchemaParser.PosSchema pos,
                                                                           Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                                    throws IOException,
                                                                           LdapSchemaException
        Production for LdapComparator descriptions. It is fault-tolerant against element ordering.
         LdapComparatorDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of LdapComparatorDescription
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseLdapComparatorRelaxed

        private static LdapComparatorDescription parseLdapComparatorRelaxed​(Reader reader,
                                                                            OpenLdapSchemaParser.PosSchema pos,
                                                                            Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                                     throws IOException,
                                                                            LdapSchemaException
        Production for LdapComparator descriptions. It is fault-tolerant against element ordering.
         LdapComparatorDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of LdapComparatorDescription
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseLdapSyntax

        public LdapSyntax parseLdapSyntax​(String ldapSyntaxDescription)
                                   throws ParseException
        Production for matching ldap syntax descriptions. It is fault-tolerant against element ordering.
         SyntaxDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "DESC" SP qdstring ]  ; description
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        ldapSyntaxDescription - The String containing the Ldap Syntax description
        Returns:
        An instance of LdapSyntax
        Throws:
        ParseException - If the element was invalid
      • parseLdapSyntaxStrict

        private static LdapSyntax parseLdapSyntaxStrict​(Reader reader,
                                                        OpenLdapSchemaParser.PosSchema pos,
                                                        Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                 throws IOException,
                                                        LdapSchemaException
        Production for matching ldap syntax descriptions. It is fault-tolerant against element ordering.
         SyntaxDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "DESC" SP qdstring ]  ; description
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of LdapSyntax
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseLdapSyntaxRelaxed

        private static LdapSyntax parseLdapSyntaxRelaxed​(Reader reader,
                                                         OpenLdapSchemaParser.PosSchema pos,
                                                         Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                  throws IOException,
                                                         LdapSchemaException
        Production for matching ldap syntax descriptions. It is fault-tolerant against element ordering.
         SyntaxDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "DESC" SP qdstring ]  ; description
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of LdapSyntax
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseMatchingRule

        public MatchingRule parseMatchingRule​(String matchingRuleDescription)
                                       throws ParseException
        Production for matching MatchingRule descriptions. It is fault-tolerant against element ordering.
         MatchingRuleDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "SYNTAX" SP numericoid  ; assertion syntax
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        matchingRuleDescription - The String containing the MatchingRuledescription
        Returns:
        An instance of MatchingRule
        Throws:
        ParseException - If the element was invalid
      • parseMatchingRuleStrict

        private static MatchingRule parseMatchingRuleStrict​(Reader reader,
                                                            OpenLdapSchemaParser.PosSchema pos,
                                                            Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                     throws IOException,
                                                            LdapSchemaException
        Production for matching rule descriptions. It is fault-tolerant against element ordering.
         MatchingRuleDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "SYNTAX" SP numericoid  ; assertion syntax
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of MatchingRule
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseMatchingRuleRelaxed

        private static MatchingRule parseMatchingRuleRelaxed​(Reader reader,
                                                             OpenLdapSchemaParser.PosSchema pos,
                                                             Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                      throws IOException,
                                                             LdapSchemaException
        Production for matching rule descriptions. It is fault-tolerant against element ordering.
         MatchingRuleDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "SYNTAX" SP numericoid  ; assertion syntax
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of MatchingRule
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseMatchingRuleUse

        public MatchingRuleUse parseMatchingRuleUse​(String matchingRuleUseDescription)
                                             throws ParseException
        Production for matching MatchingRuleUse descriptions. It is fault-tolerant against element ordering.
         MatchingRuleUseDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "APPLIES" SP oids       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        matchingRuleUseDescription - The String containing the MatchingRuleUsedescription
        Returns:
        An instance of MatchingRuleUse
        Throws:
        ParseException - If the element was invalid
      • parseMatchingRuleUseStrict

        private static MatchingRuleUse parseMatchingRuleUseStrict​(Reader reader,
                                                                  OpenLdapSchemaParser.PosSchema pos,
                                                                  Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                           throws IOException,
                                                                  LdapSchemaException
        Production for MatchingRuleUse descriptions. It is fault-tolerant against element ordering.
         MatchingRuleUseDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "APPLIES" SP oids       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of MatchingRuleUse
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseMatchingRuleUseRelaxed

        private static MatchingRuleUse parseMatchingRuleUseRelaxed​(Reader reader,
                                                                   OpenLdapSchemaParser.PosSchema pos,
                                                                   Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                            throws IOException,
                                                                   LdapSchemaException
        Production for MatchingRuleUse descriptions. It is fault-tolerant against element ordering.
         MatchingRuleUseDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "APPLIES" SP oids       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of MatchingRuleUse
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseNameForm

        public NameForm parseNameForm​(String nameFormDescription)
                               throws ParseException
        Production for NameForm descriptions. It is fault-tolerant against element ordering.
         NameFormDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "OC" SP oid             ; structural object class
            SP "MUST" SP oids          ; attribute types
            [ SP "MAY" SP oids ]       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        nameFormDescription - The String containing the NameFormdescription
        Returns:
        An instance of NameForm
        Throws:
        ParseException - If the element was invalid
      • parseNameFormStrict

        private static NameForm parseNameFormStrict​(Reader reader,
                                                    OpenLdapSchemaParser.PosSchema pos,
                                                    Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                             throws IOException,
                                                    LdapSchemaException
        Production for NameForm descriptions. It is fault-tolerant against element ordering.
         NameFormDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "OC" SP oid             ; structural object class
            SP "MUST" SP oids          ; attribute types
            [ SP "MAY" SP oids ]       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of NameForm
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseNameFormRelaxed

        private static NameForm parseNameFormRelaxed​(Reader reader,
                                                     OpenLdapSchemaParser.PosSchema pos,
                                                     Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                              throws IOException,
                                                     LdapSchemaException
        Production for NameForm descriptions. It is fault-tolerant against element ordering.
         NameFormDescription = LPAREN WSP
            numericoid                 ; object identifier
            [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
            [ SP "DESC" SP qdstring ]  ; description
            [ SP "OBSOLETE" ]          ; not active
            SP "OC" SP oid             ; structural object class
            SP "MUST" SP oids          ; attribute types
            [ SP "MAY" SP oids ]       ; attribute types
            extensions WSP RPAREN      ; extensions
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of NameForm
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseNormalizer

        public NormalizerDescription parseNormalizer​(String normalizerDescription)
                                              throws ParseException
        Production for Normalizer descriptions. It is fault-tolerant against element ordering.
         NormalizerDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        normalizerDescription - The String containing the NormalizerDescription
        Returns:
        An instance of NormalizerDescription
        Throws:
        ParseException - If the element was invalid
      • parseNormalizerStrict

        private static NormalizerDescription parseNormalizerStrict​(Reader reader,
                                                                   OpenLdapSchemaParser.PosSchema pos,
                                                                   Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                            throws IOException,
                                                                   LdapSchemaException
        Production for Normalizer descriptions. It is fault-tolerant against element ordering.
         NormalizerDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of NormalizerDescription
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseNormalizerRelaxed

        private static NormalizerDescription parseNormalizerRelaxed​(Reader reader,
                                                                    OpenLdapSchemaParser.PosSchema pos,
                                                                    Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                             throws IOException,
                                                                    LdapSchemaException
        Production for Normalizer descriptions. It is fault-tolerant against element ordering.
         NormalizerDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of NormalizerDescription
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseObjectClass

        public ObjectClass parseObjectClass​(String objectClassDescription)
                                     throws ParseException
        Production for matching ObjectClass descriptions. It is fault-tolerant against element ordering.
         ObjectClassDescription = LPAREN WSP
           numericoid                 ; object identifier
           [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
           [ SP "DESC" SP qdstring ]  ; description
           [ SP "OBSOLETE" ]          ; not active
           [ SP "SUP" SP oids ]       ; superior object classes
           [ SP kind ]                ; kind of class
           [ SP "MUST" SP oids ]      ; attribute types
           [ SP "MAY" SP oids ]       ; attribute types
           extensions WSP RPAREN
        
           kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"
         
        Parameters:
        objectClassDescription - The String containing the ObjectClassDescription
        Returns:
        An instance of objectClass
        Throws:
        ParseException - If the element was invalid
      • parseObjectClassStrict

        private static ObjectClass parseObjectClassStrict​(Reader reader,
                                                          OpenLdapSchemaParser.PosSchema pos,
                                                          Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                   throws IOException,
                                                          LdapSchemaException
        Production for matching ObjectClass descriptions. It is fault-tolerant against element ordering.
         ObjectClassDescription = LPAREN WSP
           numericoid                 ; object identifier
           [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
           [ SP "DESC" SP qdstring ]  ; description
           [ SP "OBSOLETE" ]          ; not active
           [ SP "SUP" SP oids ]       ; superior object classes
           [ SP kind ]                ; kind of class
           [ SP "MUST" SP oids ]      ; attribute types
           [ SP "MAY" SP oids ]       ; attribute types
           extensions WSP RPAREN
        
           kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of ObjectClass
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseObjectClassRelaxed

        private static ObjectClass parseObjectClassRelaxed​(Reader reader,
                                                           OpenLdapSchemaParser.PosSchema pos,
                                                           Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                    throws IOException,
                                                           LdapSchemaException
        Production for matching ObjectClass descriptions. It is fault-tolerant against element ordering.
         ObjectClassDescription = LPAREN WSP
           numericoid                 ; object identifier
           [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
           [ SP "DESC" SP qdstring ]  ; description
           [ SP "OBSOLETE" ]          ; not active
           [ SP "SUP" SP oids ]       ; superior object classes
           [ SP kind ]                ; kind of class
           [ SP "MUST" SP oids ]      ; attribute types
           [ SP "MAY" SP oids ]       ; attribute types
           extensions WSP RPAREN
        
           kind = "ABSTRACT" / "STRUCTURAL" / "AUXILIARY"
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of ObjectClass
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseSyntaxChecker

        public SyntaxCheckerDescription parseSyntaxChecker​(String syntaxCheckerDescription)
                                                    throws ParseException
        Production for SyntaxChecker descriptions. It is fault-tolerant against element ordering.
         SyntaxCheckerDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        syntaxCheckerDescription - The String containing the SyntaxCheckerDescription
        Returns:
        An instance of SyntaxCheckerDescription
        Throws:
        ParseException - If the element was invalid
      • parseSyntaxCheckerStrict

        private static SyntaxCheckerDescription parseSyntaxCheckerStrict​(Reader reader,
                                                                         OpenLdapSchemaParser.PosSchema pos,
                                                                         Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                                  throws IOException,
                                                                         LdapSchemaException
        Production for SyntaxChecker descriptions. It is fault-tolerant against element ordering.
         SyntaxCheckerDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of SyntaxCheckerDescription
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • parseSyntaxCheckerRelaxed

        private static SyntaxCheckerDescription parseSyntaxCheckerRelaxed​(Reader reader,
                                                                          OpenLdapSchemaParser.PosSchema pos,
                                                                          Map<String,​OpenLdapObjectIdentifierMacro> objectIdentifierMacros)
                                                                   throws IOException,
                                                                          LdapSchemaException
        Production for SyntaxChecker descriptions. It is fault-tolerant against element ordering.
         SyntaxCheckerDescription = LPAREN WSP
               numericoid                           ; object identifier
               [ SP "DESC" SP qdstring ]            ; description
               SP "FQCN" SP fqcn                    ; fully qualified class name
               [ SP "BYTECODE" SP base64 ]          ; optional base64 encoded bytecode
               extensions WSP RPAREN                ; extensions
         
         base64          = *(4base64-char)
         base64-char     = ALPHA / DIGIT / "+" / "/"
         fqcn = fqcnComponent 1*( DOT fqcnComponent )
         fqcnComponent = ???
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        objectIdentifierMacros - The set of existing Macros
        Returns:
        An instance of SyntaxCheckerDescription
        Throws:
        LdapSchemaException - If the schema is wrong
        IOException - If the stream can't be read
      • processObjectIdentifier

        private void processObjectIdentifier​(Reader reader,
                                             OpenLdapSchemaParser.PosSchema pos)
                                      throws IOException,
                                             LdapSchemaException
        Process OpenLDAP macros, like : objectidentifier DUAConfSchemaOID 1.3.6.1.4.1.11.1.3.1.
         objectidentifier ::= 'objectidentifier' descr SP+ macroOid
         descr             ::= ALPHA ( ALPHA | DIGIT | HYPHEN )*
         macroOid         ::= (descr ':')? oid
         
        Parameters:
        reader - The stream reader
        pos - The position in the Schema
        Throws:
        LdapSchemaException - If something went wrong in the schema
        IOException - If the stream can't be read
      • parse

        public void parse​(Reader reader)
                   throws LdapSchemaException,
                          IOException
        Reads an entry in a ldif buffer, and returns the resulting lines, without comments, and unfolded. The lines represent *one* entry.
        Parameters:
        reader - The stream reader
        Throws:
        LdapSchemaException - If something went wrong in the schema
        IOException - If the stream can't be read
      • parse

        public void parse​(File schemaFile)
                   throws ParseException
        Parses a file of OpenLDAP schemaObject elements/objects. Default charset is used.
        Parameters:
        schemaFile - a file of schema objects
        Throws:
        ParseException - If the schemaObject can't be parsed
      • isResolveObjectIdentifierMacros

        public boolean isResolveObjectIdentifierMacros()
        Checks if object identifier macros should be resolved.
        Returns:
        true, object identifier macros should be resolved.
      • setResolveObjectIdentifierMacros

        public void setResolveObjectIdentifierMacros​(boolean resolveObjectIdentifierMacros)
        Sets if object identifier macros should be resolved.
        Parameters:
        resolveObjectIdentifierMacros - true if object identifier macros should be resolved
      • isQuirksMode

        public boolean isQuirksMode()
        Checks if quirks mode is enabled.
        Returns:
        true, if is quirks mode is enabled
      • 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