本文整理汇总了Java中org.relaxng.datatype.DatatypeException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java DatatypeException.getMessage方法的具体用法?Java DatatypeException.getMessage怎么用?Java DatatypeException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.relaxng.datatype.DatatypeException
的用法示例。
在下文中一共展示了DatatypeException.getMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addParam
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
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);
}
}
}
示例2: makeDataPatternBuilder
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
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();
}
示例3: makeDataPatternBuilder
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public DataPatternBuilder<Pattern, Locator, VoidValue, CommentListImpl, AnnotationsImpl> makeDataPatternBuilder(String datatypeLibrary, String type, Locator loc)
throws BuildException {
DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary);
if (dl == null)
error("unrecognized_datatype_library", datatypeLibrary, loc);
else {
try {
return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type), new Name(datatypeLibrary, type));
}
catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null)
error("unsupported_datatype_detail", datatypeLibrary, type, detail, loc);
else
error("unrecognized_datatype", datatypeLibrary, type, loc);
}
}
return new DummyDataPatternBuilder();
}
示例4: DataPatternBuilderImpl
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
DataPatternBuilderImpl(DataPattern p) throws BuildException {
this.p = p;
DatatypeLibrary dl = dlf.createDatatypeLibrary(p.getDatatypeLibrary());
if (dl != null) {
try {
dtb = dl.createDatatypeBuilder(p.getType());
}
catch (DatatypeException e) {
String datatypeLibrary = p.getDatatypeLibrary();
String type = p.getType();
SourceLocation loc = p.getSourceLocation();
String detail = e.getMessage();
if (detail != null)
error("unsupported_datatype_detail", datatypeLibrary, type, detail, loc);
else
error("unknown_datatype", datatypeLibrary, type, loc);
}
}
}
示例5: makePattern
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
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();
}
}
示例6: addParam
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public void addParam(String name, String value, Context context, String ns, Locator loc, AnnotationsImpl anno)
throws BuildException {
try {
dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
params.add(name);
params.add(value);
}
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, loc);
else
error("invalid_param_display", displayedParam, loc);
}
else if (detail != null)
error("invalid_param_detail", detail, loc);
else
error("invalid_param", loc);
}
}
示例7: makePattern
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
public Pattern makePattern(Locator loc, AnnotationsImpl anno)
throws BuildException {
try {
return pb.makeData(dtb.createDatatype(), dtName, params);
}
catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null)
error("invalid_params_detail", detail, loc);
else
error("invalid_params", loc);
return pb.makeError();
}
}
示例8: diagnoseDatatypeException
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
private void diagnoseDatatypeException(String detailKey, String noDetailKey, DatatypeException e, SourceLocation loc)
throws BuildException {
String detail = e.getMessage();
if (detail != null)
error(detailKey, detail, loc);
else
error(noDetailKey, loc);
}
示例9: testCreateDatatype
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
@Test
public void testCreateDatatype() throws DatatypeException {
Datatype dt = lib.createDatatype("integer");
try {
dt.checkValid("foo", null);
}
catch (DatatypeException e) {
String message = e.getMessage();
Assert.assertNotNull(message);
Assert.assertTrue(message.contains("integer"));
}
}
示例10: DataDerivFailure
import org.relaxng.datatype.DatatypeException; //导入方法依赖的package包/类
DataDerivFailure(DataPattern p, DatatypeException e) {
this(p.getDatatype(), p.getDatatypeName(), p.getParams(), e.getMessage(), e.getIndex());
}