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) packageorg.apache.jackrabbit.vault.validation.spi
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Object
getAttribute(String name)
Retrieves the value of the attribute with the given name.Set<String>
getAttributeNames()
Returns a set of all attribute names which have been set before.@Nullable ValidationContext
getContainerValidationContext()
Returns the validation context of the container package.@NotNull Collection<PackageInfo>
getDependenciesPackageInfo()
PackageInfo
for all resolved package dependencies.@NotNull WorkspaceFilter
getFilter()
Returns the workspace filter@NotNull Path
getPackageRootPath()
Returns the root path of the package.@NotNull PackageProperties
getProperties()
Returns the package properties.default boolean
isIncremental()
Object
setAttribute(String name, Object value)
Sets an attribute with the given name to the given value.
-
-
-
Method Detail
-
getFilter
@NotNull @NotNull WorkspaceFilter getFilter()
Returns the workspace filter- Returns:
- the filter
-
getProperties
@NotNull @NotNull PackageProperties 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
@Nullable @Nullable ValidationContext 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
@NotNull @NotNull Path 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
@NotNull @NotNull Collection<PackageInfo> getDependenciesPackageInfo()
PackageInfo
for 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:
true
in case the validation is incremental (i.e. does not cover all files in a package). This should relax some validations.
-
setAttribute
Object setAttribute(String name, Object value)
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
null
if there was no value set - Since:
- 3.7.1
- See Also:
getAttribute(String)
-
getAttribute
Object getAttribute(String name)
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
null
if there was no value set - Since:
- 3.7.1
- See Also:
setAttribute(String, Object)
,getAttributeNames()
-
getAttributeNames
Set<String> 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:
getAttribute(String)
,setAttribute(String, Object)
-
-