private static Integer parseIntegerFromChildSequence()

in src/main/java/org/apache/maven/xinclude/stax/ElementPointerPart.java [231:244]


    private static Integer parseIntegerFromChildSequence(String string, int start, int end)
            throws InvalidXPointerException {
        if (start < end) { // Make sure sub string is not of zero length.
            try { // Make sure the integer is valid.
                return Integer.valueOf(string.substring(start, end));
            } catch (NumberFormatException e) {
                throw new InvalidXPointerException(
                        "The child sequence part contained an invalid integer.", string, start, end);
            }
        } else {
            throw new InvalidXPointerException(
                    "The child sequence part contained an empty item at " + String.valueOf(start), string, start, end);
        }
    }