Java Code Examples for org.relaxng.datatype.DatatypeException#getMessage()

The following examples show how to use org.relaxng.datatype.DatatypeException#getMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchemaBuilderImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
        throws BuildException {
    DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
    if (dl == null) {
        error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
    } else {
        try {
            return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
        } catch (DatatypeException e) {
            String detail = e.getMessage();
            if (detail != null) {
                error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
            } else {
                error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
            }
        }
    }
    return new DummyDataPatternBuilder();
}
 
Example 2
Source File: SchemaBuilderImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
        throws BuildException {
    DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
    if (dl == null) {
        error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
    } else {
        try {
            return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
        } catch (DatatypeException e) {
            String detail = e.getMessage();
            if (detail != null) {
                error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
            } else {
                error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
            }
        }
    }
    return new DummyDataPatternBuilder();
}
 
Example 3
Source File: SchemaBuilderImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example 4
Source File: SchemaBuilderImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
        throws BuildException {
    DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
    if (dl == null) {
        error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
    } else {
        try {
            return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
        } catch (DatatypeException e) {
            String detail = e.getMessage();
            if (detail != null) {
                error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
            } else {
                error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
            }
        }
    }
    return new DummyDataPatternBuilder();
}
 
Example 5
Source File: SchemaBuilderImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
        throws BuildException {
    DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
    if (dl == null) {
        error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
    } else {
        try {
            return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
        } catch (DatatypeException e) {
            String detail = e.getMessage();
            if (detail != null) {
                error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
            } else {
                error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
            }
        }
    }
    return new DummyDataPatternBuilder();
}
 
Example 6
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example 7
Source File: SchemaBuilderImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example 8
Source File: SchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example 9
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
        throws BuildException {
    DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
    if (dl == null) {
        error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
    } else {
        try {
            return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
        } catch (DatatypeException e) {
            String detail = e.getMessage();
            if (detail != null) {
                error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
            } else {
                error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
            }
        }
    }
    return new DummyDataPatternBuilder();
}
 
Example 10
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example 11
Source File: SchemaBuilderImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example 12
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc)
        throws BuildException {
    DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
    if (dl == null) {
        error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc);
    } else {
        try {
            return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
        } catch (DatatypeException e) {
            String detail = e.getMessage();
            if (detail != null) {
                error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc);
            } else {
                error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc);
            }
        }
    }
    return new DummyDataPatternBuilder();
}
 
Example 13
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 14
Source File: SchemaBuilderImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeData(dtb.createDatatype());
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 15
Source File: SchemaBuilderImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 16
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 17
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeData(dtb.createDatatype());
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 18
Source File: SchemaBuilderImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeData(dtb.createDatatype());
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 19
Source File: SchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
 
Example 20
Source File: SchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makePattern(Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeData(dtb.createDatatype());
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}