public abstract class SCMSourceTrait extends SCMTrait<SCMSourceTrait>
SCMSource.| Constructor and Description |
|---|
SCMSourceTrait() |
| Modifier and Type | Method and Description |
|---|---|
static List<SCMSourceTraitDescriptor> |
_for(Class<? extends SCMSourceContext> contextClass,
Class<? extends SCMBuilder> builderClass)
Returns the subset of
SCMSourceTraitDescriptor instances that are applicable to the specified types
of SCMSourceContext and SCMSourceBuilder. |
static List<SCMSourceTraitDescriptor> |
_for(SCMSourceDescriptor scmSource,
Class<? extends SCMSourceContext> contextClass,
Class<? extends SCMBuilder> builderClass)
Returns the subset of
SCMSourceTraitDescriptor instances that are applicable to the specified
SCMSourceDescriptor and specified types of SCMNavigatorContext and SCMSourceBuilder. |
static DescriptorExtensionList<SCMSourceTrait,SCMSourceTraitDescriptor> |
all()
Returns all the
SCMSourceTraitDescriptor instances. |
void |
applyToBuilder(SCMBuilder<?,?> builder)
Applies this trait to the
SCMBuilder. |
void |
applyToContext(SCMSourceContext<?,?> context)
Applies this trait to the
SCMSourceContext. |
SCMHeadObserver |
applyToObserver(SCMHeadObserver observer)
Applies this trait to an observer for use during a
SCMSourceRequest. |
protected void |
decorateBuilder(SCMBuilder<?,?> builder)
SPI: Override this method to decorate a
SCMBuilder. |
protected void |
decorateContext(SCMSourceContext<?,?> context)
SPI: Override this method to decorate a
SCMSourceContext. |
protected SCMHeadObserver |
decorateObserver(SCMHeadObserver observer)
SPI: Override this method to decorate the
SCMHeadObserver used during a SCMSourceRequest. |
SCMSourceTraitDescriptor |
getDescriptor() |
protected boolean |
includeCategory(SCMHeadCategory category)
SPI: Override this method to control whether specific
SCMHeadCategory instances are required. |
boolean |
isCategoryEnabled(SCMHeadCategory category)
Checks if the supplied category is required by this trait.
|
public final void applyToContext(SCMSourceContext<?,?> context)
SCMSourceContext.context - the context.protected void decorateContext(SCMSourceContext<?,?> context)
SCMSourceContext. You can assume that your
SCMSourceTraitDescriptor.isApplicableToContext(Class) is true within this method and that
the provided context is an instance of SCMSourceTraitDescriptor.getContextClass().context - the context (invariant: SCMSourceTraitDescriptor.isApplicableToContext(Class) is true and SCMSourceTraitDescriptor.getContextClass() Class.isInstance(Object))
is true)@NonNull public final SCMHeadObserver applyToObserver(@NonNull SCMHeadObserver observer)
SCMSourceRequest.observer - the observer.@NonNull protected SCMHeadObserver decorateObserver(@NonNull SCMHeadObserver observer)
SCMHeadObserver used during a SCMSourceRequest.observer - the observer.public final void applyToBuilder(SCMBuilder<?,?> builder)
SCMBuilder.builder - the builder.protected void decorateBuilder(SCMBuilder<?,?> builder)
SCMBuilder. You can assume that your
SCMSourceTraitDescriptor.isApplicableToBuilder(SCMBuilder) is true within this method and that
the provided builder is an instance of SCMSourceTraitDescriptor.getBuilderClass().builder - the builder (invariant: SCMSourceTraitDescriptor.isApplicableToBuilder(SCMBuilder) is
true and SCMSourceTraitDescriptor.getBuilderClass()
Class.isInstance(Object)) is true)public final boolean isCategoryEnabled(@NonNull
SCMHeadCategory category)
category - the category.true if this trait requires the supplied category.protected boolean includeCategory(@NonNull
SCMHeadCategory category)
SCMHeadCategory instances are required.category - the category.true to require the category.public SCMSourceTraitDescriptor getDescriptor()
getDescriptor in interface Describable<SCMSourceTrait>getDescriptor in class SCMTrait<SCMSourceTrait>public static DescriptorExtensionList<SCMSourceTrait,SCMSourceTraitDescriptor> all()
SCMSourceTraitDescriptor instances.SCMSourceTraitDescriptor instances.public static List<SCMSourceTraitDescriptor> _for(@CheckForNull Class<? extends SCMSourceContext> contextClass, @CheckForNull Class<? extends SCMBuilder> builderClass)
SCMSourceTraitDescriptor instances that are applicable to the specified types
of SCMSourceContext and SCMSourceBuilder.contextClass - (optional) type of SCMSourceContext.builderClass - (optional) type of SCMBuilder.SCMSourceTraitDescriptor instances.public static List<SCMSourceTraitDescriptor> _for(@CheckForNull SCMSourceDescriptor scmSource, @CheckForNull Class<? extends SCMSourceContext> contextClass, @CheckForNull Class<? extends SCMBuilder> builderClass)
SCMSourceTraitDescriptor instances that are applicable to the specified
SCMSourceDescriptor and specified types of SCMNavigatorContext and SCMSourceBuilder.scmSource - (optional) SCMSourceDescriptor.contextClass - (optional) type of SCMSourceContext.builderClass - (optional) type of SCMBuilder.SCMSourceTraitDescriptor instances.Copyright © 2016–2019. All rights reserved.