Package org.opengis.test
Class ValidatorContainer
- Object
-
- ValidatorContainer
-
- All Implemented Interfaces:
Cloneable
public class ValidatorContainer extends Object implements Cloneable
A set of convenience methods for validating GeoAPI implementations. Everyvalidate
method defined in this class delegate their work to one of manyValidator
objects in various packages. Vendors can change the value of fields in this class if they wish to override some validation process.Customization
Allvalidate(…)
methods in this class are final because this class is not the extension point for overriding validation processes. Instead, extend the appropriateValidator
subclass and assign an instance to the corresponding field in this class. For example in order to override the validation ofGeographicCRS
objects, one can do:ValidatorContainer container = new ValidationContainer(); container.crs = new CRSValidator(container) { @Override public void validate(GeographicCRS object) { super.validate(object); // Perform additional validation here. } };
- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description List<Validator>
all
An unmodifiable "live" list of all validators.CitationValidator
citation
The validator forCitation
and related objects.OperationValidator
coordinateOperation
The validator forCoordinateOperation
and related objects.CRSValidator
crs
The validator forCoordinateReferenceSystem
and related objects.CSValidator
cs
The validator forCoordinateSystem
and related objects.DatumValidator
datum
The validator forDatum
and related objects.ExtentValidator
extent
The validator forExtent
and related objects.GeometryValidator
geometry
The validator forGeometry
and related objects.ImageValidator
image
The validator for images and related objects.MetadataBaseValidator
metadata
The validator forMetadata
and related objects.NameValidator
naming
The validator forGenericName
and related objects.ParameterValidator
parameter
The validator forParameterValue
and related objects.
-
Constructor Summary
Constructors Constructor Description ValidatorContainer()
Creates a newValidatorContainer
initialized with newValidator
instances.
-
Method Summary
Modifier and Type Method Description ValidatorContainer
clone()
Returns a new container using the same validators than this instance.void
dispatch(Object object)
For each interface implemented by the given object, invokes the correspondingvalidate(…)
method defined in this class (if any).void
validate(IIOMetadataFormat object)
Tests the conformance of the given object.void
validate(ImageReaderSpi object)
Tests the conformance of the given object.void
validate(ImageWriterSpi object)
Tests the conformance of the given object.void
validate(DirectPosition object)
Tests the conformance of the given object.void
validate(Envelope object)
Tests the conformance of the given object.void
validate(Address object)
Tests the conformance of the given object.void
validate(Citation object)
Tests the conformance of the given object.void
validate(CitationDate... object)
Tests the conformance of the given objects.void
validate(Contact object)
Tests the conformance of the given object.void
validate(OnlineResource object)
Tests the conformance of the given object.void
validate(Party object)
Tests the conformance of the given object.void
validate(Responsibility object)
Tests the conformance of the given object.void
validate(Telephone object)
Tests the conformance of the given object.void
validate(BoundingPolygon object)
Tests the conformance of the given object.void
validate(Extent object)
Tests the conformance of the given object.void
validate(GeographicBoundingBox object)
Tests the conformance of the given object.void
validate(GeographicDescription object)
Tests the conformance of the given object.void
validate(GeographicExtent object)
Tests the conformance of the given object.void
validate(TemporalExtent object)
Tests the conformance of the given object.void
validate(VerticalExtent object)
Tests the conformance of the given object.void
validate(Identifier object)
Tests the conformance of the given object.void
validate(Metadata object)
Tests the conformance of the given object.void
validate(GeneralParameterDescriptor object)
Tests the conformance of the given object.void
validate(GeneralParameterValue object)
Tests the conformance of the given object.void
validate(ParameterDescriptor<?> object)
Tests the conformance of the given object.void
validate(ParameterDescriptorGroup object)
Tests the conformance of the given object.void
validate(ParameterValue<?> object)
Tests the conformance of the given object.void
validate(ParameterValueGroup object)
Tests the conformance of the given object.void
validate(CompoundCRS object)
Validates the given coordinate reference system.void
validate(CoordinateReferenceSystem object)
Tests the conformance of the given object.void
validate(DerivedCRS object)
Validates the given coordinate reference system.void
validate(EngineeringCRS object)
Validates the given coordinate reference system.void
validate(GeocentricCRS object)
Tests the conformance of the given object.void
validate(GeographicCRS object)
Tests the conformance of the given object.void
validate(ImageCRS object)
Validates the given coordinate reference system.void
validate(ProjectedCRS object)
Validates the given coordinate reference system.void
validate(TemporalCRS object)
Validates the given coordinate reference system.void
validate(VerticalCRS object)
Validates the given coordinate reference system.void
validate(CartesianCS object)
Tests the conformance of the given object.void
validate(CoordinateSystem object)
Tests the conformance of the given object.void
validate(CoordinateSystemAxis object)
Tests the conformance of the given object.void
validate(CylindricalCS object)
Tests the conformance of the given object.void
validate(EllipsoidalCS object)
Tests the conformance of the given object.void
validate(LinearCS object)
Tests the conformance of the given object.void
validate(PolarCS object)
Tests the conformance of the given object.void
validate(SphericalCS object)
Tests the conformance of the given object.void
validate(TimeCS object)
Tests the conformance of the given object.void
validate(UserDefinedCS object)
Tests the conformance of the given object.void
validate(VerticalCS object)
Tests the conformance of the given object.void
validate(Datum object)
Tests the conformance of the given object.void
validate(Ellipsoid object)
Tests the conformance of the given object.void
validate(EngineeringDatum object)
Tests the conformance of the given object.void
validate(GeodeticDatum object)
Tests the conformance of the given object.void
validate(ImageDatum object)
Tests the conformance of the given object.void
validate(PrimeMeridian object)
Tests the conformance of the given object.void
validate(TemporalDatum object)
Tests the conformance of the given object.void
validate(VerticalDatum object)
Tests the conformance of the given object.void
validate(IdentifiedObject object)
Tests the conformance of the given object.void
validate(ConcatenatedOperation object)
Tests the conformance of the given object.void
validate(Conversion object)
Tests the conformance of the given object.void
validate(CoordinateOperation object)
Tests the conformance of the given object.void
validate(Formula object)
Tests the conformance of the given object.void
validate(MathTransform object)
Tests the conformance of the given object.void
validate(OperationMethod object)
Tests the conformance of the given object.void
validate(PassThroughOperation object)
Tests the conformance of the given object.void
validate(Transformation object)
Tests the conformance of the given object.void
validate(GenericName object)
Tests the conformance of the given object.void
validate(InternationalString object)
Tests the conformance of the given object.void
validate(LocalName object)
Tests the conformance of the given object.void
validate(NameSpace object)
Tests the conformance of the given object.void
validate(ScopedName object)
Tests the conformance of the given object.
-
-
-
Field Detail
-
naming
public NameValidator naming
The validator forGenericName
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
metadata
public MetadataBaseValidator metadata
The validator forMetadata
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.- Since:
- 3.1
-
citation
public CitationValidator citation
The validator forCitation
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
extent
public ExtentValidator extent
The validator forExtent
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
datum
public DatumValidator datum
The validator forDatum
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
cs
public CSValidator cs
The validator forCoordinateSystem
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
crs
public CRSValidator crs
The validator forCoordinateReferenceSystem
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
parameter
public ParameterValidator parameter
The validator forParameterValue
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
coordinateOperation
public OperationValidator coordinateOperation
The validator forCoordinateOperation
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
geometry
public GeometryValidator geometry
The validator forGeometry
and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
image
public ImageValidator image
The validator for images and related objects. Vendors can change this field to a different validator, or change the setting of the referenced validator. This field shall not be set tonull
however.
-
all
public final List<Validator> all
An unmodifiable "live" list of all validators. Any change to the value of a field declared in this class is reflected immediately in this list (so this list is unmodifiable but not immutable). This list is convenient if the same setting must be applied on all validators, for example in order to change theirlogger
setting or to set their setrequireMandatoryAttributes
field tofalse
.
-
-
Constructor Detail
-
ValidatorContainer
public ValidatorContainer()
Creates a newValidatorContainer
initialized with newValidator
instances. Note that this constructor does not inherit the configuration of theValidators.DEFAULT
instance. To inherit that default configuration, useDEFAULT.clone()
instead.
-
-
Method Detail
-
clone
public ValidatorContainer clone()
Returns a new container using the same validators than this instance. After this method call, the twoValidatorContainer
instances will share the sameValidator
instances.This method is typically used in order to use the default configuration with a few changes, as in the example below:
ValidatorContainer myContainer = Validators.DEFAULT.clone(); myContainer.crs = new CRSValidator(); myContainer.crs.enforceStandardNames = false;
-
dispatch
public final void dispatch(Object object)
For each interface implemented by the given object, invokes the correspondingvalidate(…)
method defined in this class (if any). Use this method only if the type is unknown at compile-time.- Parameters:
object
- The object to dispatch tovalidate(…)
methods, ornull
.
-
validate
public final void validate(Metadata object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
MetadataBaseValidator.validate(Metadata)
-
validate
public final void validate(Citation object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CitationValidator.validate(Citation)
-
validate
public final void validate(CitationDate... object)
Tests the conformance of the given objects.- Parameters:
object
- the objects to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(CitationDate...)
-
validate
public final void validate(Responsibility object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(Responsibility)
-
validate
public final void validate(Party object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(Party)
-
validate
public final void validate(Contact object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(Contact)
-
validate
public final void validate(Telephone object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(Telephone)
-
validate
public final void validate(Address object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(Address)
-
validate
public final void validate(OnlineResource object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
CitationValidator.validate(OnlineResource)
-
validate
public final void validate(Extent object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.validate(Extent)
-
validate
public final void validate(TemporalExtent object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.validate(TemporalExtent)
-
validate
public final void validate(VerticalExtent object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.validate(VerticalExtent)
-
validate
public final void validate(GeographicExtent object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.dispatch(GeographicExtent)
-
validate
public final void validate(GeographicDescription object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.validate(GeographicDescription)
-
validate
public final void validate(BoundingPolygon object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.validate(BoundingPolygon)
-
validate
public final void validate(GeographicBoundingBox object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ExtentValidator.validate(GeographicBoundingBox)
-
validate
public final void validate(Envelope object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
GeometryValidator.validate(Envelope)
-
validate
public final void validate(DirectPosition object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
GeometryValidator.validate(DirectPosition)
-
validate
public final void validate(CoordinateReferenceSystem object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CRSValidator.dispatch(CoordinateReferenceSystem)
-
validate
public final void validate(GeocentricCRS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CRSValidator.validate(GeocentricCRS)
-
validate
public final void validate(GeographicCRS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CRSValidator.validate(GeographicCRS)
-
validate
public final void validate(ProjectedCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(ProjectedCRS)
-
validate
public final void validate(DerivedCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(DerivedCRS)
-
validate
public final void validate(ImageCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(ImageCRS)
-
validate
public final void validate(EngineeringCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(EngineeringCRS)
-
validate
public final void validate(VerticalCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(VerticalCRS)
-
validate
public final void validate(TemporalCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(TemporalCRS)
-
validate
public final void validate(CompoundCRS object)
Validates the given coordinate reference system.- Parameters:
object
- the object to validate, ornull
.- See Also:
CRSValidator.validate(CompoundCRS)
-
validate
public final void validate(CoordinateSystem object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.dispatch(CoordinateSystem)
-
validate
public final void validate(CartesianCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(CartesianCS)
-
validate
public final void validate(EllipsoidalCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(EllipsoidalCS)
-
validate
public final void validate(SphericalCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(SphericalCS)
-
validate
public final void validate(CylindricalCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(CylindricalCS)
-
validate
public final void validate(PolarCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(PolarCS)
-
validate
public final void validate(LinearCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(LinearCS)
-
validate
public final void validate(VerticalCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(VerticalCS)
-
validate
public final void validate(TimeCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(TimeCS)
-
validate
public final void validate(UserDefinedCS object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(UserDefinedCS)
-
validate
public final void validate(CoordinateSystemAxis object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
CSValidator.validate(CoordinateSystemAxis)
-
validate
public final void validate(Datum object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.dispatch(Datum)
-
validate
public final void validate(PrimeMeridian object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(PrimeMeridian)
-
validate
public final void validate(Ellipsoid object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(Ellipsoid)
-
validate
public final void validate(GeodeticDatum object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(GeodeticDatum)
-
validate
public final void validate(VerticalDatum object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(VerticalDatum)
-
validate
public final void validate(TemporalDatum object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(TemporalDatum)
-
validate
public final void validate(ImageDatum object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(ImageDatum)
-
validate
public final void validate(EngineeringDatum object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
DatumValidator.validate(EngineeringDatum)
-
validate
public final void validate(CoordinateOperation object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.dispatch(CoordinateOperation)
-
validate
public final void validate(Conversion object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(Conversion)
-
validate
public final void validate(Transformation object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(Transformation)
-
validate
public final void validate(ConcatenatedOperation object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(ConcatenatedOperation)
-
validate
public final void validate(PassThroughOperation object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(PassThroughOperation)
-
validate
public final void validate(OperationMethod object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(OperationMethod)
-
validate
public final void validate(Formula object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(OperationMethod)
-
validate
public final void validate(MathTransform object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
OperationValidator.validate(MathTransform)
-
validate
public final void validate(GeneralParameterDescriptor object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ParameterValidator.dispatch(GeneralParameterDescriptor)
-
validate
public final void validate(ParameterDescriptor<?> object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ParameterValidator.validate(ParameterDescriptor)
-
validate
public final void validate(ParameterDescriptorGroup object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ParameterValidator.validate(ParameterDescriptorGroup)
-
validate
public final void validate(GeneralParameterValue object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ParameterValidator.dispatch(GeneralParameterValue)
-
validate
public final void validate(ParameterValue<?> object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ParameterValidator.validate(ParameterValue)
-
validate
public final void validate(ParameterValueGroup object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ParameterValidator.validate(ParameterValueGroup)
-
validate
public final void validate(IdentifiedObject object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ReferencingValidator.dispatchObject(IdentifiedObject)
-
validate
public final void validate(Identifier object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- Since:
- 3.1
- See Also:
MetadataBaseValidator.validate(Identifier)
-
validate
public final void validate(GenericName object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
NameValidator.dispatch(GenericName)
-
validate
public final void validate(LocalName object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
NameValidator.validate(LocalName)
-
validate
public final void validate(ScopedName object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
NameValidator.validate(ScopedName)
-
validate
public final void validate(NameSpace object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
NameValidator.validate(NameSpace)
-
validate
public final void validate(InternationalString object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
NameValidator.validate(InternationalString)
-
validate
public final void validate(ImageReaderSpi object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ImageValidator.validate(ImageReaderSpi)
-
validate
public final void validate(ImageWriterSpi object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ImageValidator.validate(ImageWriterSpi)
-
validate
public void validate(IIOMetadataFormat object)
Tests the conformance of the given object.- Parameters:
object
- the object to test, ornull
.- See Also:
ImageValidator.validate(IIOMetadataFormat)
-
-