T
- the supported build step type.public abstract class BuildStepDetailsProvider<T extends hudson.tasks.BuildStep> extends Object implements hudson.ExtensionPoint
An extension to provide additional details for a given BuildStep
. Subclasses will need to
overwrite getDetails(BuildStep)
for the build step type they supported.
To provide details for a new build step, add a class as
@Extension
@DetailFor(value = AwesomeBuildStep.class)
public static class AwesomeBuildStepDetailsProvider
extends BuildStepDetailsProvider <AwesomeBuildStep>
{
@Override
public String getBuildStepDetails(AwesomeBuildStep myAwesomeBuildStep) {
return myAwesomeBuildStep.getDetails(); // or other logic here
}
}
See examples in BuildStepDetailsProvider.MavenBuildStepDetailsProvider
and BuildStepDetailsProvider.ShellBuildStepDetailsProvider
below.
Modifier and Type | Class and Description |
---|---|
static class |
BuildStepDetailsProvider.MavenBuildStepDetailsProvider
BuildStepDetailsProvider for Maven . |
static class |
BuildStepDetailsProvider.ShellBuildStepDetailsProvider
BuildStepDetailsProvider for Shell . |
Constructor and Description |
---|
BuildStepDetailsProvider() |
Modifier and Type | Method and Description |
---|---|
static Collection<BuildStepDetailsProvider> |
all() |
protected static String |
defaultName(hudson.tasks.BuildStep bs) |
abstract String |
getDetails(T bs) |
String |
getFullCmd(T bs)
This provides a hook by which detail provider may provide different full command line details
as getDetails() method.
|
String |
getName(T bs)
This provides a hook by which detail providers may decide to not use the display name of the
plugin as the waypoint name.
|
protected boolean |
isApplicable(hudson.tasks.BuildStep buildStep) |
static String |
resolveDetails(hudson.tasks.BuildStep bs) |
static com.google.common.collect.ImmutableList<String> |
resolveFullCmd(hudson.tasks.BuildStep bs) |
static String |
resolveName(hudson.tasks.BuildStep bs) |
@Nullable public static String resolveDetails(hudson.tasks.BuildStep bs)
bs
- A given BuildStep
.BuildStep
, null if there is not an extension to
obtain details.@Nullable public static com.google.common.collect.ImmutableList<String> resolveFullCmd(hudson.tasks.BuildStep bs)
bs
- A given BuildStep
.@Nullable public static String resolveName(hudson.tasks.BuildStep bs)
bs
- a BuildStep
.BuildStep
, if it is a Describable
, otherwise
null.protected static String defaultName(hudson.tasks.BuildStep bs)
public static Collection<BuildStepDetailsProvider> all()
ExtensionPoint
BuildStepDetailsProvider
.public abstract String getDetails(T bs)
bs
- A given BuildStep
.public String getFullCmd(T bs)
bs
- A given BuildStep
.public String getName(T bs)
protected boolean isApplicable(hudson.tasks.BuildStep buildStep)
buildStep
- a given BuildStep
.BuildStep
is supported by this extension.Copyright © 2016. All rights reserved.