org.relaxng.datatype.DatatypeException Java Examples

The following examples show how to use org.relaxng.datatype.DatatypeException. 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 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 #2
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 #3
Source File: CompatibilityDatatypeLibrary.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #4
Source File: SchemaBuilderImpl.java    From TencentKona-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 #5
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 #6
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 #7
Source File: CompatibilityDatatypeLibrary.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #8
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 #9
Source File: CompatibilityDatatypeLibrary.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #10
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 #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 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 #13
Source File: CompatibilityDatatypeLibrary.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #14
Source File: CompatibilityDatatypeLibrary.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #15
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 #16
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 #17
Source File: CompatibilityDatatypeLibrary.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #18
Source File: SchemaBuilderImpl.java    From hottub 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 #19
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 #20
Source File: CompatibilityDatatypeLibrary.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    if (type.equals("ID")
        || type.equals("IDREF")
        || type.equals("IDREFS")) {
        if (xsdDatatypeLibrary == null) {
            xsdDatatypeLibrary =
                factory.createDatatypeLibrary(
                    WellKnownNamespaces.XML_SCHEMA_DATATYPES);
            if (xsdDatatypeLibrary == null)
                throw new DatatypeException();
        }
        return xsdDatatypeLibrary.createDatatypeBuilder(type);
    }
    throw new DatatypeException();
}
 
Example #21
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 #22
Source File: SchemaBuilderImpl.java    From openjdk-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();
    }
}
 
Example #23
Source File: SchemaBuilderImpl.java    From openjdk-jdk8u-backup 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 #24
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 #25
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 #26
Source File: SchemaBuilderImpl.java    From openjdk-8-source 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 #27
Source File: BuiltinDatatypeLibrary.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    xsdDatatypeLibrary =
        factory.createDatatypeLibrary(
            WellKnownNamespaces.XML_SCHEMA_DATATYPES);
    if (xsdDatatypeLibrary == null)
        throw new DatatypeException();

    if (type.equals("string") || type.equals("token")) {
        return new BuiltinDatatypeBuilder(
            xsdDatatypeLibrary.createDatatype(type));
    }
    throw new DatatypeException();
}
 
Example #28
Source File: SchemaBuilderImpl.java    From hottub 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 #29
Source File: SchemaBuilderImpl.java    From hottub 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 #30
Source File: BuiltinDatatypeLibrary.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public DatatypeBuilder createDatatypeBuilder(String type)
    throws DatatypeException {
    xsdDatatypeLibrary =
        factory.createDatatypeLibrary(
            WellKnownNamespaces.XML_SCHEMA_DATATYPES);
    if (xsdDatatypeLibrary == null)
        throw new DatatypeException();

    if (type.equals("string") || type.equals("token")) {
        return new BuiltinDatatypeBuilder(
            xsdDatatypeLibrary.createDatatype(type));
    }
    throw new DatatypeException();
}