You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/02/19 22:32:00 UTC
svn commit: r1569926 [1/6] - in /sis/branches/JDK6: ./
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/
core/sis-metadata/src/main/java/org/apache/sis/io/
core/sis-metadata/src/main/java/org/apache/sis/io/wkt/
core/sis-metadata/src/mai...
Author: desruisseaux
Date: Wed Feb 19 21:31:56 2014
New Revision: 1569926
URL: http://svn.apache.org/r1569926
Log:
Merge from the JDK7 branch. Main topic is: migration from WKT 1 to WKT 2 formatting.
Added:
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingUtilities.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingUtilities.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/
- copied from r1569916, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/ReferencingUtilitiesTest.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/ReferencingUtilitiesTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/
- copied from r1569916, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/MetadataAssert.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/mock/
- copied from r1569916, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/mock/
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/package-info.txt
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/package-info.txt
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
- copied, changed from r1569916, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/
- copied from r1569916, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/
- copied from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultVerticalCRSTest.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultVerticalCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/mock/
- copied from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/mock/
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/package-info.txt
- copied unchanged from r1569916, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/package-info.txt
Removed:
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/io/
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/io/
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/Assert.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/GeodeticDatumMock.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java
Modified:
sis/branches/JDK6/ (props changed)
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/Properties.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/package-info.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/Normalizer.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/package-info.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/geometry/ImmutableEnvelopeTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/AxisDirectionsTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/AbstractCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeodeticCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/SubTypesTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/NormalizerTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultVerticalDatumTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/AffineTransforms2DTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/Column.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/NonMarshalledAuthority.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/Measure.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Utilities.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/ClassFormat.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/CompoundFormat.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/DefaultFormat.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/setup/OptionKey.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Static.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractInternationalString.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/GlobalNameSpace.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/NilInternationalString.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/converter/ConverterRegistryTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleReferenceIdentifierTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/test/AssertTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/NumericsTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/AppenderTestCase.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsFormatTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/measure/SexagesimalConverterTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestStep.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/logging/MonolineFormatterTest.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java
sis/branches/JDK6/pom.xml
sis/branches/JDK6/src/main/docbook/book.entities
sis/branches/JDK6/src/main/javadoc/stylesheet.css
sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStores.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeResult.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
Merged /sis/branches/JDK7:r1562999-1569916
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -96,6 +96,32 @@ public final class MetadataUtilities ext
}
/**
+ * Ensures that the given argument value is {@code false}. This method is invoked by private setter methods,
+ * which are themselves invoked by JAXB at unmarshalling time. Invoking this method from those setter methods
+ * serves two purposes:
+ *
+ * <ul>
+ * <li>Make sure that a singleton property is not defined twice in the XML document.</li>
+ * <li>Protect ourselves against changes in immutable objects outside unmarshalling. It should
+ * not be necessary since the setter methods shall not be public, but we are paranoiac.</li>
+ * <li>Be a central point where we can trace all setter methods, in case we want to improve
+ * warning or error messages in future SIS versions.</li>
+ * </ul>
+ *
+ * @param name The property name, used only in case of error message to format.
+ * @param isDefined Whether the property in the caller object is current defined.
+ * @return {@code true} if the caller can set the property.
+ * @throws IllegalStateException If {@code isDefined} is {@code true}.
+ */
+ public static boolean canSetProperty(final String name, final boolean isDefined) throws IllegalStateException {
+ if (isDefined) {
+ // Future SIS version could log a warning instead if a unmarshalling is in progress.
+ throw new IllegalStateException(Errors.format(Errors.Keys.ElementAlreadyPresent_1, name));
+ }
+ return true;
+ }
+
+ /**
* Convenience method for logging a warning to the {@code ISOMetadata} logger.
* The message will be produced using the {@link Messages} resources bundle.
*
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -17,6 +17,9 @@
package org.apache.sis.internal.metadata;
import org.opengis.geometry.Envelope;
+import org.opengis.referencing.IdentifiedObject;
+import org.opengis.referencing.operation.Matrix;
+import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
import org.apache.sis.metadata.iso.extent.DefaultExtent;
import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
@@ -34,7 +37,7 @@ import org.apache.sis.util.resources.Err
* implementation using Java reflection.
*
* @author Martin Desruisseaux (Geomatys)
- * @since 0.3 (derived from geotk-3.18)
+ * @since 0.4 (derived from geotk-3.18)
* @version 0.3
* @module
*/
@@ -52,7 +55,7 @@ public abstract class ReferencingService
/**
* The services, fetched when first needed.
*/
- private static ReferencingServices instance;
+ private static volatile ReferencingServices instance;
/**
* For subclass only. This constructor registers this instance as a {@link SystemListener}
@@ -73,7 +76,6 @@ public abstract class ReferencingService
synchronized (ReferencingServices.class) {
instance = null;
}
- SystemListener.remove(this);
}
/**
@@ -83,20 +85,50 @@ public abstract class ReferencingService
* @throws UnsupportedOperationException If the {@code "sis-referencing"} module has not
* been found on the classpath.
*/
- public static synchronized ReferencingServices getInstance() throws UnsupportedOperationException {
- if (instance == null) try {
- instance = (ReferencingServices) Class.forName("org.apache.sis.internal.referencing.ServicesForMetadata").newInstance();
- } catch (ClassNotFoundException exception) {
- throw new UnsupportedOperationException(Errors.format(
- Errors.Keys.MissingRequiredModule_1, "sis-referencing"), exception);
- } catch (Exception exception) { // (ReflectiveOperationException) on JDK7 branch.
- // Should never happen if we didn't broke our helper class.
- throw new AssertionError(exception);
+ public static ReferencingServices getInstance() throws UnsupportedOperationException {
+ ReferencingServices c = instance;
+ if (c == null) {
+ synchronized (ReferencingServices.class) {
+ c = instance;
+ if (c == null) try {
+ instance = c = (ReferencingServices) Class.forName("org.apache.sis.internal.referencing.ServicesForMetadata").newInstance();
+ } catch (ClassNotFoundException exception) {
+ throw new UnsupportedOperationException(Errors.format(
+ Errors.Keys.MissingRequiredModule_1, "sis-referencing"), exception);
+ } catch (Exception exception) { // (ReflectiveOperationException) on JDK7 branch.
+ // Should never happen if we didn't broke our helper class.
+ throw new AssertionError(exception);
+ }
+ }
}
- return instance;
+ return c;
}
/**
+ * Returns the matrix for the given transform, or {@code null} if none.
+ *
+ * @param tr The transform for which to get the matrix.
+ * @return The matrix, or {@code null} if none.
+ *
+ * @see org.apache.sis.referencing.operation.transform.LinearTransform#getMatrix()
+ *
+ * @since 0.4
+ */
+ public abstract Matrix getMatrix(MathTransform tr);
+
+ /**
+ * Converts the given object in a {@link org.apache.sis.io.wkt.FormattableObject} instance.
+ *
+ * @param object The object to wrap.
+ * @return The given object converted to a {@code FormattableObject} instance.
+ *
+ * @see org.apache.sis.referencing.AbstractIdentifiedObject#castOrCopy(IdentifiedObject)
+ *
+ * @since 0.4
+ */
+ public abstract IdentifiedObject toFormattableObject(IdentifiedObject object);
+
+ /**
* Sets a geographic bounding box from the specified envelope. If the envelope contains
* a CRS, then the bounding box will be projected to a geographic CRS. Otherwise, the envelope
* is assumed already in appropriate CRS.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -89,7 +89,7 @@ public class Colors implements Cloneable
* Creates a new, initially empty, set of colors.
*/
public Colors() {
- map = new EnumMap<>(ElementKind.class);
+ map = new EnumMap<ElementKind,X364>(ElementKind.class);
}
/**
@@ -98,7 +98,7 @@ public class Colors implements Cloneable
* @param colors The set of colors to copy.
*/
public Colors(final Colors colors) {
- map = new EnumMap<>(colors.map);
+ map = new EnumMap<ElementKind,X364>(colors.map);
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -78,7 +78,7 @@ public abstract class FormattableObject
* debugging purpose, a single formatter for any thread is presumed sufficient.}
*
*/
- private static final AtomicReference<Formatter> FORMATTER = new AtomicReference<>();
+ private static final AtomicReference<Formatter> FORMATTER = new AtomicReference<Formatter>();
/**
* Default constructor.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -162,7 +162,7 @@ public class Formatter implements Locali
*
* @see #getEnclosingElement(int)
*/
- private final List<FormattableObject> enclosingElements = new ArrayList<>();
+ private final List<FormattableObject> enclosingElements = new ArrayList<FormattableObject>();
/**
* The contextual units for writing lengths, angles or other type of measurements.
@@ -173,7 +173,7 @@ public class Formatter implements Locali
* @see #addContextualUnit(Unit)
* @see #toContextualUnit(Unit)
*/
- private final Map<Unit<?>, Unit<?>> units = new HashMap<>(4);
+ private final Map<Unit<?>, Unit<?>> units = new HashMap<Unit<?>, Unit<?>>(4);
/**
* A bits mask of elements which defined a contextual units.
@@ -308,7 +308,7 @@ public class Formatter implements Locali
ArgumentChecks.ensureNonNull("convention", convention);
ArgumentChecks.ensureNonNull("symbols", symbols);
ArgumentChecks.ensureBetween("indentation", WKTFormat.SINGLE_LINE, Byte.MAX_VALUE, indentation);
- this.locale = Locale.getDefault(Locale.Category.DISPLAY);
+ this.locale = Locale.getDefault();
this.convention = convention;
this.authority = convention.getNameAuthority();
this.symbols = symbols.immutable();
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Symbols.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -26,6 +26,9 @@ import org.apache.sis.util.resources.Err
import static org.apache.sis.util.ArgumentChecks.*;
+// Related to JDK7
+import org.apache.sis.internal.jdk7.JDK7;
+
/**
* The set of symbols to use for <cite>Well Known Text</cite> (WKT) parsing and formatting.
@@ -230,7 +233,7 @@ public class Symbols implements Localize
*
* @return The locale for dates and numbers.
*
- * @see WKTFormat#getLocale(Locale.Category)
+ * @see WKTFormat#getLocale()
*/
@Override
public final Locale getLocale() {
@@ -480,7 +483,7 @@ public class Symbols implements Localize
final String lineSeparator() {
final String separator = getSeparator();
return separator.substring(0, CharSequences.skipTrailingWhitespaces(separator, 0, separator.length()))
- .concat(System.lineSeparator());
+ .concat(JDK7.lineSeparator());
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -166,27 +166,6 @@ public class WKTFormat extends CompoundF
}
/**
- * Returns the locale for the given category. This method implements the following mapping:
- *
- * <ul>
- * <li>{@link java.util.Locale.Category#FORMAT}: the value of {@link Symbols#getLocale()},
- * normally fixed to {@link Locale#ROOT}, used for number formatting.</li>
- * <li>{@link java.util.Locale.Category#DISPLAY}: the {@code locale} given at construction time,
- * used for {@link org.opengis.util.InternationalString} localization.</li>
- * </ul>
- *
- * @param category The category for which a locale is desired.
- * @return The locale for the given category (never {@code null}).
- */
- @Override
- public Locale getLocale(final Locale.Category category) {
- if (category == Locale.Category.FORMAT) {
- return symbols.getLocale();
- }
- return super.getLocale(category);
- }
-
- /**
* Returns the symbols used for parsing and formatting WKT.
*
* @return The current set of symbols used for parsing and formatting WKT.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -18,7 +18,6 @@ package org.apache.sis.metadata;
import java.util.Map;
import java.util.IdentityHashMap;
-import java.io.ObjectStreamException;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.logging.Logging;
@@ -161,7 +160,7 @@ final class StandardImplementation exten
/**
* Invoked on deserialization. Returns one of the pre-existing constants if possible.
*/
- Object readResolve() throws ObjectStreamException {
+ Object readResolve() {
if (ISO_19111.citation.equals(citation)) return ISO_19111;
if (ISO_19115.citation.equals(citation)) return ISO_19115;
/*
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -21,17 +21,20 @@ import java.util.Locale;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.opengis.parameter.InvalidParameterValueException;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.util.InternationalString;
-import org.apache.sis.util.Debug;
import org.apache.sis.util.Deprecable;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.iso.Types;
import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.internal.simple.SimpleIdentifiedObject;
+import org.apache.sis.internal.metadata.ReferencingUtilities;
+import org.apache.sis.internal.util.DefinitionURI;
+import org.apache.sis.io.wkt.FormattableObject;
+import org.apache.sis.io.wkt.Formatter;
+import org.apache.sis.io.wkt.Convention;
+import org.apache.sis.io.wkt.ElementKind;
import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
import static org.apache.sis.util.CharSequences.trimWhitespaces;
@@ -73,9 +76,10 @@ import org.apache.sis.internal.jdk7.Obje
* }
*
* </li><li><p><b><cite>Well Known Text</cite> (WKT) version 2</b></p>
- * The WKT 2 format contains the {@linkplain #getCodeSpace() code space}, the {@linkplain #getCode() code} and
- * the {@linkplain #getVersion() version} if available. The WKT can optionally provides a {@code URI} element,
- * which expresses the same information in a different way (the URN syntax is described in the next item below).
+ * The WKT 2 format contains the {@linkplain #getCodeSpace() code space}, the {@linkplain #getCode() code},
+ * the {@linkplain #getVersion() version} and the {@linkplain #getAuthority() authority} citation if available.
+ * The WKT can optionally provides a {@code URI} element, which expresses the same information in a different way
+ * (the URN syntax is described in the next item below).
* Example:
*
* {@preformat wkt
@@ -125,7 +129,7 @@ import org.apache.sis.internal.jdk7.Obje
* @see DefaultIdentifier
*/
@XmlRootElement(name = "RS_Identifier")
-public class ImmutableIdentifier implements ReferenceIdentifier, Deprecable, Serializable {
+public class ImmutableIdentifier extends FormattableObject implements ReferenceIdentifier, Deprecable, Serializable {
/**
* For cross-version compatibility.
*/
@@ -205,7 +209,7 @@ public class ImmutableIdentifier impleme
} else {
remarks = null;
}
- validate();
+ validate(null);
}
/**
@@ -252,7 +256,7 @@ public class ImmutableIdentifier impleme
this.authority = authority;
this.version = version;
this.remarks = remarks;
- validate();
+ validate(null);
}
/**
@@ -292,13 +296,23 @@ public class ImmutableIdentifier impleme
* <td>{@link String} or {@link InternationalString}</td>
* <td>{@link #getRemarks()}</td>
* </tr>
+ * <tr>
+ * <td>{@value org.apache.sis.referencing.AbstractIdentifiedObject#LOCALE_KEY}</td>
+ * <td>{@link Locale}</td>
+ * <td>(none)</td>
+ * </tr>
* </table>
*
+ * {@section Localization}
* {@code "remarks"} is a localizable attributes which may have a language and country
* code suffix. For example the {@code "remarks_fr"} property stands for remarks in
* {@linkplain Locale#FRENCH French} and the {@code "remarks_fr_CA"} property stands
* for remarks in {@linkplain Locale#CANADA_FRENCH French Canadian}.
*
+ * <p>The {@code "locale"} property applies only to exception messages, if any.
+ * After successful construction, {@code ImmutableIdentifier} instances do not keep the locale
+ * since localizations are deferred to the {@link InternationalString#toString(Locale)} method.</p>
+ *
* @param properties The properties to be given to this identifier.
* @throws InvalidParameterValueException if a property has an invalid value.
* @throws IllegalArgumentException if a property is invalid for some other reason.
@@ -317,7 +331,7 @@ public class ImmutableIdentifier impleme
} else if (value == null || value instanceof Citation) {
authority = (Citation) value;
} else {
- throw illegalPropertyType(AUTHORITY_KEY, value);
+ throw illegalPropertyType(properties, AUTHORITY_KEY, value);
}
/*
* Complete the code space if it was not explicitly set. We take a short identifier (preferred) or title
@@ -331,27 +345,30 @@ public class ImmutableIdentifier impleme
} else if (value instanceof String) {
codeSpace = trimWhitespaces((String) value);
} else {
- throw illegalPropertyType(CODESPACE_KEY, value);
+ throw illegalPropertyType(properties, CODESPACE_KEY, value);
}
- validate();
+ validate(properties);
}
/**
* Ensures that the properties of this {@code ImmutableIdentifier} are valid.
*/
- private void validate() {
+ private void validate(final Map<String,?> properties) {
if (code == null || code.isEmpty()) {
- throw new IllegalArgumentException(Errors.format((code == null)
- ? Errors.Keys.MissingValueForProperty_1
- : Errors.Keys.EmptyProperty_1, CODE_KEY));
+ throw new IllegalArgumentException(Errors.getResources(properties)
+ .getString((code == null) ? Errors.Keys.MissingValueForProperty_1
+ : Errors.Keys.EmptyProperty_1, CODE_KEY));
}
}
/**
* Returns the exception to be thrown when a property if of illegal type.
*/
- private static IllegalArgumentException illegalPropertyType(final String key, final Object value) {
- return new IllegalArgumentException(Errors.format(Errors.Keys.IllegalPropertyClass_2, key, value.getClass()));
+ private static IllegalArgumentException illegalPropertyType(
+ final Map<String,?> properties, final String key, final Object value)
+ {
+ return new IllegalArgumentException(Errors.getResources(properties)
+ .getString(Errors.Keys.IllegalPropertyClass_2, key, value.getClass()));
}
/**
@@ -524,19 +541,125 @@ public class ImmutableIdentifier impleme
}
/**
- * Returns a string representation of this identifier.
- * The string representation is mostly for debugging purpose and may change in any future SIS version.
- * The default implementation returns a pseudo-WKT format.
- *
- * {@note The <code>NamedIdentifier</code> subclass overrides this method with a different behavior,
- * in order to be compliant with the contract of the <code>GenericName</code> interface.}
+ * Formats this identifier as a <cite>Well Known Text</cite> {@code Id[…]} element.
+ * See class javadoc for more information on the WKT format.
*
- * @see org.apache.sis.referencing.IdentifiedObjects#toString(Identifier)
- * @see org.apache.sis.referencing.NamedIdentifier#toString()
+ * @param formatter The formatter where to format the inner content of this WKT element.
+ * @return {@code "Id"} (WKT 2) or {@code "Authority"} (WKT 1).
*/
- @Debug
@Override
- public String toString() {
- return SimpleIdentifiedObject.toString("IDENTIFIER", authority, codeSpace, code, isDeprecated());
+ protected String formatTo(final Formatter formatter) {
+ String keyword = null;
+ if (code != null) {
+ String citation = Citations.getIdentifier(authority);
+ String cs = codeSpace;
+ if (cs == null) {
+ cs = citation;
+ citation = null;
+ }
+ if (cs != null) {
+ final Convention convention = formatter.getConvention();
+ if (convention.majorVersion() == 1) {
+ keyword = "Authority";
+ formatter.append(cs, null);
+ formatter.append(code, null);
+ } else {
+ keyword = "Id";
+ formatter.append(cs, null);
+ appendCode(formatter, code);
+ if (version != null) {
+ appendCode(formatter, version);
+ }
+ if (citation != null && !citation.equals(cs)) {
+ formatter.append(new Cite(citation));
+ }
+ /*
+ * Do not format the optional URI element for internal convention,
+ * because this property is currently computed rather than stored.
+ * Other conventions format only for the ID[…] of root element.
+ */
+ if (convention != Convention.INTERNAL && formatter.getEnclosingElement(2) == null) {
+ final FormattableObject parent = formatter.getEnclosingElement(1);
+ if (parent != null && ReferencingUtilities.usesURN(cs)) {
+ final String type = ReferencingUtilities.toURNType(parent.getClass());
+ if (type != null) {
+ formatter.append(new URI(type, cs, version, code));
+ }
+ }
+ }
+ }
+ }
+ }
+ return keyword;
+ }
+
+ /**
+ * Appends the given code or version number as an integer if possible, or as a text otherwise.
+ *
+ * {@note ISO 19162 specifies "number or text". In Apache SIS, we restrict the numbers to integers
+ * because handling version numbers like "8.2" as floating point numbers can be confusing.}
+ */
+ private static void appendCode(final Formatter formatter, final String text) {
+ if (text != null) {
+ final long n;
+ try {
+ n = Long.parseLong(text);
+ } catch (NumberFormatException e) {
+ formatter.append(text, null);
+ return;
+ }
+ formatter.append(n);
+ }
+ }
+
+ /**
+ * The {@code CITATION[…]} element inside an {@code ID[…]}.
+ */
+ private static final class Cite extends FormattableObject {
+ /** The component of the citation to format. */
+ private final String identifier;
+
+ /** Creates a new citation with the given component. */
+ Cite(final String identifier) {
+ this.identifier = identifier;
+ }
+
+ /** Formats the citation. */
+ @Override
+ protected String formatTo(final Formatter formatter) {
+ formatter.append(identifier, ElementKind.CITATION);
+ return "Citation";
+ }
+ }
+
+ /**
+ * The {@code URI[…]} element inside an {@code ID[…]}.
+ */
+ private static final class URI extends FormattableObject {
+ /** The components of the URI to format. */
+ private final String type, codeSpace, version, code;
+
+ /** Creates a new URI with the given components. */
+ URI(final String type, final String codeSpace, final String version, final String code) {
+ this.type = type;
+ this.codeSpace = codeSpace;
+ this.version = version;
+ this.code = code;
+ }
+
+ /** Formats the URI. */
+ @Override
+ protected String formatTo(final Formatter formatter) {
+ final StringBuilder buffer = new StringBuilder(DefinitionURI.PREFIX)
+ .append(DefinitionURI.SEPARATOR).append(type)
+ .append(DefinitionURI.SEPARATOR).append(codeSpace)
+ .append(DefinitionURI.SEPARATOR);
+ if (version != null) {
+ buffer.append(version);
+ }
+ buffer.append(DefinitionURI.SEPARATOR).append(code);
+ formatter.append(buffer.toString(), null);
+ return "URI";
+ }
}
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -52,7 +52,6 @@ public final class Citations extends Sta
* The <a href="http://www.opengeospatial.org">Open Geospatial Consortium</a> organization.
* "Open Geospatial Consortium" is the new name for "OpenGIS consortium".
*
- * @see org.apache.sis.io.wkt.Convention#OGC
* @category Organization
*/
public static final Citation OGC = new SimpleCitation("OGC");
@@ -79,7 +78,6 @@ public final class Citations extends Sta
* The <a href="http://www.esri.com">ESRI</a> organization.
* This company defines many Coordinate Reference Systems in addition to the {@linkplain #EPSG} ones.
*
- * @see org.apache.sis.io.wkt.Convention#ESRI
* @category Organization
*
* @since 0.4
@@ -89,7 +87,6 @@ public final class Citations extends Sta
/**
* The <a href="http://www.oracle.com">Oracle</a> organization.
*
- * @see org.apache.sis.io.wkt.Convention#ORACLE
* @category Organization
*
* @since 0.4
@@ -99,7 +96,6 @@ public final class Citations extends Sta
/**
* The <a href="http://www.unidata.ucar.edu/software/netcdf-java">NetCDF</a> specification.
*
- * @see org.apache.sis.io.wkt.Convention#NETCDF
* @category Specification
*
* @since 0.4
@@ -109,7 +105,6 @@ public final class Citations extends Sta
/**
* The <a href="http://www.remotesensing.org/geotiff/geotiff.html">GeoTIFF</a> specification.
*
- * @see org.apache.sis.io.wkt.Convention#GEOTIFF
* @category Specification
*
* @since 0.4
@@ -119,7 +114,6 @@ public final class Citations extends Sta
/**
* The <a href="http://trac.osgeo.org/proj/">Proj.4</a> project.
*
- * @see org.apache.sis.io.wkt.Convention#PROJ4
* @category Code space
*
* @since 0.4
@@ -136,7 +130,6 @@ public final class Citations extends Sta
* @see #AUTO
* @see #AUTO2
* @see #CRS
- * @see org.apache.sis.io.wkt.Convention#EPSG
* @category Code space
*
* @since 0.4
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -17,13 +17,20 @@
package org.apache.sis.metadata.iso.extent;
import java.util.Date;
+import javax.measure.unit.Unit;
import org.opengis.temporal.TemporalPrimitive;
import org.opengis.metadata.extent.Extent;
+import org.opengis.metadata.extent.VerticalExtent;
import org.opengis.metadata.extent.TemporalExtent;
import org.opengis.metadata.extent.BoundingPolygon;
import org.opengis.metadata.extent.GeographicExtent;
import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.crs.VerticalCRS;
import org.apache.sis.measure.Longitude;
+import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.Range;
import org.apache.sis.util.resources.Vocabulary;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.Static;
@@ -38,7 +45,8 @@ import static org.apache.sis.internal.me
* This class provides methods for:
*
* <ul>
- * <li>{@link #getGeographicBoundingBox(Extent)} and {@link #getDate(Extent, double)}
+ * <li>{@link #getGeographicBoundingBox(Extent)}, {@link #getVerticalRange(Extent)}
+ * and {@link #getDate(Extent, double)}
* for fetching geographic or temporal components in a convenient form.</li>
* <li>Methods for computing {@linkplain #intersection intersection} of bounding boxes
* and {@linkplain #area area} estimations.</li>
@@ -80,8 +88,7 @@ public final class Extents extends Stati
* {@linkplain DefaultGeographicBoundingBox#add added} together.
*
* @param extent The extent to convert to a geographic bounding box, or {@code null}.
- * @return A geographic bounding box extracted from the given extent, or {@code null}
- * if the given extent was {@code null}.
+ * @return A geographic bounding box extracted from the given extent, or {@code null} in none.
*/
public static GeographicBoundingBox getGeographicBoundingBox(final Extent extent) {
GeographicBoundingBox candidate = null;
@@ -125,6 +132,115 @@ public final class Extents extends Stati
}
/**
+ * Returns the union of all vertical ranges found in the given extent, or {@code null} if none.
+ * Depths have negative height values: if the {@linkplain CoordinateSystemAxis#getDirection() axis direction}
+ * is toward down, then this method reverses the sign of minimum and maximum values.
+ *
+ * {@section Multi-occurrences}
+ * If the given {@code Extent} object contains more than one vertical extent, then this method
+ * performs the following choices:
+ *
+ * <ul>
+ * <li>If no range specify a unit of measurement, return the first range and ignore all others.</li>
+ * <li>Otherwise take the first range having a unit of measurement. Then:<ul>
+ * <li>All other ranges having an incompatible unit of measurement will be ignored.</li>
+ * <li>All other ranges having a compatible unit of measurement will be converted to
+ * the unit of the first retained range, and their union will be computed.</li>
+ * </ul></li>
+ * </ul>
+ *
+ * {@example Heights or depths are often measured using some pressure units, for example hectopascals (hPa).
+ * An <code>Extent</code> could contain two vertical elements: one with the height measurements
+ * in hPa, and the other element with heights transformed to metres using an empirical formula.
+ * In such case this method will select the first vertical element on the assumption that it is
+ * the "main" one that the metadata producer intended to show. Then this method will search for
+ * other vertical elements using pressure unit. In our example there is none. But if any were
+ * found, this method would compute their union.}
+ *
+ * @param extent The extent to convert to a vertical measurement range, or {@code null}.
+ * @return A vertical measurement range created from the given extent, or {@code null} if none.
+ *
+ * @since 0.4
+ */
+ public static MeasurementRange<Double> getVerticalRange(final Extent extent) {
+ MeasurementRange<Double> range = null;
+ if (extent != null) {
+ for (final VerticalExtent element : extent.getVerticalElements()) {
+ double min = element.getMinimumValue();
+ double max = element.getMaximumValue();
+ final VerticalCRS crs = element.getVerticalCRS();
+ Unit<?> unit = null;
+ if (crs != null) {
+ final CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis(0);
+ unit = axis.getUnit();
+ if (AxisDirection.DOWN.equals(axis.getDirection())) {
+ final double tmp = min;
+ min = -max;
+ max = -tmp;
+ }
+ }
+ if (range != null) {
+ /*
+ * If the new range does not specify any unit, then we do not know how to convert
+ * the values before to perform the union operation. Conservatively do nothing.
+ */
+ if (unit == null) {
+ continue;
+ }
+ /*
+ * If previous range did not specify any unit, then unconditionally replace it by
+ * the new range since it provides more information. If both ranges specify units,
+ * then we will compute the union if we can, or ignore the new range otherwise.
+ */
+ final Unit<?> previous = range.unit();
+ if (previous != null) {
+ if (previous.isCompatible(unit)) {
+ range = (MeasurementRange<Double>) range.union(
+ MeasurementRange.create(min, true, max, true, unit));
+ }
+ continue;
+ }
+ }
+ range = MeasurementRange.create(min, true, max, true, unit);
+ }
+ }
+ return range;
+ }
+
+ /**
+ * Returns the union of all time ranges found in the given extent, or {@code null} if none.
+ *
+ * @param extent The extent to convert to a time range, or {@code null}.
+ * @return A time range created from the given extent, or {@code null} if none.
+ *
+ * @since 0.4
+ */
+ public static Range<Date> getTimeRange(final Extent extent) {
+ Date min = null;
+ Date max = null;
+ if (extent != null) {
+ for (final TemporalExtent t : extent.getTemporalElements()) {
+ final Date startTime, endTime;
+ if (t instanceof DefaultTemporalExtent) {
+ final DefaultTemporalExtent dt = (DefaultTemporalExtent) t;
+ startTime = dt.getStartTime(); // Maybe user has overridden those methods.
+ endTime = dt.getEndTime();
+ } else {
+ final TemporalPrimitive p = t.getExtent();
+ startTime = DefaultTemporalExtent.getTime(p, true);
+ endTime = DefaultTemporalExtent.getTime(p, false);
+ }
+ if (startTime != null && (min == null || startTime.before(min))) min = startTime;
+ if ( endTime != null && (max == null || endTime.after (max))) max = endTime;
+ }
+ }
+ if (min == null && max == null) {
+ return null;
+ }
+ return new Range<Date>(Date.class, min, true, max, true);
+ }
+
+ /**
* Returns an instant in the {@linkplain Extent#getTemporalElements() temporal elements} of the given extent,
* or {@code null} if none. First, this method computes the union of all temporal elements. Then this method
* computes the linear interpolation between the start and end time as in the following pseudo-code:
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -39,7 +39,7 @@ import static org.apache.sis.test.TestUt
/**
- * Tests {@link PropertyInformation}.
+ * Tests the {@link PropertyInformation} class.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -33,7 +33,7 @@ import static org.apache.sis.test.Assert
/**
- * Tests {@link SpecialCases}.
+ * Test the {@link SpecialCases} class.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -22,14 +22,16 @@ import java.util.Locale;
import javax.xml.bind.JAXBException;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.metadata.iso.citation.DefaultCitation;
+import org.apache.sis.metadata.iso.citation.HardCodedCitations;
import org.apache.sis.util.iso.SimpleInternationalString;
+import org.apache.sis.io.wkt.Convention;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
import org.opengis.test.Validators;
import org.apache.sis.test.DependsOn;
import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
import static org.opengis.referencing.ReferenceIdentifier.*;
@@ -167,4 +169,14 @@ public final strictfp class ImmutableIde
final ImmutableIdentifier identifier = new ImmutableIdentifier(new DefaultCitation("EPSG"), null, "4326");
new DefaultIdentifierTest().testMarshal("RS_Identifier", identifier);
}
+
+ /**
+ * Tests WKT formatting.
+ */
+ @Test
+ public void testWKT() {
+ final ImmutableIdentifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326", "8.2", null);
+ assertWktEquals(Convention.WKT2, "Id[“EPSG”, 4326, “8.2”, Citation[“OGP”]]", id);
+ assertWktEquals(Convention.WKT1, "AUTHORITY[“EPSG”, “4326”]", id);
+ }
}
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/ExtentsTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -16,7 +16,11 @@
*/
package org.apache.sis.metadata.iso.extent;
+import java.util.Arrays;
+import javax.measure.unit.SI;
import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.test.mock.VerticalCRSMock;
import org.apache.sis.test.DependsOn;
import org.apache.sis.test.TestCase;
import org.junit.Test;
@@ -41,6 +45,26 @@ public final strictfp class ExtentsTest
private static final double MINUTE = 1./60;
/**
+ * Tests {@link Extents#getVerticalRange(Extent)}.
+ */
+ @Test
+ public void testGetVerticalRange() {
+ final DefaultExtent extent = new DefaultExtent();
+ extent.setVerticalElements(Arrays.asList(
+ new DefaultVerticalExtent( -200, -100, VerticalCRSMock.HEIGHT),
+ new DefaultVerticalExtent( 150, 300, VerticalCRSMock.DEPTH),
+ new DefaultVerticalExtent( 0.1, 0.2, VerticalCRSMock.SIGMA_LEVEL),
+ new DefaultVerticalExtent( -600, -300, VerticalCRSMock.HEIGHT_ft), // [91.44 182.88] metres
+ new DefaultVerticalExtent(10130, 20260, VerticalCRSMock.BAROMETRIC_HEIGHT)
+ ));
+ final MeasurementRange<Double> range = Extents.getVerticalRange(extent);
+ assertNotNull("getVerticalRange", range);
+ assertEquals("unit", SI.METRE, range.unit());
+ assertEquals("minimum", -300, range.getMinDouble(), 0.001);
+ assertEquals("maximum", -91.44, range.getMaxDouble(), 0.001);
+ }
+
+ /**
* Tests {@link Extents#intersection(GeographicBoundingBox, GeographicBoundingBox)}.
*/
@Test
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -36,7 +36,7 @@ import static java.util.Collections.sing
/**
- * Test {@link DefaultBrowseGraphic}.
+ * Tests {@link DefaultBrowseGraphic}.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -31,6 +31,7 @@ import org.junit.BeforeClass;
*/
@Suite.SuiteClasses({
org.apache.sis.internal.metadata.MetadataUtilitiesTest.class,
+ org.apache.sis.internal.metadata.ReferencingUtilitiesTest.class,
// Classes using Java reflection.
org.apache.sis.metadata.PropertyInformationTest.class,
@@ -80,7 +81,12 @@ import org.junit.BeforeClass;
org.apache.sis.metadata.iso.ImmutableIdentifierTest.class,
org.apache.sis.metadata.iso.DefaultMetadataTest.class,
org.apache.sis.metadata.iso.CustomMetadataTest.class,
- org.apache.sis.metadata.iso.AllMetadataTest.class
+ org.apache.sis.metadata.iso.AllMetadataTest.class,
+
+ org.apache.sis.io.wkt.ConventionTest.class,
+ org.apache.sis.io.wkt.SymbolsTest.class,
+ org.apache.sis.io.wkt.ColorsTest.class,
+ org.apache.sis.io.wkt.FormatterTest.class
})
public final strictfp class MetadataTestSuite extends TestSuite {
/**
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -76,8 +76,8 @@ import org.apache.sis.internal.jdk7.Obje
* The default implementation of methods listed in the right column can handle such cases.
*
* <table class="compact" align="center"><tr><td>
- * <img src="doc-files/AntiMeridian.png">
- * </td><td>
+ * <img style="vertical-align: middle" src="doc-files/AntiMeridian.png">
+ * </td><td style="vertical-align: middle">
* Supported methods:
* <ul>
* <li>{@link #getMinimum(int)}</li>
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -72,8 +72,8 @@ import static org.apache.sis.math.MathFu
* The default implementation of methods listed in the right column can handle such cases.
*
* <table class="compact" align="center"><tr><td>
- * <img src="doc-files/AntiMeridian.png">
- * </td><td>
+ * <img style="vertical-align: middle" src="doc-files/AntiMeridian.png">
+ * </td><td style="vertical-align: middle">
* Supported methods:
* <ul>
* <li>{@link #getMinimum(int)}</li>
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -25,7 +25,7 @@ import org.apache.sis.internal.util.Defi
import org.apache.sis.referencing.NamedIdentifier;
import org.apache.sis.metadata.iso.citation.Citations;
-import static org.apache.sis.internal.referencing.ReferencingUtilities.toURNType;
+import static org.apache.sis.internal.metadata.ReferencingUtilities.toURNType;
/**
@@ -148,7 +148,7 @@ public final class Code {
}
}
/*
- * If no "urn:" or "http:" form has been found, try to create a "urn:" form from the first identifier.
+ * If no "urn:" or "http:" form has been found, try to create a "urn:" form the first identifier.
* For example "EPSG:4326" may be converted to "urn:ogc:def:crs:EPSG:8.2:4326". If the first identifier
* can not be converted to a "urn:" form, then it will be returned as-is.
*/
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java?rev=1569926&r1=1569925&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -83,6 +83,12 @@ public final class AxisDirections extend
}
/**
+ * Ordinal of the last element in the {@link AxisDirection} code list.
+ * This is used for differentiating the standard codes from the user-defined ones.
+ */
+ private static final int LAST_ORDINAL = DISPLAY_DOWN.ordinal();
+
+ /**
* Do not allow instantiation of this class.
*/
private AxisDirections() {
@@ -208,6 +214,19 @@ public final class AxisDirections extend
}
/**
+ * Returns {@code true} if the given direction is {@code GEOCENTRIC_X}, {@code GEOCENTRIC_Y}
+ * or {@code GEOCENTRIC_Z}.
+ *
+ * @param dir The direction to test, or {@code null}.
+ * @return {@code true} if the given direction is one of geocentric directions.
+ */
+ public static boolean isGeocentric(final AxisDirection dir) {
+ if (dir == null) return false;
+ final int ordinal = dir.ordinal();
+ return ordinal >= GEOCENTRIC_X.ordinal() && ordinal <= GEOCENTRIC_Z.ordinal();
+ }
+
+ /**
* Returns {@code true} if the given direction is a spatial axis direction (including vertical and geocentric axes).
* The current implementation conservatively returns {@code true} for every non-null directions except a hard-coded
* set of directions which are known to be non-spatial. We conservatively accept unknown axis directions because
@@ -222,13 +241,23 @@ public final class AxisDirections extend
* @param image {@code true} for accepting grid and image axis directions in addition to spatial ones.
* @return {@code true} if the given direction is presumed for spatial CS.
*/
- public static boolean isSpatialOrCustom(final AxisDirection dir, final boolean image) {
+ public static boolean isSpatialOrUserDefined(final AxisDirection dir, final boolean image) {
if (dir == null) return false;
final int ordinal = dir.ordinal();
return ordinal < FUTURE.ordinal() || ordinal > (image ? PAST : DISPLAY_DOWN).ordinal();
}
/**
+ * Returns {@code true} if the given direction is a user-defined direction (i.e. is not defined by GeoAPI).
+ *
+ * @param dir The direction to test, or {@code null}.
+ * @return {@code true} if the given direction is user-defined.
+ */
+ public static boolean isUserDefined(final AxisDirection dir) {
+ return (dir != null) && dir.ordinal() > LAST_ORDINAL;
+ }
+
+ /**
* Returns {@code true} if the given direction is {@code COLUMN_POSITIVE}, {@code COLUMN_NEGATICE},
* {@code ROW_POSITIVE} or {@code ROW_NEGATIVE}.
*
Copied: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java (from r1569916, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java?p2=sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java&p1=sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java&r1=1569916&r2=1569926&rev=1569926&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/WKTUtilities.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -83,7 +83,7 @@ public final class WKTUtilities extends
}
if (parameter instanceof ParameterValue<?>) {
if (!(parameter instanceof FormattableObject)) {
- parameter = new DefaultParameterValue<>((ParameterValue<?>) parameter);
+ parameter = new DefaultParameterValue((ParameterValue<?>) parameter);
}
formatter.append((FormattableObject) parameter);
formatter.newLine();
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -43,7 +43,7 @@ import static org.apache.sis.util.collec
import static org.apache.sis.internal.util.CollectionsExt.unmodifiableOrCopy;
// Related to JDK7
-import java.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
/**
@@ -256,7 +256,7 @@ public class DefaultParameterDescriptor<
throw new IllegalArgumentException(Errors.getResources(properties)
.getString(Errors.Keys.IllegalPropertyClass_2, VALID_VALUES_KEY, values.getClass()));
}
- final Set<T> valids = new LinkedHashSet<>(hashMapCapacity(array.length));
+ final Set<T> valids = new LinkedHashSet<T>(hashMapCapacity(array.length));
for (Object value : array) {
if (value != null) {
value = Numerics.cached(value);
@@ -351,7 +351,7 @@ public class DefaultParameterDescriptor<
*/
@Override
public ParameterValue<T> createValue() {
- return new DefaultParameterValue<>(this);
+ return new DefaultParameterValue<T>(this);
}
/**
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1569926&r1=1569916&r2=1569926&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] Wed Feb 19 21:31:56 2014
@@ -41,8 +41,7 @@ import org.apache.sis.util.resources.Err
import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
// Related to JDK7
-import java.util.Objects;
-import java.nio.file.Path;
+import org.apache.sis.internal.jdk7.Objects;
/**
@@ -416,7 +415,7 @@ public class DefaultParameterValue<T> ex
/**
* Returns a reference to a file or a part of a file containing one or more parameter values.
* The default implementation can convert the following value types:
- * {@link URI}, {@link URL}, {@link Path}, {@link File}.
+ * {@link URI}, {@link URL}, {@link File}.
*
* @return The reference to a file containing parameter values.
* @throws InvalidParameterTypeException if the value is not a reference to a file or an URI.
@@ -434,9 +433,6 @@ public class DefaultParameterValue<T> ex
if (value instanceof File) {
return ((File) value).toURI();
}
- if (value instanceof Path) {
- return ((Path) value).toUri();
- }
Exception cause = null;
try {
if (value instanceof URL) {