本文整理匯總了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);
}