|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSchemaResolver
public class SchemaResolver
XML Schema resolver that maps absolute URLs to local URL resources.
Resources are sought, in order:
getSimpleHttpResourcePath(URI)
).
Constructor Summary | |
---|---|
SchemaResolver()
Convenience constructor for a resolver with neither catalog nor cache (just classpath). |
|
SchemaResolver(SchemaCache cache)
Convenience constructor for a resolver with no catalog. |
|
SchemaResolver(SchemaCatalog catalog)
Convenience constructor for a resolver with no cache. |
|
SchemaResolver(SchemaCatalog catalog,
boolean classpath,
SchemaCache cache)
Constructor. |
|
SchemaResolver(SchemaCatalog catalog,
SchemaCache cache)
Constructor. |
Method Summary | |
---|---|
static URL |
getClasspathResourceUrl(String location)
Return the URL for a resource found on the classpath at the Simple HTTP Resource Path. |
static String |
getSimpleHttpResourcePath(String location)
Return the Simple HTTP Resource Path for an absolute http/https URL. |
static String |
getSimpleHttpResourcePath(String location,
boolean keepQuery)
Return the Simple HTTP Resource Path for an absolute http/https URL. |
static String |
getSimpleHttpResourcePath(URI location)
Return the Simple HTTP Resource Path for an absolute http/https URL. |
static String |
getSimpleHttpResourcePath(URI location,
boolean keepQuery)
Return the Simple HTTP Resource Path for an absolute http/https URL. |
String |
resolve(String location)
Resolve an absolute URL to a local file or jar URL. |
String |
resolve(String location,
String context)
Resolve an absolute or relative URL to a local file or jar URL. |
static String |
resolveClasspathLocation(String location)
Return the string representation of URL for a resource found on the classpath at the Simple HTTP Resource Path. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SchemaResolver(SchemaCatalog catalog, boolean classpath, SchemaCache cache)
catalog
- classpath
- whether schemas can be located on the classpathcache
- public SchemaResolver(SchemaCatalog catalog, SchemaCache cache)
catalog
- cache
- public SchemaResolver()
public SchemaResolver(SchemaCatalog catalog)
catalog
- public SchemaResolver(SchemaCache cache)
cache
- Method Detail |
---|
public String resolve(String location, String context)
location
- an absolute or relative URL for a schemacontext
- an absolute URL specifying the context schema of a relative location, or null if
none
RuntimeException
- if a local resource could not be foundpublic String resolve(String location)
location
- an absolute URL
RuntimeException
- if a local resource could not be foundpublic static String getSimpleHttpResourcePath(String location)
location
- not null
getSimpleHttpResourcePath(URI)
public static String getSimpleHttpResourcePath(String location, boolean keepQuery)
location
- not nullkeepQuery
- indicates whether or not the query components should be included in the path. If
this is set to true then the query portion is converted to an MD5 message digest
and that string is used to identify the file in the cache.
getSimpleHttpResourcePath(URI, boolean)
public static String getSimpleHttpResourcePath(URI location)
The Simple HTTP Resource Path maps an HTTP or HTTPS URL to a path on the classpath or relative to some other root. To form the Simple HTTP Resource Path from an http/https URL:
http://schemas.example.org/exampleml/exml.xsd
becomes
/org/example/schemas/exampleml/exml.xsd
.
The Simple HTTP Resource Path always starts with a forward slash (if not null). Does not include query components in the path.
location
- not null
public static String getSimpleHttpResourcePath(URI location, boolean keepQuery)
The Simple HTTP Resource Path maps an HTTP or HTTPS URL to a path on the classpath or relative to some other root. To form the Simple HTTP Resource Path from an http/https URL:
http://schemas.example.org/exampleml/exml.xsd
becomes
/org/example/schemas/exampleml/exml.xsd
.
The Simple HTTP Resource Path always starts with a forward slash (if not null). Does not include query components in the path.
location
- not nullkeepQuery
- indicates whether or not the query components should be included in the path. If
this is set to true then the query portion is converted to an MD5 message digest
and that string is used to identify the file in the cache.
public static URL getClasspathResourceUrl(String location)
location
-
public static String resolveClasspathLocation(String location)
location
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |