Package org.ldaptive.dn
Class DefaultDnParser
java.lang.Object
org.ldaptive.dn.DefaultDnParser
- All Implemented Interfaces:
DnParser
Parses DNs following the rules in RFC 4514. Attempts to be as
generous as possible in the format of allowed DNs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classParse handler for decoding octet strings. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]decodeHexValue(char[] value) Decodes the supplied hexadecimal value.private static StringdecodeStringValue(String value) Decodes the supplied string attribute value.Parses the supplied DN into a list of RDNs.private static int[]readToChar(String s, char[] chars, int pos) Reads the supplied string starting at the supplied position until one of the supplied characters is found.
-
Field Details
-
HEX_PATH
DER path for hex values.
-
-
Constructor Details
-
DefaultDnParser
public DefaultDnParser()
-
-
Method Details
-
parse
Parses the supplied DN into a list of RDNs. -
decodeHexValue
private static byte[] decodeHexValue(char[] value) Decodes the supplied hexadecimal value.- Parameters:
value- hex to decode- Returns:
- decoded bytes
-
decodeStringValue
Decodes the supplied string attribute value. Unescapes escaped characters. If escaped character is a hex value, it is decoded.- Parameters:
value- to decode- Returns:
- decoded string
-
readToChar
Reads the supplied string starting at the supplied position until one of the supplied characters is found. Characters escaped with '\' are ignored. Characters inside of quotes are ignored.- Parameters:
s- to readchars- to matchpos- to start reading at- Returns:
- string index that matched a character or the last index in the string
-