Package org.geotools.resources.i18n

Examples of org.geotools.resources.i18n.Errors


     * if {@code level} is non-null, or a {@link String} otherwise.
     */
    private static Object doFormatUnparsable(String text, final int index, int errorIndex,
                                             final Locale locale, final Level level)
    {
        final Errors resources = Errors.getResources(locale);
        final int length = text.length();
        if (errorIndex < index) {
            errorIndex = index;
        }
        if (errorIndex == length) {
            if (level != null) {
                return resources.getLogRecord(level, ErrorKeys.UNEXPECTED_END_OF_STRING);
            }
            return resources.getString(ErrorKeys.UNEXPECTED_END_OF_STRING);
        }
        int upper = errorIndex;
        if (upper < length) {
            final int type = Character.getType(text.charAt(upper));
            while (++upper < length) {
                if (Character.getType(text.charAt(upper)) != type) {
                    break;
                }
            }
        }
        final String error = text.substring(errorIndex, upper);
        text = text.substring(index);
        if (level != null) {
            return resources.getLogRecord(level, ErrorKeys.UNPARSABLE_STRING_$2, text, error);
        }
        return resources.getString(ErrorKeys.UNPARSABLE_STRING_$2, text, error);
    }
View Full Code Here

TOP

Related Classes of org.geotools.resources.i18n.Errors

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.