Package jetbrains.buildServer.vcs.spec
Class BranchSpecsImpl
- java.lang.Object
-
- jetbrains.buildServer.vcs.spec.BranchSpecsImpl
-
- All Implemented Interfaces:
BranchSpecsEx
,BranchSpecs
public class BranchSpecsImpl extends Object implements BranchSpecsEx
- Author:
- dmitry.neverov
-
-
Constructor Summary
Constructors Constructor Description BranchSpecsImpl(BranchAttributesFilterManager branchAttributesFilterManager, ExtensionHolder extensionHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BranchSpec
createDefault()
BranchFilter
createFilter(String filterSpec)
BranchFilter
createFilter(String filterSpec, boolean filterAttributesAllowed, BranchSpecParserSettings settings)
BranchFilter
createFilter(String filterSpec, BranchSpecParserSettings settings)
BranchSpec
parse(String spec)
BranchFilterContext
precalculateForFiltering(SBuildType buildType, BranchFilter filter)
Should be used if multiple branches are supposed to be filteredvoid
validate(String spec)
void
validate(String spec, boolean extendedSyntax)
void
validate(String spec, boolean extendedSyntax, boolean attributesFilterAllowed)
String
validateBranchFilterProperty(String filterValue, boolean attributeFiltersAllowed)
-
-
-
Constructor Detail
-
BranchSpecsImpl
public BranchSpecsImpl(@Nullable BranchAttributesFilterManager branchAttributesFilterManager, @NotNull ExtensionHolder extensionHolder)
-
-
Method Detail
-
createFilter
@NotNull public BranchFilter createFilter(@NotNull String filterSpec) throws InvalidBranchSpecException
- Specified by:
createFilter
in interfaceBranchSpecs
- Throws:
InvalidBranchSpecException
-
createFilter
@NotNull public BranchFilter createFilter(@NotNull String filterSpec, @NotNull BranchSpecParserSettings settings) throws InvalidBranchSpecException
- Specified by:
createFilter
in interfaceBranchSpecs
- Throws:
InvalidBranchSpecException
-
createFilter
@NotNull public BranchFilter createFilter(@NotNull String filterSpec, boolean filterAttributesAllowed, @Nullable BranchSpecParserSettings settings)
- Specified by:
createFilter
in interfaceBranchSpecs
filterAttributesAllowed
- true if attributes filters are allowed for this branch filter
-
precalculateForFiltering
@Nullable public BranchFilterContext precalculateForFiltering(@NotNull SBuildType buildType, @NotNull BranchFilter filter)
Description copied from interface:BranchSpecsEx
Should be used if multiple branches are supposed to be filtered- Specified by:
precalculateForFiltering
in interfaceBranchSpecsEx
- Returns:
- context for further branch filtering, or null if the context is not needed
-
validateBranchFilterProperty
public String validateBranchFilterProperty(@Nullable String filterValue, boolean attributeFiltersAllowed)
- Specified by:
validateBranchFilterProperty
in interfaceBranchSpecsEx
- Parameters:
filterValue
- a branch filter value used in some settingsattributeFiltersAllowed
- true if attribute filters are allowed in the settings they are used in- Returns:
- error as string if the provided branch filter value is incorrect, always returns null if parameter references are used
-
createDefault
@NotNull public BranchSpec createDefault()
- Specified by:
createDefault
in interfaceBranchSpecs
-
parse
@NotNull public BranchSpec parse(@Nullable String spec) throws InvalidBranchSpecException
- Specified by:
parse
in interfaceBranchSpecs
- Throws:
InvalidBranchSpecException
-
validate
public void validate(@Nullable String spec) throws InvalidBranchSpecException
- Specified by:
validate
in interfaceBranchSpecs
- Throws:
InvalidBranchSpecException
-
validate
public void validate(@Nullable String spec, boolean extendedSyntax) throws InvalidBranchSpecException
- Specified by:
validate
in interfaceBranchSpecs
- Parameters:
spec
- branch specification to validateextendedSyntax
- if true spec allows usage of brackets, if false, only simple spec is allowed- Throws:
InvalidBranchSpecException
-
validate
public void validate(@Nullable String spec, boolean extendedSyntax, boolean attributesFilterAllowed) throws InvalidBranchSpecException
- Specified by:
validate
in interfaceBranchSpecs
attributesFilterAllowed
- indicates if attributes branch filter syntax is allowed in the branch filter- Throws:
InvalidBranchSpecException
-
-