private String getErrorContext(int lineNumberWithError) {
            if (!(reader instanceof StringReader)) return "";

            int fromLine = Math.max(0, lineNumberWithError - linesOfContextForErrors);
            int toLine = lineNumberWithError + linesOfContextForErrors;

            LineNumberReader r = new LineNumberReader(reader);
            StringBuilder sb = new StringBuilder();
            String line;
            try {
                reader.reset();
                while ((line = r.readLine()) != null) {
                    int lineNumber = r.getLineNumber();
                    if (lineNumber >= fromLine && lineNumber <= toLine)
                        sb.append(lineNumber).append(":").append(line).append("\n");
                }
            } catch (IOException e) {
                e.printStackTrace();
            }

            return sb.toString();
        }
Initializes the validator by using the given file as schema file

@param schemaFile schema file
@throws IOException if it is not possible to read schema files
config-application-package/src/main/java/com/yahoo/config/model/application/provider/SchemaValidator.java