public class DefaultURIResolver extends java.lang.Object implements CollectionURIResolver
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
collectionBaseURI |
| Constructor and Description |
|---|
DefaultURIResolver() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCollectionBaseURI()
Get the base URI derived from a schema collection.
|
protected java.net.URL |
getFileURL(java.net.URL contextURL,
java.lang.String path)
Method getFileURL
|
protected java.net.URL |
getURL(java.net.URL contextURL,
java.lang.String spec)
This is essentially a call to "new URL(contextURL, spec)" with extra handling in case spec is a file.
|
protected boolean |
isAbsolute(java.lang.String uri)
Find whether a given uri is relative or not
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String namespace,
java.lang.String schemaLocation,
java.lang.String baseUri)
Try to resolve a schema location to some data.
|
void |
setCollectionBaseURI(java.lang.String collectionBaseURI)
set the collection base URI, which serves as a fallback from the base of the immediate schema.
|
public org.xml.sax.InputSource resolveEntity(java.lang.String namespace,
java.lang.String schemaLocation,
java.lang.String baseUri)
resolveEntity in interface URIResolvernamespace - target namespace.schemaLocation - system ID.baseUri - base URI for the schema.protected boolean isAbsolute(java.lang.String uri)
uri - protected java.net.URL getURL(java.net.URL contextURL,
java.lang.String spec)
throws java.io.IOException
contextURL - spec - java.io.IOExceptionprotected java.net.URL getFileURL(java.net.URL contextURL,
java.lang.String path)
throws java.io.IOException
contextURL - path - java.io.IOExceptionpublic java.lang.String getCollectionBaseURI()
getCollectionBaseURI in interface CollectionURIResolverpublic void setCollectionBaseURI(java.lang.String collectionBaseURI)
setCollectionBaseURI in interface CollectionURIResolvercollectionBaseURI - the URI.