本文整理汇总了Java中org.relaxng.datatype.DatatypeException.UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java DatatypeException.UNKNOWN属性的具体用法?Java DatatypeException.UNKNOWN怎么用?Java DatatypeException.UNKNOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.relaxng.datatype.DatatypeException
的用法示例。
在下文中一共展示了DatatypeException.UNKNOWN属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addParam
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: DataDerivFailure
private DataDerivFailure(Datatype datatype, Name datatypeName, List<String> datatypeParams, String message, int index) {
this.datatype = datatype;
this.datatypeName = datatypeName;
this.datatypeParams = datatypeParams;
this.message = message;
this.except = null;
this.index = index == DatatypeException.UNKNOWN ? -1 : index;
this.stringValue = null;
this.value = null;
}
示例3: addParam
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);
}
}
示例4: addPatternParam
private void addPatternParam(String value) throws DatatypeException {
try {
base = new PatternRestrictDatatype(base,
library.getRegexEngine().compile(value),
value);
}
catch (RegexSyntaxException e) {
int pos = e.getPosition();
if (pos == RegexSyntaxException.UNKNOWN_POSITION)
pos = DatatypeException.UNKNOWN;
error("invalid_regex", e.getMessage(), pos);
}
}