本文整理汇总了Java中com.sun.xml.xsom.impl.util.Uri类的典型用法代码示例。如果您正苦于以下问题:Java Uri类的具体用法?Java Uri怎么用?Java Uri使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Uri类属于com.sun.xml.xsom.impl.util包,在下文中一共展示了Uri类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveRelativeURL
import com.sun.xml.xsom.impl.util.Uri; //导入依赖的package包/类
/**
* Resolves relative URI found in the document.
*
* @param namespaceURI
* passed to the entity resolver.
* @param relativeUri
* value of the schemaLocation attribute. Can be null.
*
* @return
* non-null if {@link EntityResolver} returned an {@link InputSource},
* or if the relativeUri parameter seems to be pointing to something.
* Otherwise it returns null, in which case import/include should be abandoned.
*/
private InputSource resolveRelativeURL( String namespaceURI, String relativeUri ) throws SAXException {
try {
String baseUri = getLocator().getSystemId();
if(baseUri==null)
// if the base URI is not available, the document system ID is
// better than nothing.
baseUri=documentSystemId;
String systemId = null;
if(relativeUri!=null)
systemId = Uri.resolve(baseUri,relativeUri);
EntityResolver er = parser.getEntityResolver();
if(er!=null) {
InputSource is = er.resolveEntity(namespaceURI,systemId);
if(is!=null)
return is;
}
if(systemId!=null)
return new InputSource(systemId);
else
return null;
} catch (IOException e) {
SAXParseException se = new SAXParseException(e.getMessage(),getLocator(),e);
parser.errorHandler.error(se);
return null;
}
}
示例2: initUrlMap
import com.sun.xml.xsom.impl.util.Uri; //导入依赖的package包/类
/**
* initialize java.net to objc type mapping
*/
private static void initUrlMap() {
urlMap = new HashMap<String, String>();
urlMap.put(URL.class.getName(), Type.STRING);
urlMap.put(Uri.class.getName(), Type.STRING);
}
示例3: initUrlMap
import com.sun.xml.xsom.impl.util.Uri; //导入依赖的package包/类
/**
* initialize java.net to objc type mapping
*/
private static void initUrlMap() {
urlMap = new HashMap<String, String>();
urlMap.put(URL.class.getName(), PicoType.STRING);
urlMap.put(Uri.class.getName(), PicoType.STRING);
}