Package org.apache.sis.internal.util

Examples of org.apache.sis.internal.util.LocalizedParseException


                c = text.codePointAt(i);
                n = Character.charCount(c);
            } while (Character.isSpaceChar(c) || Character.isISOControl(c));
            pos.setErrorIndex(i);
        }
        throw new LocalizedParseException(getLocale(), getValueType(), text, pos);
    }
View Full Code Here


    public Object parseObject(String source) throws ParseException {
        source = CharSequences.trimWhitespaces(source);
        try {
            return valueOf(source);
        } catch (NumberFormatException cause) {
            ParseException e = new LocalizedParseException(null, type, source, null);
            e.initCause(cause);
            throw e;
        }
    }
View Full Code Here

        final ParsePosition pos = new ParsePosition(0);
        final Angle angle = parse(source, pos, true);
        final int offset = pos.getIndex();
        final int length = source.length();
        if (skipSpaces(source, offset, length) < length) {
            throw new LocalizedParseException(locale, Angle.class, source, pos);
        }
        return angle;
    }
View Full Code Here

                     * Note that lastNode.getParent() should never return null, since only the
                     * node at 'indentationLevel == 0' has a null parent and we check that case.
                     */
                    if (--indentationLevel < 0) {
                        pos.setErrorIndex(indexOfLineStart);
                        throw new LocalizedParseException(getLocale(),
                                Errors.Keys.NodeHasNoParent_1, new Object[] {node}, 0);
                    }
                    lastNode = lastNode.getParent();
                }
                if (i == p) {
                    /*
                     * The node we just created is a sibling of the previous node. This is
                     * illegal if level==0, in which case we have no parent. Otherwise add
                     * the sibling to the common parent and let the indentation level unchanged.
                     */
                    final TreeTable.Node parent = lastNode.getParent();
                    if (parent == null) {
                        pos.setErrorIndex(indexOfLineStart);
                        throw new LocalizedParseException(getLocale(),
                                Errors.Keys.NodeHasNoParent_1, new Object[] {node}, 0);
                    }
                    parent.getChildren().add(node);
                } else if (i > p) {
                    /*
 
View Full Code Here

    public Object parseObject(String source) throws ParseException {
        source = CharSequences.trimWhitespaces(source);
        try {
            return valueOf(source);
        } catch (NumberFormatException cause) {
            ParseException e = new LocalizedParseException(null, type, source, null);
            e.initCause(cause);
            throw e;
        }
    }
View Full Code Here

                c = text.codePointAt(i);
                n = Character.charCount(c);
            } while (Character.isSpaceChar(c) || Character.isISOControl(c));
            pos.setErrorIndex(i);
        }
        throw new LocalizedParseException(getLocale(), getValueType(), text, pos);
    }
View Full Code Here

                     * Note that lastNode.getParent() should never return null, since only the
                     * node at 'indentationLevel == 0' has a null parent and we check that case.
                     */
                    if (--indentationLevel < 0) {
                        pos.setErrorIndex(indexOfLineStart);
                        throw new LocalizedParseException(getDisplayLocale(),
                                Errors.Keys.NodeHasNoParent_1, new Object[] {node}, 0);
                    }
                    lastNode = lastNode.getParent();
                }
                if (i == p) {
                    /*
                     * The node we just created is a sibling of the previous node. This is
                     * illegal if level==0, in which case we have no parent. Otherwise add
                     * the sibling to the common parent and let the indentation level unchanged.
                     */
                    final TreeTable.Node parent = lastNode.getParent();
                    if (parent == null) {
                        pos.setErrorIndex(indexOfLineStart);
                        throw new LocalizedParseException(getDisplayLocale(),
                                Errors.Keys.NodeHasNoParent_1, new Object[] {node}, 0);
                    }
                    parent.getChildren().add(node);
                } else if (i > p) {
                    /*
 
View Full Code Here

        final ParsePosition pos = new ParsePosition(0);
        final Angle angle = parse(source, pos, true);
        final int offset = pos.getIndex();
        final int length = source.length();
        if (skipSpaces(source, offset, length) < length) {
            throw new LocalizedParseException(locale, Angle.class, source, pos);
        }
        return angle;
    }
View Full Code Here

TOP

Related Classes of org.apache.sis.internal.util.LocalizedParseException

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.