public class StandardPathResolver extends java.lang.Object implements PathResolver
registerContext(Identity, URL)
)
procedure.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
StandardPathResolver() |
Modifier and Type | Method and Description |
---|---|
void |
configure(ExtendedProperties config)
No configuration parameters expected in this implementation.
|
java.net.URL |
getRegisteredContext(java.lang.String id)
Returns URL of
registered plug-in
element context. |
boolean |
isContextRegistered(java.lang.String id) |
protected java.net.URL |
maybeJarUrl(java.net.URL url) |
void |
registerContext(Identity idt,
java.net.URL url)
This implementation accepts
PluginDescriptor or
PluginFragment as valid plug-in elements. |
java.net.URL |
resolvePath(Identity identity,
java.lang.String path)
Should resolve given path to URL for a given identity.
|
protected java.net.URL |
resolvePath(java.net.URL baseUrl,
java.lang.String path)
Resolves given path against given base URL.
|
void |
unregisterContext(java.lang.String id)
Unregisters plug-in element from this path resolver.
|
public void registerContext(Identity idt, java.net.URL url)
PluginDescriptor
or
PluginFragment
as valid plug-in elements.registerContext
in interface PathResolver
idt
- plug-in elementurl
- "home" URL for a given plug-in elementPathResolver.registerContext(
org.java.plugin.registry.Identity, java.net.URL)
public void unregisterContext(java.lang.String id)
PathResolver
unregisterContext
in interface PathResolver
id
- plug-in element identifierPathResolver.unregisterContext(java.lang.String)
public java.net.URL resolvePath(Identity identity, java.lang.String path)
PathResolver
resolvePath
in interface PathResolver
identity
- plug-in element for which to resolve pathpath
- path to be resolvedPathResolver.resolvePath(
org.java.plugin.registry.Identity, java.lang.String)
public java.net.URL getRegisteredContext(java.lang.String id)
PathResolver
registered
plug-in
element context. If context for plug-in element with given ID not
registered, this method should throw an IllegalArgumentException
.
In other words, this method shouldn't return null
.getRegisteredContext
in interface PathResolver
id
- plug-in element identifierPathResolver.getRegisteredContext(java.lang.String)
public boolean isContextRegistered(java.lang.String id)
isContextRegistered
in interface PathResolver
id
- plug-in element identifiertrue
if context for plug-in element with given ID
registeredPathResolver.isContextRegistered(java.lang.String)
protected java.net.URL resolvePath(java.net.URL baseUrl, java.lang.String path)
baseUrl
- base URL to resolve given pathpath
- path to be resolvedprotected java.net.URL maybeJarUrl(java.net.URL url) throws java.net.MalformedURLException
java.net.MalformedURLException
public void configure(ExtendedProperties config) throws java.lang.Exception
configure
in interface PathResolver
config
- path resolver configuration datajava.lang.Exception
- if any error has occurredPathResolver.configure(ExtendedProperties)
Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.