Interface ValidationContext
- All Known Implementing Classes:
AbstractValidationContext,ArchiveValidationContext,SubPackageInArchiveValidationContext
@ProviderType
public interface ValidationContext
The validation context encapsulates information about the package for which the validation is triggered.
In addition validators may use it to pass information to other validators via attributes.
This class is used from both validators (SPI) and validation API but for historical reasons is located in (wrong) package
org.apache.jackrabbit.vault.validation.spi.-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Retrieves the value of the attribute with the given name.Returns a set of all attribute names which have been set before.@Nullable ValidationContextReturns the validation context of the container package.@NotNull Collection<PackageInfo>PackageInfofor all resolved package dependencies.@NotNull WorkspaceFilterReturns the workspace filter@NotNull PathReturns the root path of the package.@NotNull PackagePropertiesReturns the package properties.default booleansetAttribute(String name, Object value) Sets an attribute with the given name to the given value.
-
Method Details
-
getFilter
Returns the workspace filter- Returns:
- the filter
-
getProperties
Returns the package properties.- Returns:
- the package properties or some exception in case none could be found (will always point to the root package's properties).
-
getContainerValidationContext
Returns the validation context of the container package.- Returns:
- the validation context of the container in case this is the context of a sub package otherwise
null.
-
getPackageRootPath
Returns the root path of the package.- Returns:
- either the path to the ZIP file or a directory containing an exploded package. For subpackages starts with the package root path of the root container and appends each sub container package root path with the default separator.
-
getDependenciesPackageInfo
PackageInfofor all resolved package dependencies. In contrast toPackageProperties.getDependencies()the resolved dependencies also carry the main metadata (next to their coordinates).- Returns:
- the package info of all resolved package dependencies (i.e. the ones for which an artifact was found).
-
isIncremental
default boolean isIncremental()- Returns:
truein case the validation is incremental (i.e. does not cover all files in a package). This should relax some validations.
-
setAttribute
Sets an attribute with the given name to the given value.- Parameters:
name- the name of the attribute to setvalue- the value to set the attribute to- Returns:
- the old value of the attribute with the given name or
nullif there was no value set - Since:
- 3.7.1
- See Also:
-
getAttribute
Retrieves the value of the attribute with the given name.- Parameters:
name- the name of the attribute to retrieve- Returns:
- the value of the attribute with the given name or
nullif there was no value set - Since:
- 3.7.1
- See Also:
-
getAttributeNames
Returns a set of all attribute names which have been set before.- Returns:
- a set of attribute names which contain values
- Since:
- 3.7.1
- See Also:
-