Package org.ldaptive.dn
Class DefaultDnParser
- java.lang.Object
-
- org.ldaptive.dn.DefaultDnParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DefaultDnParser.OctetStringHandler
Parse handler for decoding octet strings.
-
Constructor Summary
Constructors Constructor Description DefaultDnParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static byte[]
decodeHexValue(char[] value)
Decodes the supplied hexadecimal value.private static String
decodeStringValue(String value)
Decodes the supplied string attribute value.List<RDn>
parse(String dn)
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 Detail
-
HEX_RADIX
private static final int HEX_RADIX
Hexadecimal radix.- See Also:
- Constant Field Values
-
HEX_PATH
private static final DERPath HEX_PATH
DER path for hex values.
-
-
Method Detail
-
decodeHexValue
private static byte[] decodeHexValue(char[] value)
Decodes the supplied hexadecimal value.- Parameters:
value
- hex to decode- Returns:
- decoded bytes
-
decodeStringValue
private static String decodeStringValue(String value)
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
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. 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
-
-