Class LocalizationContributor
java.lang.Object
io.jenkins.plugins.localization.support.LocalizationContributor
- All Implemented Interfaces:
ExtensionPoint
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URL
findResource
(String resource, Class clazz) Finds a specified localizable resource.getName()
Returns the name of this implementation, defaulting to the class name.final String
Returns the plugin that this implementation is located in, or null if the plugin could not be determined.abstract URL
getPluginResource
(String resource, PluginWrapper plugin) Look up a resource for a plugin.abstract URL
getResource
(String resource) Returns the specific resource located in the resources searched by the specific implementation, or null if not found.
-
Constructor Details
-
LocalizationContributor
public LocalizationContributor()
-
-
Method Details
-
getResource
Returns the specific resource located in the resources searched by the specific implementation, or null if not found.- Parameters:
resource
- The resource to look for as absolute path (cf. ClassLoader#getResource)- Returns:
- the URL for the specified resource, or null if not found
-
getName
Returns the name of this implementation, defaulting to the class name.- Returns:
- the name of this implementation
-
getPluginName
Returns the plugin that this implementation is located in, or null if the plugin could not be determined.- Returns:
- the plugin that this implementation is located in, or null if the plugin could not be determined.
-
findResource
Finds a specified localizable resource.- Parameters:
resource
- the resource name to look forclazz
- the class context for the resource name- Returns:
- the resource
-
getPluginResource
@CheckForNull public abstract URL getPluginResource(@NonNull String resource, @NonNull PluginWrapper plugin) Look up a resource for a plugin.- Parameters:
resource
- the resource to look upplugin
- the plugin- Returns:
- resource for a plugin, or null if not found
-