本文整理汇总了Java中com.sun.org.apache.xerces.internal.util.URI.MalformedURIException方法的典型用法代码示例。如果您正苦于以下问题:Java URI.MalformedURIException方法的具体用法?Java URI.MalformedURIException怎么用?Java URI.MalformedURIException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xerces.internal.util.URI
的用法示例。
在下文中一共展示了URI.MalformedURIException方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActualValue
import com.sun.org.apache.xerces.internal.util.URI; //导入方法依赖的package包/类
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
// check 3.2.17.c0 must: URI (rfc 2396/2723)
try {
if( content.length() != 0 ) {
// encode special characters using XLink 5.4 algorithm
final String encoded = encode(content);
// Support for relative URLs
// According to Java 1.1: URLs may also be specified with a
// String and the URL object that it is related to.
new URI(BASE_URI, encoded );
}
} catch (URI.MalformedURIException ex) {
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
}
// REVISIT: do we need to return the new URI object?
return content;
}
示例2: resolveSystemId
import com.sun.org.apache.xerces.internal.util.URI; //导入方法依赖的package包/类
/** Resolves a system identifier against a base URI. */
private String resolveSystemId(String systemId, String baseURI) {
try {
return XMLEntityManager.expandSystemId(systemId, baseURI, false);
}
// In the event that resolution failed against the
// base URI, just return the system id as is. There's not
// much else we can do.
catch (URI.MalformedURIException ex) {
return systemId;
}
}
示例3: absolutizeAgainstUserDir
import com.sun.org.apache.xerces.internal.util.URI; //导入方法依赖的package包/类
/**
* Absolutizes a URI using the current value
* of the "user.dir" property as the base URI. If
* the URI is already absolute, this is a no-op.
*
* @param uri the URI to absolutize
*/
public static void absolutizeAgainstUserDir(URI uri)
throws URI.MalformedURIException {
uri.absolutize(getUserDir());
}