Class DisplayURLDecorator
- java.lang.Object
-
- org.jenkinsci.plugins.displayurlapi.DisplayURLDecorator
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class DisplayURLDecorator extends Object implements ExtensionPoint
An extension point for decorating the URLs presented to users by theDisplayURLProvider
. Use cases include decorating URLs withutm_source
etc tracking parameters in order to measure the usage rate of different URLs generated by Jenkins.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description DisplayURLDecorator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static String
decorate(DisplayURLContext context, String url)
Decorates the URL for the provided context.protected abstract Map<String,String>
parameters(DisplayURLContext context)
Returns a map of query parameters to decorate the URL with.
-
-
-
Method Detail
-
parameters
@NonNull protected abstract Map<String,String> parameters(@NonNull DisplayURLContext context)
Returns a map of query parameters to decorate the URL with. The keys and values will be URL encoded for you. Anull
value will translate as a query parameter without a value.- Parameters:
context
- the context within which the URL is being generated.- Returns:
- the map of parameters to append to the URL.
-
decorate
@NonNull public static String decorate(@NonNull DisplayURLContext context, @NonNull String url)
Decorates the URL for the provided context.- Parameters:
context
- the context.url
- the URL to decorate.- Returns:
- the decorated URL.
-
-