001/* 002 * GeoAPI - Java interfaces for OGC/ISO standards 003 * Copyright © 2008-2024 Open Geospatial Consortium, Inc. 004 * http://www.geoapi.org 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.opengis.test; 019 020import java.util.List; 021import java.util.AbstractList; 022import javax.imageio.spi.ImageReaderSpi; 023import javax.imageio.spi.ImageWriterSpi; 024import javax.imageio.metadata.IIOMetadataFormat; 025 026import org.opengis.util.*; 027import org.opengis.metadata.*; 028import org.opengis.metadata.extent.*; 029import org.opengis.metadata.citation.*; 030import org.opengis.metadata.quality.*; 031import org.opengis.metadata.maintenance.*; 032import org.opengis.metadata.maintenance.Scope; // Resolve ambiguity. 033import org.opengis.geometry.*; 034import org.opengis.parameter.*; 035import org.opengis.referencing.*; 036import org.opengis.referencing.cs.*; 037import org.opengis.referencing.crs.*; 038import org.opengis.referencing.datum.*; 039import org.opengis.referencing.operation.*; 040 041import org.opengis.test.util.*; 042import org.opengis.test.metadata.*; 043import org.opengis.test.geometry.*; 044import org.opengis.test.referencing.*; 045import org.opengis.test.coverage.image.*; 046 047 048/** 049 * A set of convenience methods for validating GeoAPI implementations. Every {@code validate} 050 * method defined in this class delegate their work to one of many {@code Validator} objects 051 * in various packages. Vendors can change the value of fields in this class if they wish to 052 * override some validation process. 053 * 054 * <h2>Customization</h2> 055 * All {@code validate(…)} methods in this class are final because this class is not the extension 056 * point for overriding validation processes. Instead, extend the appropriate {@link Validator} 057 * subclass and assign an instance to the corresponding field in this class. For example in order 058 * to override the validation of {@link org.opengis.referencing.crs.GeodeticCRS} objects, 059 * one can do: 060 * 061 * {@snippet lang="java" : 062 * ValidatorContainer container = new ValidationContainer(); 063 * container.crs = new CRSValidator(container) { 064 * @Override 065 * public void validate(GeodeticCRS object) { 066 * super.validate(object); 067 * // Perform additional validation here. 068 * } 069 * };} 070 * 071 * @author Martin Desruisseaux (Geomatys) 072 * @version 3.1 073 * @since 2.2 074 */ 075public class ValidatorContainer { 076 /** 077 * The validator for {@link GenericName} and related objects. 078 * Vendors can change this field to a different validator, or change the setting 079 * of the referenced validator. This field shall not be set to {@code null} however. 080 */ 081 @SuppressWarnings("this-escape") 082 public NameValidator naming = new NameValidator(this); 083 084 /** 085 * The validator for {@link Metadata} and related objects. 086 * Vendors can change this field to a different validator, or change the setting 087 * of the referenced validator. This field shall not be set to {@code null} however. 088 * 089 * @since 3.1 090 */ 091 @SuppressWarnings("this-escape") 092 public MetadataBaseValidator metadata = new MetadataBaseValidator(this); 093 094 /** 095 * The validator for {@link Citation} and related objects. 096 * Vendors can change this field to a different validator, or change the setting 097 * of the referenced validator. This field shall not be set to {@code null} however. 098 */ 099 @SuppressWarnings("this-escape") 100 public CitationValidator citation = new CitationValidator(this); 101 102 /** 103 * The validator for {@link DataQuality} and related objects. 104 * Vendors can change this field to a different validator, or change the setting 105 * of the referenced validator. This field shall not be set to {@code null} however. 106 * 107 * @since 3.1 108 */ 109 @SuppressWarnings("this-escape") 110 public QualityValidator quality = new QualityValidator(this); 111 112 /** 113 * The validator for {@link MaintenanceInformation} and related objects. 114 * Vendors can change this field to a different validator, or change the setting 115 * of the referenced validator. This field shall not be set to {@code null} however. 116 * 117 * @since 3.1 118 */ 119 @SuppressWarnings("this-escape") 120 public MaintenanceValidator maintenance = new MaintenanceValidator(this); 121 122 /** 123 * The validator for {@link Extent} and related objects. 124 * Vendors can change this field to a different validator, or change the setting 125 * of the referenced validator. This field shall not be set to {@code null} however. 126 */ 127 @SuppressWarnings("this-escape") 128 public ExtentValidator extent = new ExtentValidator(this); 129 130 /** 131 * The validator for {@link Datum} and related objects. 132 * Vendors can change this field to a different validator, or change the setting 133 * of the referenced validator. This field shall not be set to {@code null} however. 134 */ 135 @SuppressWarnings("this-escape") 136 public DatumValidator datum = new DatumValidator(this); 137 138 /** 139 * The validator for {@link CoordinateSystem} and related objects. 140 * Vendors can change this field to a different validator, or change the setting 141 * of the referenced validator. This field shall not be set to {@code null} however. 142 */ 143 @SuppressWarnings("this-escape") 144 public CSValidator cs = new CSValidator(this); 145 146 /** 147 * The validator for {@link CoordinateReferenceSystem} and related objects. 148 * Vendors can change this field to a different validator, or change the setting 149 * of the referenced validator. This field shall not be set to {@code null} however. 150 */ 151 @SuppressWarnings("this-escape") 152 public CRSValidator crs = new CRSValidator(this); 153 154 /** 155 * The validator for {@link ParameterValue} and related objects. 156 * Vendors can change this field to a different validator, or change the setting 157 * of the referenced validator. This field shall not be set to {@code null} however. 158 */ 159 @SuppressWarnings("this-escape") 160 public ParameterValidator parameter = new ParameterValidator(this); 161 162 /** 163 * The validator for {@link CoordinateOperation} and related objects. 164 * Vendors can change this field to a different validator, or change the setting 165 * of the referenced validator. This field shall not be set to {@code null} however. 166 */ 167 @SuppressWarnings("this-escape") 168 public OperationValidator coordinateOperation = new OperationValidator(this); 169 170 /** 171 * The validator for {@link Geometry} and related objects. 172 * Vendors can change this field to a different validator, or change the setting 173 * of the referenced validator. This field shall not be set to {@code null} however. 174 */ 175 @SuppressWarnings("this-escape") 176 public GeometryValidator geometry = new GeometryValidator(this); 177 178 /** 179 * The validator for images and related objects. 180 * Vendors can change this field to a different validator, or change the setting 181 * of the referenced validator. This field shall not be set to {@code null} however. 182 */ 183 @SuppressWarnings("this-escape") 184 public ImageValidator image = new ImageValidator(this); 185 186 /** 187 * An unmodifiable "live" list of all validators. Any change to the value of a field declared 188 * in this class is reflected immediately in this list (so this list is <i>unmodifiable</i> 189 * but not <i>immutable</i>). This list is convenient if the same setting must be applied 190 * on all validators, for example in order to change their {@link Validator#logger logger} setting 191 * or to set their set {@link Validator#requireMandatoryAttributes requireMandatoryAttributes} 192 * field to {@code false}. 193 */ 194 public final List<Validator> all; 195 196 /** 197 * Creates a new {@code ValidatorContainer} initialized with new {@link Validator} instances. 198 * Note that this constructor does not inherit the configuration of the {@link Validators#DEFAULT} instance. 199 */ 200 public ValidatorContainer() { 201 all = new AbstractList<Validator>() { 202 /** Returns the number of elements in this list. */ 203 @Override public int size() { 204 return 13; 205 } 206 207 /** Returns the validator at the given index. */ 208 @Override public Validator get(final int index) { 209 switch (index) { 210 case 0: return naming; 211 case 1: return metadata; 212 case 2: return citation; 213 case 3: return quality; 214 case 4: return maintenance; 215 case 5: return extent; 216 case 6: return datum; 217 case 7: return cs; 218 case 8: return crs; 219 case 9: return parameter; 220 case 10: return coordinateOperation; 221 case 11: return geometry; 222 case 12: return image; 223 default: throw new IndexOutOfBoundsException(index); 224 } 225 } 226 }; 227 } 228 229 /** 230 * For each interface implemented by the given object, invokes the corresponding 231 * {@code validate(…)} method defined in this class (if any). 232 * Use this method only if the type is unknown at compile-time. 233 * 234 * @param object The object to dispatch to {@code validate(…)} methods, or {@code null}. 235 */ 236 public final void dispatch(final Object object) { 237 if (object instanceof Metadata) validate((Metadata) object); 238 if (object instanceof Citation) validate((Citation) object); 239 if (object instanceof CitationDate) validate((CitationDate) object); 240 if (object instanceof CitationDate[]) validate((CitationDate[]) object); 241 if (object instanceof Responsibility) validate((Responsibility) object); 242 if (object instanceof Party) validate((Party) object); 243 if (object instanceof Contact) validate((Contact) object); 244 if (object instanceof Telephone) validate((Telephone) object); 245 if (object instanceof Address) validate((Address) object); 246 if (object instanceof OnlineResource) validate((OnlineResource) object); 247 if (object instanceof DataQuality) validate((DataQuality) object); 248 if (object instanceof Element) validate((Element) object); // Dispatch according sub-type. 249 if (object instanceof Result) validate((Result) object); // Dispatch according sub-type. 250 if (object instanceof Extent) validate((Extent) object); 251 if (object instanceof GeographicExtent) validate((GeographicExtent) object); // Dispatch according sub-type. 252 if (object instanceof VerticalExtent) validate((VerticalExtent) object); 253 if (object instanceof TemporalExtent) validate((TemporalExtent) object); 254 if (object instanceof IdentifiedObject) validate((IdentifiedObject) object); // Dispatch according sub-type. 255 if (object instanceof Identifier) validate((Identifier) object); 256 if (object instanceof GenericName) validate((GenericName) object); // Dispatch according sub-type. 257 if (object instanceof NameSpace) validate((NameSpace) object); 258 if (object instanceof GeneralParameterValue) validate((GeneralParameterValue) object); // Dispatch according sub-type. 259 if (object instanceof Envelope) validate((Envelope) object); 260 if (object instanceof DirectPosition) validate((DirectPosition) object); 261 if (object instanceof InternationalString) validate((InternationalString) object); 262 } 263 264 /** 265 * Tests the conformance of the given object. 266 * 267 * @param object the object to test, or {@code null}. 268 * 269 * @see MetadataBaseValidator#validate(Metadata) 270 * 271 * @since 3.1 272 */ 273 public final void validate(final Metadata object) { 274 metadata.validate(object); 275 } 276 277 /** 278 * Tests the conformance of the given object. 279 * 280 * @param object the object to test, or {@code null}. 281 * 282 * @see CitationValidator#validate(Citation) 283 */ 284 public final void validate(final Citation object) { 285 citation.validate(object); 286 } 287 288 /** 289 * Tests the conformance of the given objects. 290 * 291 * @param object the objects to test, or {@code null}. 292 * 293 * @see CitationValidator#validate(CitationDate...) 294 * 295 * @since 3.1 296 */ 297 public final void validate(final CitationDate... object) { 298 citation.validate(object); 299 } 300 301 /** 302 * Tests the conformance of the given object. 303 * 304 * @param object the object to test, or {@code null}. 305 * 306 * @see CitationValidator#validate(Responsibility) 307 * 308 * @since 3.1 309 */ 310 public final void validate(final Responsibility object) { 311 citation.validate(object); 312 } 313 314 /** 315 * Tests the conformance of the given object. 316 * 317 * @param object the object to test, or {@code null}. 318 * 319 * @see CitationValidator#validate(Party) 320 * 321 * @since 3.1 322 */ 323 public final void validate(final Party object) { 324 citation.validate(object); 325 } 326 327 /** 328 * Tests the conformance of the given object. 329 * 330 * @param object the object to test, or {@code null}. 331 * 332 * @see CitationValidator#validate(Contact) 333 * 334 * @since 3.1 335 */ 336 public final void validate(final Contact object) { 337 citation.validate(object); 338 } 339 340 /** 341 * Tests the conformance of the given object. 342 * 343 * @param object the object to test, or {@code null}. 344 * 345 * @see CitationValidator#validate(Telephone) 346 * 347 * @since 3.1 348 */ 349 public final void validate(final Telephone object) { 350 citation.validate(object); 351 } 352 353 /** 354 * Tests the conformance of the given object. 355 * 356 * @param object the object to test, or {@code null}. 357 * 358 * @see CitationValidator#validate(Address) 359 * 360 * @since 3.1 361 */ 362 public final void validate(final Address object) { 363 citation.validate(object); 364 } 365 366 /** 367 * Tests the conformance of the given object. 368 * 369 * @param object the object to test, or {@code null}. 370 * 371 * @see CitationValidator#validate(OnlineResource) 372 * 373 * @since 3.1 374 */ 375 public final void validate(final OnlineResource object) { 376 citation.validate(object); 377 } 378 379 /** 380 * Tests the conformance of the given object. 381 * 382 * @param object the object to test, or {@code null}. 383 * 384 * @see QualityValidator#validate(DataQuality) 385 * 386 * @since 3.1 387 */ 388 public final void validate(final DataQuality object) { 389 quality.validate(object); 390 } 391 392 /** 393 * Tests the conformance of the given object. 394 * 395 * @param object the object to test, or {@code null}. 396 * 397 * @see QualityValidator#dispatch(Element) 398 * 399 * @since 3.1 400 */ 401 public final void validate(final Element object) { 402 quality.dispatch(object); 403 } 404 405 /** 406 * Tests the conformance of the given object. 407 * 408 * @param object the object to test, or {@code null}. 409 * 410 * @see MaintenanceValidator#validate(MaintenanceInformation) 411 * 412 * @since 3.1 413 */ 414 public final void validate(final PositionalAccuracy object) { 415 quality.validate(object); 416 } 417 418 /** 419 * Tests the conformance of the given object. 420 * 421 * @param object the object to test, or {@code null}. 422 * 423 * @see QualityValidator#dispatch(Result) 424 * 425 * @since 3.1 426 */ 427 public final void validate(final Result object) { 428 quality.dispatch(object); 429 } 430 431 /** 432 * Tests the conformance of the given object. 433 * 434 * @param object the object to test, or {@code null}. 435 * 436 * @see QualityValidator#validate(DescriptiveResult) 437 * 438 * @since 3.1 439 */ 440 public final void validate(final DescriptiveResult object) { 441 quality.validate(object); 442 } 443 444 /** 445 * Tests the conformance of the given object. 446 * 447 * @param object the object to test, or {@code null}. 448 * 449 * @see QualityValidator#validate(ConformanceResult) 450 * 451 * @since 3.1 452 */ 453 public final void validate(final ConformanceResult object) { 454 quality.validate(object); 455 } 456 457 /** 458 * Tests the conformance of the given object. 459 * 460 * @param object the object to test, or {@code null}. 461 * 462 * @see QualityValidator#validate(QuantitativeResult) 463 * 464 * @since 3.1 465 */ 466 public final void validate(final QuantitativeResult object) { 467 quality.validate(object); 468 } 469 470 /** 471 * Tests the conformance of the given object. 472 * 473 * @param object the object to test, or {@code null}. 474 * 475 * @see QualityValidator#validate(CoverageResult) 476 * 477 * @since 3.1 478 */ 479 public final void validate(final CoverageResult object) { 480 quality.validate(object); 481 } 482 483 /** 484 * Tests the conformance of the given object. 485 * 486 * @param object the object to test, or {@code null}. 487 * 488 * @see MaintenanceValidator#validate(MaintenanceInformation) 489 * 490 * @since 3.1 491 */ 492 public final void validate(final MaintenanceInformation object) { 493 maintenance.validate(object); 494 } 495 496 /** 497 * Tests the conformance of the given object. 498 * 499 * @param object the object to test, or {@code null}. 500 * 501 * @see MaintenanceValidator#validate(Scope) 502 * 503 * @since 3.1 504 */ 505 public final void validate(final Scope object) { 506 maintenance.validate(object); 507 } 508 509 /** 510 * Tests the conformance of the given object. 511 * 512 * @param object the object to test, or {@code null}. 513 * 514 * @see ExtentValidator#validate(Extent) 515 */ 516 public final void validate(final Extent object) { 517 extent.validate(object); 518 } 519 520 /** 521 * Tests the conformance of the given object. 522 * 523 * @param object the object to test, or {@code null}. 524 * 525 * @see ExtentValidator#validate(TemporalExtent) 526 */ 527 public final void validate(final TemporalExtent object) { 528 extent.validate(object); 529 } 530 531 /** 532 * Tests the conformance of the given object. 533 * 534 * @param object the object to test, or {@code null}. 535 * 536 * @see ExtentValidator#validate(VerticalExtent) 537 */ 538 public final void validate(final VerticalExtent object) { 539 extent.validate(object); 540 } 541 542 /** 543 * Tests the conformance of the given object. 544 * 545 * @param object the object to test, or {@code null}. 546 * 547 * @see ExtentValidator#dispatch(GeographicExtent) 548 */ 549 public final void validate(final GeographicExtent object) { 550 extent.dispatch(object); 551 } 552 553 /** 554 * Tests the conformance of the given object. 555 * 556 * @param object the object to test, or {@code null}. 557 * 558 * @see ExtentValidator#validate(GeographicDescription) 559 */ 560 public final void validate(final GeographicDescription object) { 561 extent.validate(object); 562 } 563 564 /** 565 * Tests the conformance of the given object. 566 * 567 * @param object the object to test, or {@code null}. 568 * 569 * @see ExtentValidator#validate(BoundingPolygon) 570 */ 571 public final void validate(final BoundingPolygon object) { 572 extent.validate(object); 573 } 574 575 /** 576 * Tests the conformance of the given object. 577 * 578 * @param object the object to test, or {@code null}. 579 * 580 * @see ExtentValidator#validate(GeographicBoundingBox) 581 */ 582 public final void validate(final GeographicBoundingBox object) { 583 extent.validate(object); 584 } 585 586 /** 587 * Tests the conformance of the given object. 588 * 589 * @param object the object to test, or {@code null}. 590 * 591 * @see GeometryValidator#validate(Envelope) 592 */ 593 public final void validate(final Envelope object) { 594 geometry.validate(object); 595 } 596 597 /** 598 * Tests the conformance of the given object. 599 * 600 * @param object the object to test, or {@code null}. 601 * 602 * @see GeometryValidator#validate(DirectPosition) 603 */ 604 public final void validate(final DirectPosition object) { 605 geometry.validate(object); 606 } 607 608 /** 609 * Tests the conformance of the given object. 610 * 611 * @param object the object to test, or {@code null}. 612 * 613 * @see CRSValidator#dispatch(CoordinateReferenceSystem) 614 */ 615 public final void validate(final CoordinateReferenceSystem object) { 616 crs.dispatch(object); 617 } 618 619 /** 620 * Tests the conformance of the given object. 621 * 622 * @param object the object to test, or {@code null}. 623 * 624 * @see CRSValidator#validate(GeodeticCRS) 625 * 626 * @since 3.1 627 */ 628 public final void validate(final GeodeticCRS object) { 629 crs.validate(object); 630 } 631 632 /** 633 * Validates the given coordinate reference system. 634 * 635 * @param object the object to validate, or {@code null}. 636 * 637 * @see CRSValidator#validate(ProjectedCRS) 638 */ 639 public final void validate(final ProjectedCRS object) { 640 crs.validate(object); 641 } 642 643 /** 644 * Validates the given coordinate reference system. 645 * 646 * @param object the object to validate, or {@code null}. 647 * 648 * @see CRSValidator#validate(DerivedCRS) 649 */ 650 public final void validate(final DerivedCRS object) { 651 crs.validate(object); 652 } 653 654 /** 655 * Validates the given coordinate reference system. 656 * 657 * @param object the object to validate, or {@code null}. 658 * 659 * @see CRSValidator#validate(ImageCRS) 660 * 661 * @deprecated {@code ImageCRS} is replaced by {@link EngineeringCRS} as of ISO 19111:2019. 662 */ 663 @Deprecated(since="3.1") 664 public final void validate(final ImageCRS object) { 665 crs.validate(object); 666 } 667 668 /** 669 * Validates the given coordinate reference system. 670 * 671 * @param object the object to validate, or {@code null}. 672 * 673 * @see CRSValidator#validate(EngineeringCRS) 674 */ 675 public final void validate(final EngineeringCRS object) { 676 crs.validate(object); 677 } 678 679 /** 680 * Validates the given coordinate reference system. 681 * 682 * @param object the object to validate, or {@code null}. 683 * 684 * @see CRSValidator#validate(VerticalCRS) 685 */ 686 public final void validate(final VerticalCRS object) { 687 crs.validate(object); 688 } 689 690 /** 691 * Validates the given coordinate reference system. 692 * 693 * @param object the object to validate, or {@code null}. 694 * 695 * @see CRSValidator#validate(TemporalCRS) 696 */ 697 public final void validate(final TemporalCRS object) { 698 crs.validate(object); 699 } 700 701 /** 702 * Validates the given coordinate reference system. 703 * 704 * @param object the object to validate, or {@code null}. 705 * 706 * @see CRSValidator#validate(CompoundCRS) 707 */ 708 public final void validate(final CompoundCRS object) { 709 crs.validate(object); 710 } 711 712 /** 713 * Tests the conformance of the given object. 714 * 715 * @param object the object to test, or {@code null}. 716 * 717 * @see CSValidator#dispatch(CoordinateSystem) 718 */ 719 public final void validate(final CoordinateSystem object) { 720 cs.dispatch(object); 721 } 722 723 /** 724 * Tests the conformance of the given object. 725 * 726 * @param object the object to test, or {@code null}. 727 * 728 * @see CSValidator#validate(CartesianCS) 729 */ 730 public final void validate(final CartesianCS object) { 731 cs.validate(object); 732 } 733 734 /** 735 * Tests the conformance of the given object. 736 * 737 * @param object the object to test, or {@code null}. 738 * 739 * @see CSValidator#validate(EllipsoidalCS) 740 */ 741 public final void validate(final EllipsoidalCS object) { 742 cs.validate(object); 743 } 744 745 /** 746 * Tests the conformance of the given object. 747 * 748 * @param object the object to test, or {@code null}. 749 * 750 * @see CSValidator#validate(SphericalCS) 751 */ 752 public final void validate(final SphericalCS object) { 753 cs.validate(object); 754 } 755 756 /** 757 * Tests the conformance of the given object. 758 * 759 * @param object the object to test, or {@code null}. 760 * 761 * @see CSValidator#validate(CylindricalCS) 762 */ 763 public final void validate(final CylindricalCS object) { 764 cs.validate(object); 765 } 766 767 /** 768 * Tests the conformance of the given object. 769 * 770 * @param object the object to test, or {@code null}. 771 * 772 * @see CSValidator#validate(PolarCS) 773 */ 774 public final void validate(final PolarCS object) { 775 cs.validate(object); 776 } 777 778 /** 779 * Tests the conformance of the given object. 780 * 781 * @param object the object to test, or {@code null}. 782 * 783 * @see CSValidator#validate(LinearCS) 784 */ 785 public final void validate(final LinearCS object) { 786 cs.validate(object); 787 } 788 789 /** 790 * Tests the conformance of the given object. 791 * 792 * @param object the object to test, or {@code null}. 793 * 794 * @see CSValidator#validate(VerticalCS) 795 */ 796 public final void validate(final VerticalCS object) { 797 cs.validate(object); 798 } 799 800 /** 801 * Tests the conformance of the given object. 802 * 803 * @param object the object to test, or {@code null}. 804 * 805 * @see CSValidator#validate(TimeCS) 806 */ 807 public final void validate(final TimeCS object) { 808 cs.validate(object); 809 } 810 811 /** 812 * Tests the conformance of the given object. 813 * 814 * @param object the object to test, or {@code null}. 815 * 816 * @see CSValidator#validate(UserDefinedCS) 817 */ 818 @Deprecated(since="3.1") 819 public final void validate(final UserDefinedCS object) { 820 cs.validate(object); 821 } 822 823 /** 824 * Tests the conformance of the given object. 825 * 826 * @param object the object to test, or {@code null}. 827 * 828 * @see CSValidator#validate(CoordinateSystemAxis) 829 */ 830 public final void validate(final CoordinateSystemAxis object) { 831 cs.validate(object); 832 } 833 834 /** 835 * Tests the conformance of the given object. 836 * 837 * @param object the object to test, or {@code null}. 838 * 839 * @see DatumValidator#dispatch(Datum) 840 */ 841 public final void validate(final Datum object) { 842 datum.dispatch(object); 843 } 844 845 /** 846 * Tests the conformance of the given object. 847 * 848 * @param object the object to test, or {@code null}. 849 * 850 * @see DatumValidator#validate(PrimeMeridian) 851 */ 852 public final void validate(final PrimeMeridian object) { 853 datum.validate(object); 854 } 855 856 /** 857 * Tests the conformance of the given object. 858 * 859 * @param object the object to test, or {@code null}. 860 * 861 * @see DatumValidator#validate(Ellipsoid) 862 */ 863 public final void validate(final Ellipsoid object) { 864 datum.validate(object); 865 } 866 867 /** 868 * Tests the conformance of the given object. 869 * 870 * @param object the object to test, or {@code null}. 871 * 872 * @see DatumValidator#validate(GeodeticDatum) 873 */ 874 public final void validate(final GeodeticDatum object) { 875 datum.validate(object); 876 } 877 878 /** 879 * Tests the conformance of the given object. 880 * 881 * @param object the object to test, or {@code null}. 882 * 883 * @see DatumValidator#validate(VerticalDatum) 884 */ 885 public final void validate(final VerticalDatum object) { 886 datum.validate(object); 887 } 888 889 /** 890 * Tests the conformance of the given object. 891 * 892 * @param object the object to test, or {@code null}. 893 * 894 * @see DatumValidator#validate(TemporalDatum) 895 */ 896 public final void validate(final TemporalDatum object) { 897 datum.validate(object); 898 } 899 900 /** 901 * Tests the conformance of the given object. 902 * 903 * @param object the object to test, or {@code null}. 904 * 905 * @see DatumValidator#validate(ImageDatum) 906 * 907 * @deprecated {@code ImageCRS} is replaced by {@link EngineeringCRS} as of ISO 19111:2019. 908 */ 909 @Deprecated(since="3.1") 910 @SuppressWarnings("removal") 911 public final void validate(final ImageDatum object) { 912 datum.validate(object); 913 } 914 915 /** 916 * Tests the conformance of the given object. 917 * 918 * @param object the object to test, or {@code null}. 919 * 920 * @see DatumValidator#validate(EngineeringDatum) 921 */ 922 public final void validate(final EngineeringDatum object) { 923 datum.validate(object); 924 } 925 926 /** 927 * Tests the conformance of the given object. 928 * 929 * @param object the object to test, or {@code null}. 930 * 931 * @see DatumValidator#validate(DatumEnsemble) 932 * 933 * @since 3.1 934 */ 935 public final void validate(final DatumEnsemble<?> object) { 936 datum.validate(object); 937 } 938 939 /** 940 * Tests the conformance of the given object. 941 * 942 * @param object the object to test, or {@code null}. 943 * 944 * @see OperationValidator#dispatch(CoordinateOperation) 945 */ 946 public final void validate(final CoordinateOperation object) { 947 coordinateOperation.dispatch(object); 948 } 949 950 /** 951 * Tests the conformance of the given object. 952 * 953 * @param object the object to test, or {@code null}. 954 * 955 * @see OperationValidator#validate(Conversion) 956 */ 957 public final void validate(final Conversion object) { 958 coordinateOperation.validate(object); 959 } 960 961 /** 962 * Tests the conformance of the given object. 963 * 964 * @param object the object to test, or {@code null}. 965 * 966 * @see OperationValidator#validate(Transformation) 967 */ 968 public final void validate(final Transformation object) { 969 coordinateOperation.validate(object); 970 } 971 972 /** 973 * Tests the conformance of the given object. 974 * 975 * @param object the object to test, or {@code null}. 976 * 977 * @see OperationValidator#validate(PointMotionOperation) 978 * @since 3.1 979 */ 980 public final void validate(final PointMotionOperation object) { 981 coordinateOperation.validate(object); 982 } 983 984 /** 985 * Tests the conformance of the given object. 986 * 987 * @param object the object to test, or {@code null}. 988 * 989 * @see OperationValidator#validate(ConcatenatedOperation) 990 */ 991 public final void validate(final ConcatenatedOperation object) { 992 coordinateOperation.validate(object); 993 } 994 995 /** 996 * Tests the conformance of the given object. 997 * 998 * @param object the object to test, or {@code null}. 999 * 1000 * @see OperationValidator#validate(PassThroughOperation) 1001 */ 1002 public final void validate(final PassThroughOperation object) { 1003 coordinateOperation.validate(object); 1004 } 1005 1006 /** 1007 * Tests the conformance of the given object. 1008 * 1009 * @param object the object to test, or {@code null}. 1010 * 1011 * @see OperationValidator#validate(OperationMethod) 1012 */ 1013 public final void validate(final OperationMethod object) { 1014 coordinateOperation.validate(object); 1015 } 1016 1017 /** 1018 * Tests the conformance of the given object. 1019 * 1020 * @param object the object to test, or {@code null}. 1021 * 1022 * @see OperationValidator#validate(OperationMethod) 1023 */ 1024 public final void validate(final Formula object) { 1025 coordinateOperation.validate(object); 1026 } 1027 1028 /** 1029 * Tests the conformance of the given object. 1030 * 1031 * @param object the object to test, or {@code null}. 1032 * 1033 * @see OperationValidator#validate(MathTransform) 1034 */ 1035 public final void validate(final MathTransform object) { 1036 coordinateOperation.validate(object); 1037 } 1038 1039 /** 1040 * Tests the conformance of the given object. 1041 * 1042 * @param object the object to test, or {@code null}. 1043 * 1044 * @see ParameterValidator#dispatch(GeneralParameterDescriptor) 1045 */ 1046 public final void validate(final GeneralParameterDescriptor object) { 1047 parameter.dispatch(object); 1048 } 1049 1050 /** 1051 * Tests the conformance of the given object. 1052 * 1053 * @param object the object to test, or {@code null}. 1054 * 1055 * @see ParameterValidator#validate(ParameterDescriptor) 1056 */ 1057 public final void validate(final ParameterDescriptor<?> object) { 1058 parameter.validate(object); 1059 } 1060 1061 /** 1062 * Tests the conformance of the given object. 1063 * 1064 * @param object the object to test, or {@code null}. 1065 * 1066 * @see ParameterValidator#validate(ParameterDescriptorGroup) 1067 */ 1068 public final void validate(final ParameterDescriptorGroup object) { 1069 parameter.validate(object); 1070 } 1071 1072 /** 1073 * Tests the conformance of the given object. 1074 * 1075 * @param object the object to test, or {@code null}. 1076 * 1077 * @see ParameterValidator#dispatch(GeneralParameterValue) 1078 */ 1079 public final void validate(final GeneralParameterValue object) { 1080 parameter.dispatch(object); 1081 } 1082 1083 /** 1084 * Tests the conformance of the given object. 1085 * 1086 * @param object the object to test, or {@code null}. 1087 * 1088 * @see ParameterValidator#validate(ParameterValue) 1089 */ 1090 public final void validate(final ParameterValue<?> object) { 1091 parameter.validate(object); 1092 } 1093 1094 /** 1095 * Tests the conformance of the given object. 1096 * 1097 * @param object the object to test, or {@code null}. 1098 * 1099 * @see ParameterValidator#validate(ParameterValueGroup) 1100 */ 1101 public final void validate(final ParameterValueGroup object) { 1102 parameter.validate(object); 1103 } 1104 1105 /** 1106 * Tests the conformance of the given object. 1107 * 1108 * @param object the object to test, or {@code null}. 1109 * 1110 * @see ReferencingValidator#dispatchObject(IdentifiedObject) 1111 */ 1112 public final void validate(final IdentifiedObject object) { 1113 crs.dispatchObject(object); 1114 } 1115 1116 /** 1117 * Tests the conformance of the given object. 1118 * 1119 * @param object the object to test, or {@code null}. 1120 * 1121 * @see ReferencingValidator#validate(ObjectDomain) 1122 * 1123 * @since 3.1 1124 */ 1125 public final void validate(final ObjectDomain object) { 1126 crs.validate(object); 1127 } 1128 1129 /** 1130 * Tests the conformance of the given object. 1131 * 1132 * @param object the object to test, or {@code null}. 1133 * 1134 * @see MetadataBaseValidator#validate(Identifier) 1135 * 1136 * @since 3.1 1137 */ 1138 public final void validate(final Identifier object) { 1139 metadata.validate(object); 1140 } 1141 1142 /** 1143 * Tests the conformance of the given object. 1144 * 1145 * @param object the object to test, or {@code null}. 1146 * 1147 * @see NameValidator#dispatch(GenericName) 1148 */ 1149 public final void validate(final GenericName object) { 1150 naming.dispatch(object); 1151 } 1152 1153 /** 1154 * Tests the conformance of the given object. 1155 * 1156 * @param object the object to test, or {@code null}. 1157 * 1158 * @see NameValidator#validate(LocalName) 1159 */ 1160 public final void validate(final LocalName object) { 1161 naming.validate(object); 1162 } 1163 1164 /** 1165 * Tests the conformance of the given object. 1166 * 1167 * @param object the object to test, or {@code null}. 1168 * 1169 * @see NameValidator#validate(ScopedName) 1170 */ 1171 public final void validate(final ScopedName object) { 1172 naming.validate(object); 1173 } 1174 1175 /** 1176 * Tests the conformance of the given object. 1177 * 1178 * @param object the object to test, or {@code null}. 1179 * 1180 * @see NameValidator#validate(NameSpace) 1181 */ 1182 public final void validate(final NameSpace object) { 1183 naming.validate(object); 1184 } 1185 1186 /** 1187 * Tests the conformance of the given object. 1188 * 1189 * @param object the object to test, or {@code null}. 1190 * 1191 * @see NameValidator#validate(InternationalString) 1192 */ 1193 public final void validate(final InternationalString object) { 1194 naming.validate(object); 1195 } 1196 1197 /** 1198 * Tests the conformance of the given object. 1199 * 1200 * @param object the object to test, or {@code null}. 1201 * 1202 * @see ImageValidator#validate(ImageReaderSpi) 1203 */ 1204 public final void validate(final ImageReaderSpi object) { 1205 image.validate(object); 1206 } 1207 1208 /** 1209 * Tests the conformance of the given object. 1210 * 1211 * @param object the object to test, or {@code null}. 1212 * 1213 * @see ImageValidator#validate(ImageWriterSpi) 1214 */ 1215 public final void validate(final ImageWriterSpi object) { 1216 image.validate(object); 1217 } 1218 1219 /** 1220 * Tests the conformance of the given object. 1221 * 1222 * @param object the object to test, or {@code null}. 1223 * 1224 * @see ImageValidator#validate(IIOMetadataFormat) 1225 */ 1226 public final void validate(final IIOMetadataFormat object) { 1227 image.validate(object); 1228 } 1229}