Package org.java.plugin.standard
Class StandardPathResolver
- java.lang.Object
-
- org.java.plugin.standard.StandardPathResolver
-
- All Implemented Interfaces:
PathResolver
- Direct Known Subclasses:
ShadingPathResolver
public class StandardPathResolver extends java.lang.Object implements PathResolver
Standard simple implementation of path resolver. For resolving it uses plug-in element registration (seeregisterContext(Identity, URL)) procedure.- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Loglog
-
Constructor Summary
Constructors Constructor Description StandardPathResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(ExtendedProperties config)No configuration parameters expected in this implementation.java.net.URLgetRegisteredContext(java.lang.String id)Returns URL ofregisteredplug-in element context.booleanisContextRegistered(java.lang.String id)protected java.net.URLmaybeJarUrl(java.net.URL url)voidregisterContext(Identity idt, java.net.URL url)This implementation acceptsPluginDescriptororPluginFragmentas valid plug-in elements.protected java.net.URLresolvePath(java.net.URL baseUrl, java.lang.String path)Resolves given path against given base URL.java.net.URLresolvePath(Identity identity, java.lang.String path)Should resolve given path to URL for a given identity.voidunregisterContext(java.lang.String id)Unregisters plug-in element from this path resolver.
-
-
-
Method Detail
-
registerContext
public void registerContext(Identity idt, java.net.URL url)
This implementation acceptsPluginDescriptororPluginFragmentas valid plug-in elements.- Specified by:
registerContextin interfacePathResolver- Parameters:
idt- plug-in elementurl- "home" URL for a given plug-in element- See Also:
PathResolver.registerContext( org.java.plugin.registry.Identity, java.net.URL)
-
unregisterContext
public void unregisterContext(java.lang.String id)
Description copied from interface:PathResolverUnregisters plug-in element from this path resolver.- Specified by:
unregisterContextin interfacePathResolver- Parameters:
id- plug-in element identifier- See Also:
PathResolver.unregisterContext(java.lang.String)
-
resolvePath
public java.net.URL resolvePath(Identity identity, java.lang.String path)
Description copied from interface:PathResolverShould resolve given path to URL for a given identity.- Specified by:
resolvePathin interfacePathResolver- Parameters:
identity- plug-in element for which to resolve pathpath- path to be resolved- Returns:
- resolved absolute URL
- See Also:
PathResolver.resolvePath( org.java.plugin.registry.Identity, java.lang.String)
-
getRegisteredContext
public java.net.URL getRegisteredContext(java.lang.String id)
Description copied from interface:PathResolverReturns URL ofregisteredplug-in element context. If context for plug-in element with given ID not registered, this method should throw anIllegalArgumentException. In other words, this method shouldn't returnnull.- Specified by:
getRegisteredContextin interfacePathResolver- Parameters:
id- plug-in element identifier- Returns:
- registered context "home" location
- See Also:
PathResolver.getRegisteredContext(java.lang.String)
-
isContextRegistered
public boolean isContextRegistered(java.lang.String id)
- Specified by:
isContextRegisteredin interfacePathResolver- Parameters:
id- plug-in element identifier- Returns:
trueif context for plug-in element with given ID registered- See Also:
PathResolver.isContextRegistered(java.lang.String)
-
resolvePath
protected java.net.URL resolvePath(java.net.URL baseUrl, java.lang.String path)Resolves given path against given base URL.- Parameters:
baseUrl- base URL to resolve given pathpath- path to be resolved- Returns:
- resolved URL
-
maybeJarUrl
protected java.net.URL maybeJarUrl(java.net.URL url) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
configure
public void configure(ExtendedProperties config) throws java.lang.Exception
No configuration parameters expected in this implementation.- Specified by:
configurein interfacePathResolver- Parameters:
config- path resolver configuration data- Throws:
java.lang.Exception- if any error has occurred- See Also:
PathResolver.configure(ExtendedProperties)
-
-