Class LocalizationContributor

java.lang.Object
io.jenkins.plugins.localization.support.LocalizationContributor
All Implemented Interfaces:
ExtensionPoint

public abstract class LocalizationContributor extends Object implements ExtensionPoint
  • Constructor Details

    • LocalizationContributor

      public LocalizationContributor()
  • Method Details

    • getResource

      @CheckForNull public abstract URL getResource(@NonNull String resource)
      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

      @NonNull public String getName()
      Returns the name of this implementation, defaulting to the class name.
      Returns:
      the name of this implementation
    • getPluginName

      @CheckForNull public final String 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

      public static URL findResource(String resource, Class clazz)
      Finds a specified localizable resource.
      Parameters:
      resource - the resource name to look for
      clazz - 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 up
      plugin - the plugin
      Returns:
      resource for a plugin, or null if not found