private static Character resolveChar(String value, Character defVal) {
        if (null == value) {
            return defVal;
        }
        switch (value.length()) {
            case 0:
                return defVal;
            case 1:
                return value.charAt(0);
            default:
                if (value.startsWith("\\")) {
                    if (value.length() == 2) {
                        Character c = PREDEFINED_CHARS.get(value);
                        if (null != c) {
                            return c;
                        }
                    }
                    try {
                        String s = value.substring(1);
                        if (s.startsWith("u")) {
                            int i = Integer.parseInt(s.substring(1), 16);
                            if (i > Character.MAX_VALUE || i < Character.MIN_VALUE) {
                                throw new IllegalArgumentException("Invalid character: " + value);
                            }
                            return (char) i;
                        } else if (s.length() > 3) {
                            throw new IllegalArgumentException("Invalid character: " + value);
                        } else {
                            if (s.length() == 3) {
                                int i = Integer.parseInt(s.substring(0, 1));
                                if (i > 3) {
                                    throw new IllegalArgumentException("Invalid character: " + value);
                                }
                            }
                            int i = Integer.parseInt(s, 8);
                            return (char) i;
                        }
                    } catch (NumberFormatException e) {
                        throw new IllegalArgumentException("Invalid character: " + value);
                    }
                } else {
                    throw new IllegalArgumentException("Invalid character: " + value);
                }
        }
    }
private static Character resolveChar ( String value , Character defVal ) { if ( null == value ) { return defVal ; } switch ( value . length ( ) ) { case 0 : return defVal ; case 1 : return value . charAt ( 0 ) ; default : if ( value . startsWith ( "\\" ) ) { if ( value . length ( ) == 2 ) { Character c = PREDEFINED_CHARS . get ( value ) ; if ( null != c ) { return c ; } } try { String s = value . substring ( 1 ) ; if ( s . startsWith ( "u" ) ) { int i = Integer . parseInt ( s . substring ( 1 ) , 16 ) ; if ( i > Character . MAX_VALUE || i < Character . MIN_VALUE ) { throw new IllegalArgumentException ( "Invalid character: " + value ) ; } return ( char ) i ; } else if ( s . length ( ) > 3 ) { throw new IllegalArgumentException ( "Invalid character: " + value ) ; } else { if ( s . length ( ) == 3 ) { int i = Integer . parseInt ( s . substring ( 0 , 1 ) ) ; if ( i > 3 ) { throw new IllegalArgumentException ( "Invalid character: " + value ) ; } } int i = Integer . parseInt ( s , 8 ) ; return ( char ) i ; } } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Invalid character: " + value ) ; } } else { throw new IllegalArgumentException ( "Invalid character: " + value ) ; } } }
Parsing String into char. The rules are:

1. if there value is null or empty length String then return `defval` specified
2. if the length of the String is `1`, then return that one char in the string
3. if the value not starts with '\', then throw `IllegalArgumentException`
4. if the value starts with `\\u` then parse the integer using `16` radix. The check
the range, if it fall into Character range, then return that number, otherwise raise
`IllegalArgumentException`
5. if the value length is 2 then check if it one of {@link #PREDEFINED_CHARS}, if found
then return
6. check if it valid OctalEscape defined in the <a href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6">spec</a>
if pass the check then return that char
7. all other cases throw `IllegalArgumentException`

@param value the string value to be resolved
@param defVal the default value when string value is `null` or empty
@return the char resolved from the string