Class AntlrDnParser

    • Field Detail

      • _tokenSet_0

        public static final antlr.collections.impl.BitSet _tokenSet_0
      • _tokenSet_1

        public static final antlr.collections.impl.BitSet _tokenSet_1
      • _tokenSet_2

        public static final antlr.collections.impl.BitSet _tokenSet_2
      • _tokenSet_3

        public static final antlr.collections.impl.BitSet _tokenSet_3
      • _tokenSet_4

        public static final antlr.collections.impl.BitSet _tokenSet_4
      • _tokenSet_5

        public static final antlr.collections.impl.BitSet _tokenSet_5
    • Constructor Detail

      • AntlrDnParser

        public AntlrDnParser​(antlr.TokenBuffer tokenBuf)
      • AntlrDnParser

        public AntlrDnParser​(antlr.TokenStream lexer)
      • AntlrDnParser

        public AntlrDnParser​(antlr.ParserSharedInputState state)
    • Method Detail

      • distinguishedName

        public final void distinguishedName​(SchemaManager schemaManager,
                                            Dn dn)
                                     throws antlr.RecognitionException,
                                            antlr.TokenStreamException
        Parses a Dn string. RFC 4514, Section 3
         distinguishedName = [ relativeDistinguishedName
             *( COMMA relativeDistinguishedName ) ]
         
        RFC 2253, Section 3
         distinguishedName = [name] 
         name       = name-component *("," name-component)
         
        RFC 1779, Section 2.3
         <name> ::= <name-component> ( <spaced-separator> )
                | <name-component> <spaced-separator> <name>
         <spaced-separator> ::= <optional-space>
                     <separator>
                     <optional-space>
         <separator> ::=  "," | ";"
         <optional-space> ::= ( <CR> ) *( " " )
         
        Parameters:
        schemaManager - The SchemaManager
        dn - The Dn to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • relativeDistinguishedName

        public final void relativeDistinguishedName​(SchemaManager schemaManager,
                                                    Rdn rdn)
                                             throws antlr.RecognitionException,
                                                    antlr.TokenStreamException
        Parses a Rdn string. RFC 4514, Section 3
         relativeDistinguishedName = attributeTypeAndValue
             *( PLUS attributeTypeAndValue )
         
        RFC 2253, Section 3
         name-component = attributeTypeAndValue *("+" attributeTypeAndValue)
         
        RFC 1779, Section 2.3
         <name-component> ::= <attribute>
             | <attribute> <optional-space> "+"
               <optional-space> <name-component>
         
        Parameters:
        schemaManager - The SchemaManager
        rdn - The Rdn to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • relativeDistinguishedNames

        public final String relativeDistinguishedNames​(SchemaManager schemaManager,
                                                       List<Rdn> rdns)
                                                throws antlr.RecognitionException,
                                                       antlr.TokenStreamException
        Parses a Dn string. RFC 4514, Section 3
         distinguishedName = [ relativeDistinguishedName
             *( COMMA relativeDistinguishedName ) ]
         
        RFC 2253, Section 3
         distinguishedName = [name] 
         name       = name-component *("," name-component)
         
        RFC 1779, Section 2.3
         <name> ::= <name-component> ( <spaced-separator> )
                | <name-component> <spaced-separator> <name>
         <spaced-separator> ::= <optional-space>
                     <separator>
                     <optional-space>
         <separator> ::=  "," | ";"
         <optional-space> ::= ( <CR> ) *( " " )
         
        Parameters:
        schemaManager - The SchemaManager
        rdns - The list of Rdns to update
        Returns:
        The normalized Dn
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • attributeTypeAndValue

        public final String attributeTypeAndValue​(SchemaManager schemaManager,
                                                  Rdn rdn)
                                           throws antlr.RecognitionException,
                                                  antlr.TokenStreamException
        RFC 4514, Section 3
         attributeTypeAndValue = attributeType EQUALS attributeValue
         
        RFC 2253, Section 3
         attributeTypeAndValue = attributeType "=" attributeValue
         
        Parameters:
        schemaManager - The SchemaManager
        rdn - The Rdn to update
        Returns:
        The user provided Ava
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • attributeType

        public final String attributeType()
                                   throws antlr.RecognitionException,
                                          antlr.TokenStreamException
        RFC 4514 Section 3
         attributeType = descr / numericoid
         
        Returns:
        The AttributeType
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • attributeValue

        public final void attributeValue​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                                  throws antlr.RecognitionException,
                                         antlr.TokenStreamException
        RFC 4514, Section 3
         attributeValue = string / hexstring
         
        RFC 2253, Section 3
         attributeValue = string
         string     = *( stringchar / pair )
                      / "#" hexstring
                      / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2
        
         We still accept both forms, which means we can have a value surrounded by '"'
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • descr

        public final String descr()
                           throws antlr.RecognitionException,
                                  antlr.TokenStreamException
        RFC 4512 Section 1.4
         descr = keystring
         keystring = leadkeychar *keychar
         leadkeychar = ALPHA
         keychar = ALPHA / DIGIT / HYPHEN
         
        We additionally add UNDERSCORE because some servers allow them.
        Returns:
        The description
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • numericoid

        public final String numericoid()
                                throws antlr.RecognitionException,
                                       antlr.TokenStreamException
        RFC 4512 Section 1.4
         numericoid = number 1*( DOT number )
         number  = DIGIT / ( LDIGIT 1*DIGIT )
         DIGIT   = %x30 / LDIGIT       ; "0"-"9"
         LDIGIT  = %x31-39             ; "1"-"9"
         
        Returns:
        The numeric OID
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • quotestring

        public final void quotestring​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException
        RFC 2253, Section 3
                      / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2
         quotechar     = <any character except "\" or QUOTATION >
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • string

        public final void string​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                          throws antlr.RecognitionException,
                                 antlr.TokenStreamException
        RFC 4514 Section 3
         ; The following characters are to be escaped when they appear
         ; in the value to be encoded: ESC, one of <escaped>, <leading>
         ; SHARP or SPACE, trailing SPACE, and NULL.
         string =   [ ( leadchar / pair ) [ *( stringchar / pair ) ( trailchar / pair ) ] ]
         leadchar = LUTF1 | UTFMB
         stringchar = SUTF1 / UTFMB
         trailchar = TUTF1 / UTFMB
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • hexstring

        public final void hexstring​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
        RFC 4514 Section 3
         hexstring = SHARP 1*hexpair
        
         If in <hexstring> form, a BER representation can be obtained from
         converting each <hexpair> of the <hexstring> to the octet indicated
         by the <hexpair>.
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • pair

        public final void pair​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                        throws antlr.RecognitionException,
                               antlr.TokenStreamException
        RFC 4514, Section 3
         pair = ESC ( ESC / special / hexpair )
         special = escaped / SPACE / SHARP / EQUALS
         escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE
         hexpair = HEX HEX
        
         If in <string> form, a LDAP string representation asserted value can
         be obtained by replacing (left to right, non-recursively) each <pair>
         appearing in the <string> as follows:
           replace <ESC><ESC> with <ESC>;
           replace <ESC><special> with <special>;
           replace <ESC><hexpair> with the octet indicated by the <hexpair>.
         
        RFC 2253, Section 3
         pair       = "\" ( special / "\" / QUOTATION / hexpair )
         special    = "," / "=" / "+" / "<" /  ">" / "#" / ";"
         
        RFC 1779, Section 2.3
         <pair> ::= "\" ( <special> | "\" | '"')
         <special> ::= "," | "=" | <CR> | "+" | "<" |  ">"
                   | "#" | ";"
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • lutf1

        public final void lutf1​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                         throws antlr.RecognitionException,
                                antlr.TokenStreamException
        RFC 4514, Section 3:
         LUTF1 = %x01-1F / %x21 / %x24-2A / %x2D-3A /
            %x3D / %x3F-5B / %x5D-7F
        
         The rule CHAR_REST doesn't contain the following charcters,
         so we must check them additionally
           EQUALS (0x3D)
           HYPHEN (0x2D)
           UNDERSCORE (0x5F)
           DIGIT (0x30-0x39)
           ALPHA (0x41-0x5A and 0x61-0x7A)
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • utfmb

        public final void utfmb​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                         throws antlr.RecognitionException,
                                antlr.TokenStreamException
        Process a UTFMB char
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • sutf1

        public final void sutf1​(org.apache.directory.api.ldap.model.name.AntlrDnParser.UpAndNormValue value)
                         throws antlr.RecognitionException,
                                antlr.TokenStreamException
        RFC 4514, Section 3:
         SUTF1 = %x01-21 / %x23-2A / %x2D-3A /
            %x3D / %x3F-5B / %x5D-7F
        
         The rule CHAR_REST doesn't contain the following charcters,
         so we must check them additionally
           EQUALS (0x3D)
           HYPHEN (0x2D)
           UNDERSCORE (0x5F)
           DIGIT (0x30-0x39)
           ALPHA (0x41-0x5A and 0x61-0x7A)
           SHARP (0x23)
           SPACE (0x20)
         
        Parameters:
        value - The value to update
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token
      • special

        public final char special()
                           throws antlr.RecognitionException,
                                  antlr.TokenStreamException
        RFC 4514 Section 3
         special = escaped / SPACE / SHARP / EQUALS
         escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE
         
        Returns:
        The special char
        Throws:
        antlr.RecognitionException - If the token is invalid
        antlr.TokenStreamException - When we weren't able to fetch a token