Class JavascriptWebResource

java.lang.Object
com.atlassian.plugin.webresource.JavascriptWebResource
All Implemented Interfaces:
WebResourceFormatter, WebResourceFilter

public class JavascriptWebResource extends Object
  • Constructor Details

    • JavascriptWebResource

      public JavascriptWebResource()
  • Method Details

    • matches

      public boolean matches(@Nullable String name)
    • formatResource

      public String formatResource(String url, Map<String,String> attributes)
      Description copied from interface: WebResourceFormatter
      Returns a formatted resource string.
      Parameters:
      url - url path to the resource
      attributes - a Map of resource parameters
      Returns:
      a formatted resource String.
    • getAttributeParameters

      protected List<String> getAttributeParameters()
      Should return a List of parameter name Strings, which the WebResourceFormatter will write out as HTML attributes.
      Returns:
      a List of parameter names
    • getParametersAsAttributes

      protected List<String> getParametersAsAttributes(Map params)
      A convenient method to convert the given parameter map into a List of HTML String attributes. For example, an entry with key 'foo' and value 'bar' is converted to the attribute string, foo="bar".

      Only parameters that are supported by the WebResourceFormatter are formatted (See getAttributeParameters()).

      Parameters:
      params - a Map of parameters
      Returns:
      a list of HTML String attributes