Package org.java.plugin.standard
Class StandardPathResolver
java.lang.Object
org.java.plugin.standard.StandardPathResolver
- All Implemented Interfaces:
PathResolver
- Direct Known Subclasses:
ShadingPathResolver
Standard simple implementation of path resolver. For resolving it uses
plug-in element registration (see
registerContext(Identity, URL)
)
procedure.- Version:
- $Id$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(ExtendedProperties config) No configuration parameters expected in this implementation.Returns URL ofregistered
plug-in element context.boolean
protected URL
maybeJarUrl
(URL url) void
registerContext
(Identity idt, URL url) This implementation acceptsPluginDescriptor
orPluginFragment
as valid plug-in elements.protected URL
resolvePath
(URL baseUrl, String path) Resolves given path against given base URL.resolvePath
(Identity identity, String path) Should resolve given path to URL for a given identity.void
Unregisters plug-in element from this path resolver.
-
Field Details
-
log
protected org.apache.commons.logging.Log log
-
-
Constructor Details
-
StandardPathResolver
public StandardPathResolver()
-
-
Method Details
-
registerContext
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:
-
unregisterContext
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:
-
resolvePath
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:
-
getRegisteredContext
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:
-
isContextRegistered
- 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:
-
resolvePath
Resolves given path against given base URL.- Parameters:
baseUrl
- base URL to resolve given pathpath
- path to be resolved- Returns:
- resolved URL
-
maybeJarUrl
- Throws:
MalformedURLException
-
configure
No configuration parameters expected in this implementation.- Specified by:
configure
in interfacePathResolver
- Parameters:
config
- path resolver configuration data- Throws:
Exception
- if any error has occurred- See Also:
-