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. Everyvalidatemethod defined in this class delegate their work to one of manyValidatorobjects 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 appropriateValidatorsubclass and assign an instance to the corresponding field in this class. For example in order to override the validation ofGeographicCRSobjects, 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>allAn unmodifiable "live" list of all validators.CitationValidatorcitationThe validator forCitationand related objects.OperationValidatorcoordinateOperationThe validator forCoordinateOperationand related objects.CRSValidatorcrsThe validator forCoordinateReferenceSystemand related objects.CSValidatorcsThe validator forCoordinateSystemand related objects.DatumValidatordatumThe validator forDatumand related objects.ExtentValidatorextentThe validator forExtentand related objects.GeometryValidatorgeometryThe validator forGeometryand related objects.ImageValidatorimageThe validator for images and related objects.MetadataBaseValidatormetadataThe validator forMetadataand related objects.NameValidatornamingThe validator forGenericNameand related objects.ParameterValidatorparameterThe validator forParameterValueand related objects.
-
Constructor Summary
Constructors Constructor Description ValidatorContainer()Creates a newValidatorContainerinitialized with newValidatorinstances.
-
Method Summary
Modifier and Type Method Description ValidatorContainerclone()Returns a new container using the same validators than this instance.voiddispatch(Object object)For each interface implemented by the given object, invokes the correspondingvalidate(…)method defined in this class (if any).voidvalidate(IIOMetadataFormat object)Tests the conformance of the given object.voidvalidate(ImageReaderSpi object)Tests the conformance of the given object.voidvalidate(ImageWriterSpi object)Tests the conformance of the given object.voidvalidate(DirectPosition object)Tests the conformance of the given object.voidvalidate(Envelope object)Tests the conformance of the given object.voidvalidate(Address object)Tests the conformance of the given object.voidvalidate(Citation object)Tests the conformance of the given object.voidvalidate(CitationDate... object)Tests the conformance of the given objects.voidvalidate(Contact object)Tests the conformance of the given object.voidvalidate(OnlineResource object)Tests the conformance of the given object.voidvalidate(Party object)Tests the conformance of the given object.voidvalidate(Responsibility object)Tests the conformance of the given object.voidvalidate(Telephone object)Tests the conformance of the given object.voidvalidate(BoundingPolygon object)Tests the conformance of the given object.voidvalidate(Extent object)Tests the conformance of the given object.voidvalidate(GeographicBoundingBox object)Tests the conformance of the given object.voidvalidate(GeographicDescription object)Tests the conformance of the given object.voidvalidate(GeographicExtent object)Tests the conformance of the given object.voidvalidate(TemporalExtent object)Tests the conformance of the given object.voidvalidate(VerticalExtent object)Tests the conformance of the given object.voidvalidate(Identifier object)Tests the conformance of the given object.voidvalidate(Metadata object)Tests the conformance of the given object.voidvalidate(GeneralParameterDescriptor object)Tests the conformance of the given object.voidvalidate(GeneralParameterValue object)Tests the conformance of the given object.voidvalidate(ParameterDescriptor<?> object)Tests the conformance of the given object.voidvalidate(ParameterDescriptorGroup object)Tests the conformance of the given object.voidvalidate(ParameterValue<?> object)Tests the conformance of the given object.voidvalidate(ParameterValueGroup object)Tests the conformance of the given object.voidvalidate(CompoundCRS object)Validates the given coordinate reference system.voidvalidate(CoordinateReferenceSystem object)Tests the conformance of the given object.voidvalidate(DerivedCRS object)Validates the given coordinate reference system.voidvalidate(EngineeringCRS object)Validates the given coordinate reference system.voidvalidate(GeocentricCRS object)Tests the conformance of the given object.voidvalidate(GeographicCRS object)Tests the conformance of the given object.voidvalidate(ImageCRS object)Validates the given coordinate reference system.voidvalidate(ProjectedCRS object)Validates the given coordinate reference system.voidvalidate(TemporalCRS object)Validates the given coordinate reference system.voidvalidate(VerticalCRS object)Validates the given coordinate reference system.voidvalidate(CartesianCS object)Tests the conformance of the given object.voidvalidate(CoordinateSystem object)Tests the conformance of the given object.voidvalidate(CoordinateSystemAxis object)Tests the conformance of the given object.voidvalidate(CylindricalCS object)Tests the conformance of the given object.voidvalidate(EllipsoidalCS object)Tests the conformance of the given object.voidvalidate(LinearCS object)Tests the conformance of the given object.voidvalidate(PolarCS object)Tests the conformance of the given object.voidvalidate(SphericalCS object)Tests the conformance of the given object.voidvalidate(TimeCS object)Tests the conformance of the given object.voidvalidate(UserDefinedCS object)Tests the conformance of the given object.voidvalidate(VerticalCS object)Tests the conformance of the given object.voidvalidate(Datum object)Tests the conformance of the given object.voidvalidate(Ellipsoid object)Tests the conformance of the given object.voidvalidate(EngineeringDatum object)Tests the conformance of the given object.voidvalidate(GeodeticDatum object)Tests the conformance of the given object.voidvalidate(ImageDatum object)Tests the conformance of the given object.voidvalidate(PrimeMeridian object)Tests the conformance of the given object.voidvalidate(TemporalDatum object)Tests the conformance of the given object.voidvalidate(VerticalDatum object)Tests the conformance of the given object.voidvalidate(IdentifiedObject object)Tests the conformance of the given object.voidvalidate(ConcatenatedOperation object)Tests the conformance of the given object.voidvalidate(Conversion object)Tests the conformance of the given object.voidvalidate(CoordinateOperation object)Tests the conformance of the given object.voidvalidate(Formula object)Tests the conformance of the given object.voidvalidate(MathTransform object)Tests the conformance of the given object.voidvalidate(OperationMethod object)Tests the conformance of the given object.voidvalidate(PassThroughOperation object)Tests the conformance of the given object.voidvalidate(Transformation object)Tests the conformance of the given object.voidvalidate(GenericName object)Tests the conformance of the given object.voidvalidate(InternationalString object)Tests the conformance of the given object.voidvalidate(LocalName object)Tests the conformance of the given object.voidvalidate(NameSpace object)Tests the conformance of the given object.voidvalidate(ScopedName object)Tests the conformance of the given object.
-
-
-
Field Detail
-
naming
public NameValidator naming
The validator forGenericNameand 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 tonullhowever.
-
metadata
public MetadataBaseValidator metadata
The validator forMetadataand 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 tonullhowever.- Since:
- 3.1
-
citation
public CitationValidator citation
The validator forCitationand 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 tonullhowever.
-
extent
public ExtentValidator extent
The validator forExtentand 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 tonullhowever.
-
datum
public DatumValidator datum
The validator forDatumand 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 tonullhowever.
-
cs
public CSValidator cs
The validator forCoordinateSystemand 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 tonullhowever.
-
crs
public CRSValidator crs
The validator forCoordinateReferenceSystemand 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 tonullhowever.
-
parameter
public ParameterValidator parameter
The validator forParameterValueand 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 tonullhowever.
-
coordinateOperation
public OperationValidator coordinateOperation
The validator forCoordinateOperationand 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 tonullhowever.
-
geometry
public GeometryValidator geometry
The validator forGeometryand 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 tonullhowever.
-
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 tonullhowever.
-
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 theirloggersetting or to set their setrequireMandatoryAttributesfield tofalse.
-
-
Constructor Detail
-
ValidatorContainer
public ValidatorContainer()
Creates a newValidatorContainerinitialized with newValidatorinstances. Note that this constructor does not inherit the configuration of theValidators.DEFAULTinstance. 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 twoValidatorContainerinstances will share the sameValidatorinstances.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)
-
-