Author: desruisseaux
Date: Wed Apr 20 17:40:11 2016
New Revision: 1740177
URL: http://svn.apache.org/viewvc?rev=1740177&view=rev
Log:
Merge from the JDK6 branch.
Added:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/
- copied from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/internal/
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/StringJoinOperationTest.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/StringJoinOperationTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/
- copied from r1740152,
sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/internal/
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CD_ParametricDatum.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CD_ParametricDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_ParametricCS.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_ParametricCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/SignReversalComment.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/SignReversalComment.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeodeticOperation.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeodeticOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic2Dto3D.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic2Dto3D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3DtoVertical.txt
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3DtoVertical.txt
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Interpolation1D.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Interpolation1D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Providers.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Providers.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultParametricCRS.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultParametricCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/ParametricCRS.java
(with props)
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultParametricCS.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultParametricCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultParametricDatum.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultParametricDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubOperationInfo.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubOperationInfo.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearInterpolator1D.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearInterpolator1D.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProviderMock.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProviderMock.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
- copied unchanged from r1740152,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearInterpolator1DTest.java
- copied, changed from r1740152,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/LinearInterpolator1DTest.java
Removed:
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CoordinateOperations.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationInference.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/AllProvidersTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MockProvider.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationInferenceTest.java
Modified:
sis/trunk/ (props changed)
sis/trunk/core/sis-feature/pom.xml
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureType.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Features.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/feature/AttributeConvention.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/internal/feature/FeatureTypeBuilder.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/FeaturesTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/LinkOperationTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/feature/AttributeConventionTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/internal/feature/FeatureTypeBuilderTest.java
sis/trunk/core/sis-feature/src/test/java/org/apache/sis/test/suite/FeatureTestSuite.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/SubEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_OperationMethod.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbridgedMolodensky.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation3D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3Dto2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MolodenskyInterpolation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param3D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/VerticalOffset.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AuthorityFactories.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticObjectFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/InstallationScriptProvider.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CRSPair.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationContext.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform1D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform1D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/package-info.java
sis/trunk/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/SeismicBinGridMock.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/TopocentricConversionMock.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGDataFormatter.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatricesTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactoryTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
Propchange: sis/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 17:40:11 2016
@@ -1,4 +1,4 @@
/sis/branches/Android:1430670-1480699
-/sis/branches/JDK6:1394364-1737105
-/sis/branches/JDK7:1394913-1737089
-/sis/branches/JDK8:1584960-1737071
+/sis/branches/JDK6:1394364-1740152
+/sis/branches/JDK7:1394913-1740146
+/sis/branches/JDK8:1584960-1740143
Modified: sis/trunk/core/sis-feature/pom.xml
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/pom.xml?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/pom.xml (original)
+++ sis/trunk/core/sis-feature/pom.xml Wed Apr 20 17:40:11 2016
@@ -132,6 +132,20 @@ Representations of geographic features.
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.sis.core</groupId>
+ <artifactId>sis-metadata</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sis.core</groupId>
+ <artifactId>sis-referencing</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractAttribute.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -32,8 +32,10 @@ import org.apache.sis.util.Debug;
import org.apache.sis.util.Classes;
import org.apache.sis.util.ArgumentChecks;
+// Branch-dependent imports
import org.apache.sis.internal.jdk7.JDK7;
+
/**
* An instance of an {@linkplain DefaultAttributeType attribute type}
containing the value of an attribute in a feature.
* {@code Attribute} holds three main information:
@@ -98,7 +100,7 @@ public abstract class AbstractAttribute<
/**
* Creates a new attribute of the given type.
*
- * @param type Information about the attribute (base Java class, domain of
values, <i>etc.</i>).
+ * @param type information about the attribute (base Java class, domain
of values, <i>etc.</i>).
*
* @see #create(DefaultAttributeType)
*/
@@ -110,9 +112,9 @@ public abstract class AbstractAttribute<
* Creates a new attribute of the given type initialized to the
* {@linkplain DefaultAttributeType#getDefaultValue() default value}.
*
- * @param <V> The type of attribute values.
- * @param type Information about the attribute (base Java class, domain
of values, <i>etc.</i>).
- * @return The new attribute.
+ * @param <V> the type of attribute values.
+ * @param type information about the attribute (base Java class, domain
of values, <i>etc.</i>).
+ * @return the new attribute.
*
* @see DefaultAttributeType#newInstance()
*/
@@ -127,9 +129,9 @@ public abstract class AbstractAttribute<
* Creates a new attribute of the given type initialized to the given
value.
* Note that a {@code null} value may not be the same as the default value.
*
- * @param <V> The type of attribute values.
- * @param type Information about the attribute (base Java class, domain
of values, <i>etc.</i>).
- * @param value The initial value (may be {@code null}).
+ * @param <V> the type of attribute values.
+ * @param type information about the attribute (base Java class, domain
of values, <i>etc.</i>).
+ * @param value the initial value (may be {@code null}).
* @return The new attribute.
*/
static <V> AbstractAttribute<V> create(final DefaultAttributeType<V> type,
final Object value) {
@@ -142,8 +144,8 @@ public abstract class AbstractAttribute<
/**
* Invoked on serialization for saving the {@link #characteristics} field.
*
- * @param out The output stream where to serialize this attribute.
- * @throws IOException If an I/O error occurred while writing.
+ * @param out the output stream where to serialize this attribute.
+ * @throws IOException if an I/O error occurred while writing.
*/
private void writeObject(final ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
@@ -159,9 +161,9 @@ public abstract class AbstractAttribute<
/**
* Invoked on deserialization for restoring the {@link #characteristics}
field.
*
- * @param in The input stream from which to deserialize an attribute.
- * @throws IOException If an I/O error occurred while reading or if the
stream contains invalid data.
- * @throws ClassNotFoundException If the class serialized on the stream is
not on the classpath.
+ * @param in the input stream from which to deserialize an attribute.
+ * @throws IOException if an I/O error occurred while reading or if the
stream contains invalid data.
+ * @throws ClassNotFoundException if the class serialized on the stream is
not on the classpath.
*/
private void readObject(final ObjectInputStream in) throws IOException,
ClassNotFoundException {
in.defaultReadObject();
@@ -180,7 +182,7 @@ public abstract class AbstractAttribute<
* Returns the name of this attribute as defined by its {@linkplain
#getType() type}.
* This convenience method delegates to {@link
DefaultAttributeType#getName()}.
*
- * @return The attribute name specified by its type.
+ * @return the attribute name specified by its type.
*/
@Override
public GenericName getName() {
@@ -193,7 +195,7 @@ public abstract class AbstractAttribute<
* <div class="warning"><b>Warning:</b> In a future SIS version, the
return type may be changed
* to {@code org.opengis.feature.AttributeType}. This change is pending
GeoAPI revision.</div>
*
- * @return Information about the attribute.
+ * @return information about the attribute.
*/
public DefaultAttributeType<V> getType() {
return type;
@@ -204,7 +206,7 @@ public abstract class AbstractAttribute<
* the common case where the {@linkplain
DefaultAttributeType#getMaximumOccurs() maximum number}
* of attribute values is restricted to 1 or 0.
*
- * @return The attribute value (may be {@code null}).
+ * @return the attribute value (may be {@code null}).
* @throws IllegalStateException if this attribute contains more than one
value.
*
* @see AbstractFeature#getPropertyValue(String)
@@ -220,7 +222,7 @@ public abstract class AbstractAttribute<
* <p>The default implementation returns a collection which will delegate
its work to
* {@link #getValue()} and {@link #setValue(Object)}.</p>
*
- * @return The attribute values in a <cite>live</cite> collection.
+ * @return the attribute values in a <cite>live</cite> collection.
*/
@Override
public Collection<V> getValues() {
@@ -236,12 +238,14 @@ public abstract class AbstractAttribute<
* and also because some rules may be temporarily broken while
constructing a feature.
* A more exhaustive verification can be performed by invoking the {@link
#quality()} method.
*
- * @param value The new value, or {@code null} for removing all values
from this attribute.
+ * @param value the new value, or {@code null} for removing all values
from this attribute.
+ * @throws IllegalArgumentException if this method verifies argument
validity and the given value
+ * does not met the attribute constraints.
*
* @see AbstractFeature#setPropertyValue(String, Object)
*/
@Override
- public abstract void setValue(final V value);
+ public abstract void setValue(final V value) throws
IllegalArgumentException;
/**
* Sets the attribute values. All previous values are replaced by the
given collection.
@@ -249,7 +253,7 @@ public abstract class AbstractAttribute<
* <p>The default implementation ensures that the given collection
contains at most one element,
* then delegates to {@link #setValue(Object)}.</p>
*
- * @param values The new values.
+ * @param values the new values.
* @throws IllegalArgumentException if the given collection contains too
many elements.
*/
@Override
@@ -328,7 +332,7 @@ public abstract class AbstractAttribute<
* }</li>
* </ol>
*
- * @return Other attribute types that describes this attribute type, or an
empty map if none.
+ * @return other attribute types that describes this attribute type, or an
empty map if none.
*
* @see DefaultAttributeType#characteristics()
*/
@@ -337,7 +341,7 @@ public abstract class AbstractAttribute<
if (characteristics == null) {
characteristics = newCharacteristicsMap();
}
- return characteristics; // Intentionally modifiable
+ return characteristics; //
Intentionally modifiable
}
/**
@@ -432,7 +436,7 @@ public abstract class AbstractAttribute<
* }
* </div>
*
- * @return Reports on all constraint violations found.
+ * @return reports on all constraint violations found.
*
* @see AbstractFeature#quality()
*/
@@ -452,7 +456,7 @@ public abstract class AbstractAttribute<
* └─ characteristics: units=°C, accuracy=0.1
* }
*
- * @return A string representation of this attribute for debugging purpose.
+ * @return a string representation of this attribute for debugging purpose.
*/
@Debug
@Override
@@ -477,7 +481,7 @@ public abstract class AbstractAttribute<
* are <strong>not</strong> cloned.
* However subclasses may choose to do otherwise.
*
- * @return A clone of this attribute.
+ * @return a clone of this attribute.
* @throws CloneNotSupportedException if this attribute, the {@linkplain
#getValue() value}
* or one of its {@linkplain #characteristics() characteristics}
can not be cloned.
*/
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractFeature.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -61,7 +61,7 @@ import org.apache.sis.internal.util.Chec
* @author Johann Sorel (Geomatys)
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.6
+ * @version 0.7
* @module
*
* @see DefaultFeatureType#newInstance()
@@ -222,7 +222,7 @@ public abstract class AbstractFeature im
final Object getOperationValue(final String name) {
final AbstractOperation operation = (AbstractOperation)
type.getProperty(name);
if (operation instanceof LinkOperation) {
- return getPropertyValue(((LinkOperation) operation).propertyName);
+ return getPropertyValue(((LinkOperation) operation).referentName);
}
final Object result = operation.apply(this, null);
if (result instanceof AbstractAttribute<?>) {
@@ -240,7 +240,7 @@ public abstract class AbstractFeature im
final void setOperationValue(final String name, final Object value) {
final AbstractOperation operation = (AbstractOperation)
type.getProperty(name);
if (operation instanceof LinkOperation) {
- setPropertyValue(((LinkOperation) operation).propertyName, value);
+ setPropertyValue(((LinkOperation) operation).referentName, value);
} else {
final Object result = operation.apply(this, null);
if (result instanceof Property) {
@@ -264,7 +264,8 @@ public abstract class AbstractFeature im
if (pt instanceof DefaultAttributeType<?>) {
return getDefaultValue((DefaultAttributeType<?>) pt);
} else if (pt instanceof DefaultAssociationRole) {
- return null; // No default value for associations.
+ final int maximumOccurs = ((DefaultAssociationRole)
pt).getMaximumOccurs();
+ return maximumOccurs > 1 ? Collections.EMPTY_LIST : null; //
No default value for associations.
} else {
throw unsupportedPropertyType(pt.getName());
}
@@ -577,14 +578,14 @@ public abstract class AbstractFeature im
* @param value The value, which shall be non-null.
*/
private static ClassCastException illegalValueClass(final GenericName
name, final Object value) {
- return new
ClassCastException(Errors.format(Errors.Keys.IllegalPropertyClass_2, name,
value.getClass()));
+ return new
ClassCastException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2, name,
value.getClass()));
}
/**
* Returns the exception for a property value (usually a feature) of wrong
type.
*/
private static IllegalArgumentException illegalPropertyType(final
GenericName name, final Object value) {
- return new
IllegalArgumentException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
name, value));
+ return new
IllegalArgumentException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2,
name, value));
}
/**
@@ -637,20 +638,7 @@ public abstract class AbstractFeature im
*/
public DataQuality quality() {
final Validator v = new Validator(ScopeCode.FEATURE);
- for (final AbstractIdentifiedType pt : type.getProperties(true)) {
- final Property property = (Property)
getProperty(pt.getName().toString());
- final DataQuality quality;
- if (property instanceof AbstractAttribute<?>) {
- quality = ((AbstractAttribute<?>) property).quality();
- } else if (property instanceof AbstractAssociation) {
- quality = ((AbstractAssociation) property).quality();
- } else {
- continue;
- }
- if (quality != null) { // Should not be null, but let be safe.
- v.quality.getReports().addAll(quality.getReports());
- }
- }
+ v.validate(type, this);
return v.quality;
}
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -166,7 +166,7 @@ public class AbstractIdentifiedType impl
* is used only on a <cite>best effort</cite> basis. The locale is
discarded after successful construction
* since localizations are applied by the {@link
InternationalString#toString(Locale)} method.</p>
*
- * @param identification The name and other information to be given to
this identified type.
+ * @param identification the name and other information to be given to
this identified type.
* @throws IllegalArgumentException if a property has an invalid value.
*/
@SuppressWarnings("OverridableMethodCallDuringObjectConstruction")
@@ -182,7 +182,7 @@ public class AbstractIdentifiedType impl
name = (GenericName) value;
} else {
throw new
IllegalArgumentException(Errors.getResources(identification).getString(
- Errors.Keys.IllegalPropertyClass_2, NAME_KEY,
value.getClass()));
+ Errors.Keys.IllegalPropertyValueClass_2, NAME_KEY,
value.getClass()));
}
definition = Types.toInternationalString(identification,
DEFINITION_KEY );
designation = Types.toInternationalString(identification,
DESIGNATION_KEY);
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractOperation.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -19,6 +19,7 @@ package org.apache.sis.feature;
import java.util.Map;
import java.util.Set;
import java.util.Collections;
+import java.util.HashMap;
import org.opengis.util.GenericName;
import org.opengis.parameter.GeneralParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
@@ -60,6 +61,12 @@ public abstract class AbstractOperation
private static final long serialVersionUID = -179930765502963170L;
/**
+ * The prefix for result identification entries in the {@code
identification} map.
+ * This prefix is documented in {@link FeatureOperations} javadoc.
+ */
+ static final String RESULT_PREFIX = "result.";
+
+ /**
* Constructs an operation from the given properties. The identification
map is given unchanged to
* the {@linkplain AbstractIdentifiedType#AbstractIdentifiedType(Map)
super-class constructor}.
*
@@ -70,6 +77,27 @@ public abstract class AbstractOperation
}
/**
+ * Returns a map that can be used for creating the {@link #getResult()}
type.
+ * This method can be invoked for subclass constructor.
+ */
+ final Map<String,Object> resultIdentification(final Map<String,?>
identification) {
+ final Map<String,Object> properties = new HashMap<String,Object>(6);
+ for (final Map.Entry<String,?> entry : identification.entrySet()) {
+ final String key = entry.getKey();
+ if (key != null && key.startsWith(RESULT_PREFIX)) {
+ properties.put(key.substring(RESULT_PREFIX.length()),
entry.getValue());
+ }
+ }
+ if (properties.isEmpty()) {
+ properties.put(NAME_KEY, super.getName()); // Do
not invoke user-overrideable method.
+ properties.put(DEFINITION_KEY, super.getDefinition());
+ properties.put(DESIGNATION_KEY, super.getDesignation());
+ properties.put(DESCRIPTION_KEY, super.getDescription());
+ }
+ return properties;
+ }
+
+ /**
* Returns a description of the input parameters.
*
* @return Description of the input parameters.
@@ -121,6 +149,9 @@ public abstract class AbstractOperation
/**
* Returns the names of feature properties that this operation needs for
performing its task.
+ * This method does not resolve transitive dependencies, i.e. if a
dependency is itself an operation having
+ * other dependencies, the returned set will contain the name of that
operation but not the names of that
+ * operation dependencies (unless they are the same that the direct
dependencies of {@code this}).
*
* <div class="note"><b>Rational:</b>
* this information is needed for writing the {@code SELECT} SQL statement
to send to a database server.
@@ -138,7 +169,7 @@ public abstract class AbstractOperation
/**
* Returns a hash code value for this operation.
- * The default implementation computes a hash code from the {@linkplain
#getParameters() parameters}
+ * The default implementation computes a hash code from the {@linkplain
#getParameters() parameters descriptor}
* and {@linkplain #getResult() result type}.
*
* @return {@inheritDoc}
@@ -150,7 +181,7 @@ public abstract class AbstractOperation
/**
* Compares this operation with the given object for equality.
- * The default implementation compares the {@linkplain #getParameters()
parameters}
+ * The default implementation compares the {@linkplain #getParameters()
parameters descriptor}
* and {@linkplain #getResult() result type}.
*
* @return {@inheritDoc}
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultFeatureType.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -580,6 +580,7 @@ public class DefaultFeatureType extends
* @param type The type to be checked.
* @return {@code true} if instances of the given type can be assigned to
association of this type.
*/
+ @Override
public boolean isAssignableFrom(final DefaultFeatureType type) {
if (type == this) {
return true; // Optimization for a common case.
@@ -704,6 +705,7 @@ public class DefaultFeatureType extends
* @return Feature operation, attribute type and association role that
carries characteristics of this
* feature type (not including parent types).
*/
+ @Override
public final Collection<AbstractIdentifiedType> getProperties(final
boolean includeSuperTypes) {
return includeSuperTypes ? allProperties : properties;
}
Copied:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
(from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java)
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java?p2=sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java&p1=sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java&r1=1740152&r2=1740177&rev=1740177&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -37,13 +37,6 @@ import org.apache.sis.referencing.CRS;
import org.apache.sis.util.resources.Errors;
// Branch-dependent imports
-import org.opengis.feature.Attribute;
-import org.opengis.feature.AttributeType;
-import org.opengis.feature.Feature;
-import org.opengis.feature.IdentifiedType;
-import org.opengis.feature.Operation;
-import org.opengis.feature.Property;
-import org.opengis.feature.PropertyType;
import org.apache.sis.internal.jdk8.JDK8;
import org.apache.sis.internal.jdk7.Objects;
@@ -113,7 +106,7 @@ final class EnvelopeOperation extends Ab
/**
* The type of the result returned by the envelope operation.
*/
- private final AttributeType<Envelope> resultType;
+ private final DefaultAttributeType<Envelope> resultType;
/**
* Creates a new operation computing the envelope of features of the given
type.
@@ -123,7 +116,7 @@ final class EnvelopeOperation extends Ab
* @param geometryAttributes the operation or attribute type from which to
get geometry values.
*/
EnvelopeOperation(final Map<String,?> identification,
CoordinateReferenceSystem crs,
- final PropertyType[] geometryAttributes) throws FactoryException
+ final AbstractIdentifiedType[] geometryAttributes) throws
FactoryException
{
super(identification);
String defaultGeometry = null;
@@ -138,7 +131,7 @@ final class EnvelopeOperation extends Ab
*/
boolean characterizedByCRS = false;
final Map<String,CoordinateReferenceSystem> names = new
LinkedHashMap<String,CoordinateReferenceSystem>(4);
- for (IdentifiedType property : geometryAttributes) {
+ for (AbstractIdentifiedType property : geometryAttributes) {
if (AttributeConvention.isGeometryAttribute(property)) {
final GenericName name = property.getName();
final String attributeName = (property instanceof
LinkOperation)
@@ -148,8 +141,8 @@ final class EnvelopeOperation extends Ab
defaultGeometry = attributeName;
}
CoordinateReferenceSystem attributeCRS = null;
- while (property instanceof Operation) {
- property = ((Operation) property).getResult();
+ while (property instanceof AbstractOperation) {
+ property = ((AbstractOperation) property).getResult();
}
/*
* At this point 'property' is an attribute, otherwise
isGeometryAttribute(property) would have
@@ -157,7 +150,7 @@ final class EnvelopeOperation extends Ab
* have the "CRS" characteristic. Note that we can not rely on
'attributeCRS' being non-null
* because an attribute may be characterized by a CRS without
providing default CRS.
*/
- final AttributeType<?> at = ((AttributeType<?>)
property).characteristics().get(characteristicName);
+ final DefaultAttributeType<?> at = ((DefaultAttributeType<?>)
property).characteristics().get(characteristicName);
if (at != null &&
CoordinateReferenceSystem.class.isAssignableFrom(at.getValueClass())) {
attributeCRS = (CoordinateReferenceSystem)
at.getDefaultValue(); // May still null.
if (crs == null && isDefault) {
@@ -223,7 +216,7 @@ final class EnvelopeOperation extends Ab
* @return an {@code AttributeType<Envelope>}.
*/
@Override
- public IdentifiedType getResult() {
+ public AbstractIdentifiedType getResult() {
return resultType;
}
@@ -248,7 +241,7 @@ final class EnvelopeOperation extends Ab
* @return the envelope of geometries in feature property values.
*/
@Override
- public Property apply(Feature feature, ParameterValueGroup parameters) {
+ public Property apply(AbstractFeature feature, ParameterValueGroup
parameters) {
return new Result(feature);
}
@@ -268,12 +261,12 @@ final class EnvelopeOperation extends Ab
/**
* The feature specified to the {@link
StringJoinOperation#apply(Feature, ParameterValueGroup)} method.
*/
- private final Feature feature;
+ private final AbstractFeature feature;
/**
* Creates a new attribute for the given feature.
*/
- Result(final Feature feature) {
+ Result(final AbstractFeature feature) {
super(resultType);
this.feature = feature;
}
@@ -308,7 +301,7 @@ final class EnvelopeOperation extends Ab
* We do not distinguish which particular property may
have a CRS characteristic because SIS 0.7
* implementations of DenseFeature and SparseFeature have
a "all of nothing" behavior anyway.
*/
- final Property property = feature.getProperty(name);
+ final Property property = (Property)
feature.getProperty(name);
genv = Geometries.getEnvelope(property.getValue());
if (genv == null) continue;
/*
@@ -317,7 +310,7 @@ final class EnvelopeOperation extends Ab
* cases where a CRS characteristic is associated to a
particular feature, we will let
* Envelopes.transform(…) searches a coordinate operation.
*/
- final Attribute<?> at = ((Attribute<?>)
property).characteristics()
+ final AbstractAttribute<?> at = ((AbstractAttribute<?>)
property).characteristics()
.get(AttributeConvention.CRS_CHARACTERISTIC.toString());
try {
if (at == null) {
@@ -351,7 +344,7 @@ final class EnvelopeOperation extends Ab
*/
@Override
public void setValue(Envelope value) {
- throw new
UnsupportedOperationException(Errors.format(Errors.Keys.UnmodifiableObject_1,
Attribute.class));
+ throw new
UnsupportedOperationException(Errors.format(Errors.Keys.UnmodifiableObject_1,
AbstractAttribute.class));
}
}
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureFormat.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -207,7 +207,7 @@ header: for (int i=0; ; i++) {
value =
feature.getPropertyValue(propertyType.getName().toString());
if (value == null) {
if (propertyType instanceof FieldType && ((FieldType)
propertyType).getMinimumOccurs() == 0) {
- continue; // If no value, skip the full row.
+ continue; // If
no value, skip the full row.
}
}
} else if (propertyType instanceof DefaultAttributeType<?>) {
@@ -305,7 +305,7 @@ header: for (int i=0; ; i++) {
Object c = attribute.getDefaultValue();
if (feature != null) {
final Object p =
feature.getProperty(propertyType.getName().toString());
- if (p instanceof AbstractAttribute<?>) { //
Should always be true, but we are paranoiac.
+ if (p instanceof AbstractAttribute<?>) { //
Should always be true, but we are paranoiac.
c = ((AbstractAttribute<?>)
p).characteristics().get(attribute.getName().toString());
}
}
@@ -326,11 +326,11 @@ header: for (int i=0; ; i++) {
* Returns the display name for the given {@code GenericName}.
*/
private String toString(final GenericName name) {
- if (name == null) { // Should not be null, but let be safe.
+ if (name == null) { //
Should not be null, but let be safe.
return "";
}
final InternationalString i18n = name.toInternationalString();
- if (i18n != null) { // Should not be null, but let be safe.
+ if (i18n != null) { //
Should not be null, but let be safe.
final String s = i18n.toString(displayLocale);
if (s != null) {
return s;
Copied:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
(from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java)
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java?p2=sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java&p1=sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java&r1=1740152&r2=1740177&rev=1740177&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureOperations.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -28,8 +28,6 @@ import org.apache.sis.util.collection.We
import org.apache.sis.util.resources.Errors;
// Branch-dependent imports
-import org.opengis.feature.Operation;
-import org.opengis.feature.PropertyType;
/**
@@ -114,7 +112,7 @@ public final class FeatureOperations ext
/**
* The pool of operations or operation dependencies created so far, for
sharing exiting instances.
*/
- static final WeakHashSet<PropertyType> POOL = new
WeakHashSet<PropertyType>(PropertyType.class);
+ static final WeakHashSet<AbstractIdentifiedType> POOL = new
WeakHashSet<AbstractIdentifiedType>(AbstractIdentifiedType.class);
/**
* Do not allow instantiation of this class.
@@ -151,11 +149,15 @@ public final class FeatureOperations ext
* identified by the {@code referent} argument, the returned property is
writable if the referenced
* property is also writable.
*
+ * <div class="warning"><b>Warning:</b>
+ * The type of {@code referent} parameter will be changed to {@code
PropertyType}
+ * if and when such interface will be defined in GeoAPI.</div>
+ *
* @param identification the name and other information to be given to
the operation.
* @param referent the referenced attribute or feature association.
* @return an operation which is an alias for the {@code referent}
property.
*/
- public static Operation link(final Map<String,?> identification, final
PropertyType referent) {
+ public static AbstractOperation link(final Map<String,?> identification,
final AbstractIdentifiedType referent) {
ArgumentChecks.ensureNonNull("referent", referent);
return POOL.unique(new LinkOperation(identification, referent));
}
@@ -186,6 +188,10 @@ public final class FeatureOperations ext
* operation, the given string value will be split around the {@code
delimiter} and each substring will be
* forwarded to the corresponding single property.
*
+ * <div class="warning"><b>Warning:</b>
+ * The type of {@code singleAttributes} elements will be changed to {@code
PropertyType}
+ * if and when such interface will be defined in GeoAPI.</div>
+ *
* @param identification the name and other information to be given to
the operation.
* @param delimiter the characters to use as delimiter between
each single property value.
* @param prefix characters to use at the beginning of the
concatenated string, or {@code null} if none.
@@ -200,8 +206,8 @@ public final class FeatureOperations ext
*
* @see <a href="https://en.wikipedia.org/wiki/Compound_key">Compound key
on Wikipedia</a>
*/
- public static Operation compound(final Map<String,?> identification, final
String delimiter,
- final String prefix, final String suffix, final PropertyType...
singleAttributes)
+ public static AbstractOperation compound(final Map<String,?>
identification, final String delimiter,
+ final String prefix, final String suffix, final
AbstractIdentifiedType... singleAttributes)
throws UnconvertibleObjectException
{
ArgumentChecks.ensureNonEmpty("delimiter", delimiter);
@@ -250,6 +256,10 @@ public final class FeatureOperations ext
* This operation is read-only. Calls to {@code
Attribute.setValue(Envelope)} will result in an
* {@link IllegalStateException} to be thrown.
*
+ * <div class="warning"><b>Warning:</b>
+ * The type of {@code geometryAttributes} elements will be changed to
{@code PropertyType}
+ * if and when such interface will be defined in GeoAPI.</div>
+ *
* @param identification the name and other information to be given
to the operation.
* @param crs the Coordinate Reference System in which to
express the envelope, or {@code null}.
* @param geometryAttributes the operation or attribute type from which
to get geometry values.
@@ -257,8 +267,8 @@ public final class FeatureOperations ext
* @return an operation which will compute the envelope encompassing all
geometries in the given attributes.
* @throws FactoryException if a coordinate operation to the target CRS
can not be created.
*/
- public static Operation envelope(final Map<String,?> identification, final
CoordinateReferenceSystem crs,
- final PropertyType... geometryAttributes) throws FactoryException
+ public static AbstractOperation envelope(final Map<String,?>
identification, final CoordinateReferenceSystem crs,
+ final AbstractIdentifiedType... geometryAttributes) throws
FactoryException
{
ArgumentChecks.ensureNonNull("geometryAttributes", geometryAttributes);
return POOL.unique(new EnvelopeOperation(identification, crs,
geometryAttributes));
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureType.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureType.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureType.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/FeatureType.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -16,6 +16,7 @@
*/
package org.apache.sis.feature;
+import java.util.Collection;
import org.opengis.util.GenericName;
@@ -33,4 +34,8 @@ import org.opengis.util.GenericName;
*/
interface FeatureType {
GenericName getName();
+
+ Collection<AbstractIdentifiedType> getProperties(boolean
includeSuperTypes);
+
+ boolean isAssignableFrom(DefaultFeatureType type);
}
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Features.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Features.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Features.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Features.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -16,6 +16,11 @@
*/
package org.apache.sis.feature;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.ConformanceResult;
+import org.opengis.metadata.quality.DataQuality;
+import org.opengis.metadata.quality.Element;
+import org.opengis.metadata.quality.Result;
import org.apache.sis.util.Static;
import org.apache.sis.util.resources.Errors;
@@ -24,8 +29,9 @@ import org.apache.sis.util.resources.Err
* Static methods working on features or attributes.
*
* @author Martin Desruisseaux (Geomatys)
+ * @author Johann Sorel (Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.7
* @module
*/
public final class Features extends Static {
@@ -92,4 +98,45 @@ public final class Features extends Stat
}
return (AbstractAttribute<V>) attribute;
}
+
+ /**
+ * Ensures that all characteristics and property values in the given
feature are valid.
+ * An attribute is valid if it contains a number of values between the
+ * {@linkplain DefaultAttributeType#getMinimumOccurs() minimum} and
+ * {@linkplain DefaultAttributeType#getMaximumOccurs() maximum number of
occurrences} (inclusive),
+ * all values are instances of the expected {@linkplain
DefaultAttributeType#getValueClass() value class},
+ * and the attribute is compliant with any other restriction that the
implementation may add.
+ *
+ * <p>This method gets a quality report as documented in the {@link
AbstractFeature#quality()} method
+ * and verifies that all {@linkplain
org.apache.sis.metadata.iso.quality.DefaultConformanceResult#pass()
+ * conformance tests pass}. If at least one {@code ConformanceResult.pass}
attribute is false, then an
+ * {@code InvalidPropertyValueException} is thrown. Otherwise this method
returns doing nothing.
+ *
+ * @param feature the feature to validate, or {@code null}.
+ * @throws IllegalArgumentException if the given feature is non-null and
does not pass validation.
+ *
+ * @since 0.7
+ */
+ public static void validate(final AbstractFeature feature) throws
IllegalArgumentException {
+ if (feature != null) {
+ final DataQuality quality = feature.quality();
+ /*
+ * Loop on quality elements and check conformance results.
+ * NOTE: other types of result are ignored for now, since those
other
+ * types may require threshold and other informations to be
evaluated.
+ */
+ for (Element element : quality.getReports()) {
+ for (Result result : element.getResults()) {
+ if (result instanceof ConformanceResult) {
+ if (Boolean.FALSE.equals(((ConformanceResult)
result).pass())) {
+ final InternationalString message =
((ConformanceResult) result).getExplanation();
+ if (message != null) {
+ throw new InvalidFeatureException(message);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java
[UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Field.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -57,6 +57,7 @@ abstract class Field<V> extends Property
*
* @see AbstractFeature#getPropertyValue(String)
*/
+ @Override
public abstract V getValue() throws IllegalStateException;
/**
Copied:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java
(from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java)
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java?p2=sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java&p1=sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java&r1=1740152&r2=1740177&rev=1740177&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/InvalidFeatureException.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -20,10 +20,6 @@ import java.util.Locale;
import org.opengis.util.InternationalString;
import org.apache.sis.internal.util.LocalizedException;
-// Branch-dependent imports
-import org.opengis.feature.Feature;
-import org.opengis.feature.InvalidPropertyValueException;
-
/**
* Thrown when a feature fails at least one conformance test.
@@ -39,7 +35,7 @@ import org.opengis.feature.InvalidProper
*
* @see Features#validate(Feature)
*/
-final class InvalidFeatureException extends InvalidPropertyValueException
implements LocalizedException {
+final class InvalidFeatureException extends IllegalArgumentException
implements LocalizedException {
/**
* For cross-version compatibility.
*/
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/LinkOperation.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -76,18 +76,20 @@ final class LinkOperation extends Abstra
/**
* The name of the referenced attribute or feature association.
*/
- final String propertyName;
+ final String referentName;
/**
* Creates a new link to the given attribute or association.
*
- * @param identification The name of the link, together with optional
information.
- * @param propertyType The referenced attribute or feature association.
+ * @param identification the name of the link, together with optional
information.
+ * @param referent the referenced attribute or feature association.
+ *
+ * @see FeatureOperations#link(Map, PropertyType)
*/
- LinkOperation(final Map<String, ?> identification, final
AbstractIdentifiedType propertyType) {
+ LinkOperation(final Map<String,?> identification, final
AbstractIdentifiedType referent) {
super(identification);
- result = propertyType;
- propertyName = propertyType.getName().toString();
+ result = referent;
+ referentName = referent.getName().toString();
}
/**
@@ -111,19 +113,36 @@ final class LinkOperation extends Abstra
*/
@Override
public Set<String> getDependencies() {
- return Collections.singleton(propertyName);
+ return Collections.singleton(referentName);
}
/**
* Returns the property from the referenced attribute of feature
association.
*
- * @param feature The feature from which to get the property.
- * @param parameters Ignored.
- * @return The property from the given feature.
+ * @param feature the feature from which to get the property.
+ * @param parameters ignored (can be {@code null}).
+ * @return the linked property from the given feature.
*/
@Override
public Object apply(final AbstractFeature feature, final
ParameterValueGroup parameters) {
ArgumentChecks.ensureNonNull("feature", feature);
- return feature.getProperty(propertyName);
+ return feature.getProperty(referentName);
+ }
+
+ /**
+ * Computes a hash-code value for this operation.
+ */
+ @Override
+ public int hashCode() {
+ return super.hashCode() + referentName.hashCode();
+ }
+
+ /**
+ * Compares this operation with the given object for equality.
+ */
+ @Override
+ public boolean equals(final Object obj) {
+ // 'this.result' is compared (indirectly) by the super class.
+ return super.equals(obj) && referentName.equals(((LinkOperation)
obj).referentName);
}
}
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/MultiValuedAttribute.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -18,6 +18,7 @@ package org.apache.sis.feature;
import java.util.Collection;
import org.apache.sis.internal.util.CheckedArrayList;
+import org.apache.sis.util.collection.CheckedContainer;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.resources.Errors;
@@ -87,7 +88,7 @@ final class MultiValuedAttribute<V> exte
if (values == null) {
this.values = new CheckedArrayList<V>(valueClass);
} else {
- final Class<?> actual = ((CheckedArrayList<?>)
values).getElementType();
+ final Class<?> actual = ((CheckedContainer<?>)
values).getElementType();
if (actual == valueClass) {
this.values = (CheckedArrayList<V>) values;
} else {
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/NamedFeatureType.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -16,6 +16,8 @@
*/
package org.apache.sis.feature;
+import java.util.Collection;
+import java.util.Collections;
import java.io.Serializable;
import org.opengis.util.GenericName;
@@ -57,6 +59,22 @@ final class NamedFeatureType implements
}
/**
+ * Returns an empty set since this feature has no declared property yet.
+ */
+ @Override
+ public Collection<AbstractIdentifiedType> getProperties(final boolean
includeSuperTypes) {
+ return Collections.emptySet();
+ }
+
+ /**
+ * This feature type is considered to all other features except itself.
+ */
+ @Override
+ public boolean isAssignableFrom(final DefaultFeatureType type) {
+ return false;
+ }
+
+ /**
* Returns a string representation of this feature type.
*/
@Override
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -33,4 +33,6 @@ import org.opengis.util.GenericName;
*/
abstract class Property {
public abstract GenericName getName();
+
+ public abstract Object getValue();
}
Copied:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java
(from r1740152,
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java)
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java?p2=sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java&p1=sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java&r1=1740152&r2=1740177&rev=1740177&view=diff
==============================================================================
---
sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/StringJoinOperation.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -33,13 +33,6 @@ import org.apache.sis.util.Classes;
// Branch-dependent imports
import org.apache.sis.internal.jdk7.Objects;
-import org.opengis.feature.AttributeType;
-import org.opengis.feature.Feature;
-import org.opengis.feature.IdentifiedType;
-import org.opengis.feature.InvalidPropertyValueException;
-import org.opengis.feature.Operation;
-import org.opengis.feature.Property;
-import org.opengis.feature.PropertyType;
/**
@@ -99,7 +92,7 @@ final class StringJoinOperation extends
/**
* The type of the result returned by the string concatenation operation.
*/
- private final AttributeType<String> resultType;
+ private final DefaultAttributeType<String> resultType;
/**
* The characters to use at the beginning of the concatenated string, or
an empty string if none.
@@ -125,7 +118,7 @@ final class StringJoinOperation extends
*/
@SuppressWarnings({"rawtypes", "unchecked"})
// Generic array creation.
StringJoinOperation(final Map<String,?> identification, final String
delimiter,
- final String prefix, final String suffix, final PropertyType[]
singleAttributes)
+ final String prefix, final String suffix, final
AbstractIdentifiedType[] singleAttributes)
throws UnconvertibleObjectException
{
super(identification);
@@ -138,18 +131,18 @@ final class StringJoinOperation extends
* - properties are either attributes, or operations producing
attributes.
* - attributes contain at most one value (no collections).
*/
- IdentifiedType attributeType = singleAttributes[i];
+ AbstractIdentifiedType attributeType = singleAttributes[i];
ArgumentChecks.ensureNonNullElement("singleAttributes", i,
attributeType);
final GenericName name = attributeType.getName();
- if (attributeType instanceof Operation) {
- attributeType = ((Operation) attributeType).getResult();
+ if (attributeType instanceof AbstractOperation) {
+ attributeType = ((AbstractOperation)
attributeType).getResult();
}
- if (!(attributeType instanceof AttributeType)) {
+ if (!(attributeType instanceof DefaultAttributeType)) {
throw new
IllegalArgumentException(Errors.getResources(identification)
.getString(Errors.Keys.IllegalPropertyType_2, name,
- Classes.getLeafInterfaces(attributeType.getClass(),
PropertyType.class)[0]));
+ Classes.getLeafInterfaces(attributeType.getClass(),
AbstractIdentifiedType.class)[0]));
}
- if (((AttributeType<?>) attributeType).getMaximumOccurs() > 1) {
+ if (((DefaultAttributeType<?>) attributeType).getMaximumOccurs() >
1) {
throw new
IllegalArgumentException(Errors.getResources(identification)
.getString(Errors.Keys.NotASingleton_1, name));
}
@@ -158,7 +151,7 @@ final class StringJoinOperation extends
* We need only their names and how to convert from String to
their values.
*/
attributeNames[i] = name.toString();
- converters[i] = ObjectConverters.find(String.class,
((AttributeType<?>) attributeType).getValueClass());
+ converters[i] = ObjectConverters.find(String.class,
((DefaultAttributeType<?>) attributeType).getValueClass());
}
resultType = FeatureOperations.POOL.unique(new
DefaultAttributeType<String>(
resultIdentification(identification), String.class, 1, 1,
null));
@@ -185,7 +178,7 @@ final class StringJoinOperation extends
* @return an {@code AttributeType<String>}.
*/
@Override
- public IdentifiedType getResult() {
+ public AbstractIdentifiedType getResult() {
return resultType;
}
@@ -221,7 +214,7 @@ final class StringJoinOperation extends
* @return the concatenation of feature property values.
*/
@Override
- public Property apply(Feature feature, ParameterValueGroup parameters) {
+ public Property apply(AbstractFeature feature, ParameterValueGroup
parameters) {
ArgumentChecks.ensureNonNull("feature", feature);
return new Result(feature);
}
@@ -242,12 +235,12 @@ final class StringJoinOperation extends
/**
* The feature specified to the {@link
StringJoinOperation#apply(Feature, ParameterValueGroup)} method.
*/
- private final Feature feature;
+ private final AbstractFeature feature;
/**
* Creates a new attribute for the given feature.
*/
- Result(final Feature feature) {
+ Result(final AbstractFeature feature) {
super(resultType);
this.feature = feature;
}
@@ -310,11 +303,11 @@ final class StringJoinOperation extends
* @throws InvalidPropertyValueException if one of the attribute
values can not be parsed to the expected type.
*/
@Override
- public void setValue(final String value) throws
InvalidPropertyValueException {
+ public void setValue(final String value) throws
IllegalArgumentException {
final int endAt = value.length() - suffix.length();
final boolean prefixMatches = value.startsWith(prefix);
if (!prefixMatches || !value.endsWith(suffix)) {
- throw new
InvalidPropertyValueException(Errors.format(Errors.Keys.UnexpectedCharactersAtBound_4,
+ throw new
IllegalArgumentException(Errors.format(Errors.Keys.UnexpectedCharactersAtBound_4,
getName(),
prefixMatches ? 1 : 0, // For
"{1,choice,0#begin|1#end}" in message format.
prefixMatches ? suffix : prefix,
@@ -376,7 +369,7 @@ final class StringJoinOperation extends
if (!element.isEmpty() && count < values.length) try {
values[count] = converters[count].apply(element);
} catch (UnconvertibleObjectException e) {
- throw new InvalidPropertyValueException(Errors.format(
+ throw new IllegalArgumentException(Errors.format(
Errors.Keys.CanNotAssign_2, attributeNames[count],
element), e);
}
count++;
@@ -388,7 +381,7 @@ final class StringJoinOperation extends
* in order to have a "all or nothing" behavior.
*/
if (values.length != count) {
- throw new InvalidPropertyValueException(
+ throw new IllegalArgumentException(
Errors.format(Errors.Keys.UnexpectedNumberOfComponents_3, value, values.length,
count));
}
for (int i=0; i < values.length; i++) {
Modified:
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java?rev=1740177&r1=1740176&r2=1740177&view=diff
==============================================================================
---
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
[UTF-8] (original)
+++
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/Validator.java
[UTF-8] Wed Apr 20 17:40:11 2016
@@ -22,6 +22,7 @@ import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.maintenance.ScopeCode;
+import org.opengis.metadata.quality.DataQuality;
import org.opengis.metadata.quality.EvaluationMethodType;
import org.apache.sis.metadata.iso.quality.AbstractElement;
import org.apache.sis.metadata.iso.quality.DefaultDataQuality;
@@ -37,7 +38,7 @@ import org.apache.sis.util.resources.Err
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.7
* @module
*/
final class Validator {
@@ -103,6 +104,35 @@ final class Validator {
}
/**
+ * Implementation of {@link AbstractFeature#quality()}, also shared by
{@link Features} static method.
+ *
+ * @param type the type of the {@code feature} argument, provided
explicitely for protecting from user overriding.
+ * @param feature the feature to validate.
+ */
+ void validate(final FeatureType type, final AbstractFeature feature) {
+ for (final AbstractIdentifiedType pt : type.getProperties(true)) {
+ final Object property =
feature.getProperty(pt.getName().toString());
+ final DataQuality pq;
+ if (property instanceof AbstractAttribute<?>) {
+ pq = ((AbstractAttribute<?>) property).quality();
+ } else if (property instanceof AbstractAssociation) {
+ pq = ((AbstractAssociation) property).quality();
+ } else if (property instanceof AbstractAttribute<?>) {
+ validateAny(((AbstractAttribute<?>) property).getType(),
((AbstractAttribute<?>) property).getValues());
+ continue;
+ } else if (property instanceof AbstractAssociation) {
+ validateAny(((AbstractAssociation) property).getRole(),
((AbstractAssociation) property).getValues());
+ continue;
+ } else {
+ continue;
+ }
+ if (pq != null) { //
Should not be null, but let be safe.
+ quality.getReports().addAll(pq.getReports());
+ }
+ }
+ }
+
+ /**
* Verifies if the given value is valid for the given attribute type.
* This method delegates to one of the {@code validate(…)} methods
depending of the value type.
*/
@@ -128,10 +158,13 @@ final class Validator {
* method signature. However in practice the call to
Attribute.setValue(…) is sometime done after type erasure,
* so we are better to check.
*/
- if (!type.getValueClass().isInstance(value)) {
+ final Class<?> valueClass = type.getValueClass();
+ if (!valueClass.isInstance(value)) {
report = addViolationReport(report, type,
Errors.formatInternational(
- Errors.Keys.IllegalPropertyClass_2, type.getName(),
value.getClass()));
- break; // Report only the first violation for now.
+ Errors.Keys.IllegalPropertyValueClass_3,
type.getName(), valueClass, value.getClass()));
+
+ // Report only the first violation for now.
+ break;
}
}
verifyCardinality(report, type, type.getMinimumOccurs(),
type.getMaximumOccurs(), values.size());
@@ -144,10 +177,13 @@ final class Validator {
AbstractElement report = null;
for (final Object value : values) {
final DefaultFeatureType type = ((AbstractFeature)
value).getType();
- if (!role.getValueType().isAssignableFrom(type)) {
+ final FeatureType valueType = role.getValueType();
+ if (!valueType.isAssignableFrom(type)) {
report = addViolationReport(report, role,
Errors.formatInternational(
- Errors.Keys.IllegalPropertyClass_2, role.getName(),
type.getName()));
- break; // Report only the first violation for now.
+ Errors.Keys.IllegalPropertyValueClass_3,
role.getName(), valueType.getName(), type.getName()));
+
+ // Report only the first violation for now.
+ break;
}
}
verifyCardinality(report, role, role.getMinimumOccurs(),
role.getMaximumOccurs(), values.size());