private static void setAttributesFromKeywords(ULocale loc, Collator coll, RuleBasedCollator rbc) {
        // Check for collation keywords that were already deprecated
        // before any were supported in createInstance() (except for "collation").
        String value = loc.getKeywordValue("colHiraganaQuaternary");
        if (value != null) {
            throw new UnsupportedOperationException("locale keyword kh/colHiraganaQuaternary");
        }
        value = loc.getKeywordValue("variableTop");
        if (value != null) {
            throw new UnsupportedOperationException("locale keyword vt/variableTop");
        }
        // Parse known collation keywords, ignore others.
        value = loc.getKeywordValue("colStrength");
        if (value != null) {
            // Note: Not supporting typo "quarternary" because it was never supported in locale IDs.
            int strength = getIntValue("colStrength", value,
                    "primary", "secondary", "tertiary", "quaternary", "identical");
            coll.setStrength(strength <= Collator.QUATERNARY ? strength : Collator.IDENTICAL);
        }
        value = loc.getKeywordValue("colBackwards");
        if (value != null) {
            if (rbc != null) {
                rbc.setFrenchCollation(getYesOrNo("colBackwards", value));
            } else {
                throw new UnsupportedOperationException(
                        "locale keyword kb/colBackwards only settable for RuleBasedCollator");
            }
        }
        value = loc.getKeywordValue("colCaseLevel");
        if (value != null) {
            if (rbc != null) {
                rbc.setCaseLevel(getYesOrNo("colCaseLevel", value));
            } else {
                throw new UnsupportedOperationException(
                        "locale keyword kb/colBackwards only settable for RuleBasedCollator");
            }
        }
        value = loc.getKeywordValue("colCaseFirst");
        if (value != null) {
            if (rbc != null) {
                int cf = getIntValue("colCaseFirst", value, "no", "lower", "upper");
                if (cf == 0) {
                    rbc.setLowerCaseFirst(false);
                    rbc.setUpperCaseFirst(false);
                } else if (cf == 1) {
                    rbc.setLowerCaseFirst(true);
                } else /* cf == 2 */ {
                    rbc.setUpperCaseFirst(true);
                }
            } else {
                throw new UnsupportedOperationException(
                        "locale keyword kf/colCaseFirst only settable for RuleBasedCollator");
            }
        }
        value = loc.getKeywordValue("colAlternate");
        if (value != null) {
            if (rbc != null) {
                rbc.setAlternateHandlingShifted(
                        getIntValue("colAlternate", value, "non-ignorable", "shifted") != 0);
            } else {
                throw new UnsupportedOperationException(
                        "locale keyword ka/colAlternate only settable for RuleBasedCollator");
            }
        }
        value = loc.getKeywordValue("colNormalization");
        if (value != null) {
            coll.setDecomposition(getYesOrNo("colNormalization", value) ?
                    Collator.CANONICAL_DECOMPOSITION : Collator.NO_DECOMPOSITION);
        }
        value = loc.getKeywordValue("colNumeric");
        if (value != null) {
            if (rbc != null) {
                rbc.setNumericCollation(getYesOrNo("colNumeric", value));
            } else {
                throw new UnsupportedOperationException(
                        "locale keyword kn/colNumeric only settable for RuleBasedCollator");
            }
        }
        value = loc.getKeywordValue("colReorder");
        if (value != null) {
            int[] codes = new int[UScript.CODE_LIMIT + Collator.ReorderCodes.LIMIT - Collator.ReorderCodes.FIRST];
            int codesLength = 0;
            int scriptNameStart = 0;
            for (;;) {
                if (codesLength == codes.length) {
                    throw new IllegalArgumentException(
                            "too many script codes for colReorder locale keyword: " + value);
                }
                int limit = scriptNameStart;
                while (limit < value.length() && value.charAt(limit) != '-') { ++limit; }
                String scriptName = value.substring(scriptNameStart, limit);
                int code;
                if (scriptName.length() == 4) {
                    // Strict parsing, accept only 4-letter script codes, not long names.
                    code = UCharacter.getPropertyValueEnum(UProperty.SCRIPT, scriptName);
                } else {
                    code = getReorderCode("colReorder", scriptName);
                }
                codes[codesLength++] = code;
                if (limit == value.length()) { break; }
                scriptNameStart = limit + 1;
            }
            if (codesLength == 0) {
                throw new IllegalArgumentException("no script codes for colReorder locale keyword");
            }
            int[] args = new int[codesLength];
            System.arraycopy(codes, 0, args, 0, codesLength);
            coll.setReorderCodes(args);
        }
        value = loc.getKeywordValue("kv");
        if (value != null) {
            coll.setMaxVariable(getReorderCode("kv", value));
        }
    }
private static void setAttributesFromKeywords ( ULocale loc , Collator coll , RuleBasedCollator rbc ) { String value = loc . getKeywordValue ( "colHiraganaQuaternary" ) ; if ( value != null ) { throw new UnsupportedOperationException ( "locale keyword kh/colHiraganaQuaternary" ) ; } value = loc . getKeywordValue ( "variableTop" ) ; if ( value != null ) { throw new UnsupportedOperationException ( "locale keyword vt/variableTop" ) ; } value = loc . getKeywordValue ( "colStrength" ) ; if ( value != null ) { int strength = getIntValue ( "colStrength" , value , "primary" , "secondary" , "tertiary" , "quaternary" , "identical" ) ; coll . setStrength ( strength <= Collator . QUATERNARY ? strength : Collator . IDENTICAL ) ; } value = loc . getKeywordValue ( "colBackwards" ) ; if ( value != null ) { if ( rbc != null ) { rbc . setFrenchCollation ( getYesOrNo ( "colBackwards" , value ) ) ; } else { throw new UnsupportedOperationException ( "locale keyword kb/colBackwards only settable for RuleBasedCollator" ) ; } } value = loc . getKeywordValue ( "colCaseLevel" ) ; if ( value != null ) { if ( rbc != null ) { rbc . setCaseLevel ( getYesOrNo ( "colCaseLevel" , value ) ) ; } else { throw new UnsupportedOperationException ( "locale keyword kb/colBackwards only settable for RuleBasedCollator" ) ; } } value = loc . getKeywordValue ( "colCaseFirst" ) ; if ( value != null ) { if ( rbc != null ) { int cf = getIntValue ( "colCaseFirst" , value , "no" , "lower" , "upper" ) ; if ( cf == 0 ) { rbc . setLowerCaseFirst ( false ) ; rbc . setUpperCaseFirst ( false ) ; } else if ( cf == 1 ) { rbc . setLowerCaseFirst ( true ) ; } else { rbc . setUpperCaseFirst ( true ) ; } } else { throw new UnsupportedOperationException ( "locale keyword kf/colCaseFirst only settable for RuleBasedCollator" ) ; } } value = loc . getKeywordValue ( "colAlternate" ) ; if ( value != null ) { if ( rbc != null ) { rbc . setAlternateHandlingShifted ( getIntValue ( "colAlternate" , value , "non-ignorable" , "shifted" ) != 0 ) ; } else { throw new UnsupportedOperationException ( "locale keyword ka/colAlternate only settable for RuleBasedCollator" ) ; } } value = loc . getKeywordValue ( "colNormalization" ) ; if ( value != null ) { coll . setDecomposition ( getYesOrNo ( "colNormalization" , value ) ? Collator . CANONICAL_DECOMPOSITION : Collator . NO_DECOMPOSITION ) ; } value = loc . getKeywordValue ( "colNumeric" ) ; if ( value != null ) { if ( rbc != null ) { rbc . setNumericCollation ( getYesOrNo ( "colNumeric" , value ) ) ; } else { throw new UnsupportedOperationException ( "locale keyword kn/colNumeric only settable for RuleBasedCollator" ) ; } } value = loc . getKeywordValue ( "colReorder" ) ; if ( value != null ) { int [ ] codes = new int [ UScript . CODE_LIMIT + Collator . ReorderCodes . LIMIT - Collator . ReorderCodes . FIRST ] ; int codesLength = 0 ; int scriptNameStart = 0 ; for ( ; ; ) { if ( codesLength == codes . length ) { throw new IllegalArgumentException ( "too many script codes for colReorder locale keyword: " + value ) ; } int limit = scriptNameStart ; while ( limit < value . length ( ) && value . charAt ( limit ) != '-' ) { ++ limit ; } String scriptName = value . substring ( scriptNameStart , limit ) ; int code ; if ( scriptName . length ( ) == 4 ) { code = UCharacter . getPropertyValueEnum ( UProperty . SCRIPT , scriptName ) ; } else { code = getReorderCode ( "colReorder" , scriptName ) ; } codes [ codesLength ++ ] = code ; if ( limit == value . length ( ) ) { break ; } scriptNameStart = limit + 1 ; } if ( codesLength == 0 ) { throw new IllegalArgumentException ( "no script codes for colReorder locale keyword" ) ; } int [ ] args = new int [ codesLength ] ; System . arraycopy ( codes , 0 , args , 0 , codesLength ) ; coll . setReorderCodes ( args ) ; } value = loc . getKeywordValue ( "kv" ) ; if ( value != null ) { coll . setMaxVariable ( getReorderCode ( "kv" , value ) ) ; } }
Sets collation attributes according to locale keywords. See
http://www.unicode.org/reports/tr35/tr35-collation.html#Collation_Settings

Using "alias" keywords and values where defined:
http://www.unicode.org/reports/tr35/tr35.html#Old_Locale_Extension_Syntax
http://unicode.org/repos/cldr/trunk/common/bcp47/collation.xml