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.Log
log
-
Constructor Summary
Constructors Constructor Description StandardPathResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(ExtendedProperties config)
No configuration parameters expected in this implementation.java.net.URL
getRegisteredContext(java.lang.String id)
Returns URL ofregistered
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 acceptsPluginDescriptor
orPluginFragment
as valid plug-in elements.protected java.net.URL
resolvePath(java.net.URL baseUrl, java.lang.String path)
Resolves given path against given base URL.java.net.URL
resolvePath(Identity identity, java.lang.String path)
Should resolve given path to URL for a given identity.void
unregisterContext(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 acceptsPluginDescriptor
orPluginFragment
as valid plug-in elements.- Specified by:
registerContext
in 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:PathResolver
Unregisters plug-in element from this path resolver.- Specified by:
unregisterContext
in 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:PathResolver
Should resolve given path to URL for a given identity.- Specified by:
resolvePath
in 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:PathResolver
Returns URL ofregistered
plug-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:
getRegisteredContext
in 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:
isContextRegistered
in interfacePathResolver
- Parameters:
id
- plug-in element identifier- Returns:
true
if 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:
configure
in interfacePathResolver
- Parameters:
config
- path resolver configuration data- Throws:
java.lang.Exception
- if any error has occurred- See Also:
PathResolver.configure(ExtendedProperties)
-
-