sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1687825 [1/4] - 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/wkt/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metada...
Date Fri, 26 Jun 2015 17:54:07 GMT
Author: desruisseaux
Date: Fri Jun 26 17:54:06 2015
New Revision: 1687825

URL: http://svn.apache.org/r1687825
Log:
Merge from the JDK7 branch.

Added:
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
      - copied unchanged from r1687818, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
      - copied, changed from r1687818, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.txt
      - copied unchanged from r1687818, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.txt
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java
      - copied unchanged from r1687818, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/
      - copied from r1687818, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java
      - copied unchanged from r1687818, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTParserTest.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
      - copied, changed from r1687818, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
      - copied unchanged from r1687818, sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java
Removed:
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/CharEncoding.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/CharEncodingTest.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/AxisDirectionsTest.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.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/internal/metadata/WKTKeywords.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.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/GeodeticObjectParser.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/iso/ImmutableIdentifier.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.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/test/suite/MetadataTestSuite.java
    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/internal/referencing/ServicesForMetadata.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/CRS.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/DefaultDerivedCRS.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/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/DefaultProjectedCRS.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/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/DefaultCompoundCS.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/DefaultTimeCS.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/datum/AbstractDatum.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/operation/AbstractCoordinateOperation.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
    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/wkt/GeodeticObjectParserTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/WKTFormatTest.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/datum/DefaultGeodeticDatumTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.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/jaxb/gco/CharSequenceAdapter.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_CharacterString.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/PT_FreeText.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Characters.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/test/java/org/apache/sis/test/TestUtilities.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/branches/JDK6/ide-project/NetBeans/nbproject/project.properties

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 26 17:54:06 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1686269
-/sis/branches/JDK8:1584960-1686266
+/sis/branches/JDK7:1394913-1687818
+/sis/branches/JDK8:1584960-1687814
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java?rev=1687825&r1=1687824&r2=1687825&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java
[UTF-8] Fri Jun 26 17:54:06 2015
@@ -47,12 +47,20 @@ public final class AxisNames {
     public static final String GEODETIC_LATITUDE = "Geodetic latitude";
 
     /**
-     * The ISO 19111 <cite>"spherical longitude"</cite> name. Abbreviation is
"θ" (theta).
+     * The ISO 19111 <cite>"spherical longitude"</cite> name. Abbreviation used
by SIS is "θ" (theta)
+     * for consistency with the EPSG "long" abbreviation, but some other conventions use
"φ" instead.
+     * Direction in the EPSG database is "East", but "counterClockwise" may also be used.
+     *
+     * @see <a href="http://en.wikipedia.org/wiki/Spherical_coordinate_system">Spherical
coordinate system on Wikipedia</a>
+     * @see <a href="http://mathworld.wolfram.com/SphericalCoordinates.html">Spherical
coordinate system on MathWorld</a>
      */
     public static final String SPHERICAL_LONGITUDE = "Spherical longitude";
 
     /**
-     * The ISO 19111 <cite>"spherical latitude"</cite> name. Abbreviation is
"φ′" (phi prime).
+     * The ISO 19111 <cite>"spherical latitude"</cite> name. Abbreviation used
by SIS is "φ′" (phi prime)
+     * for consistency with the EPSG "lat" abbreviation, but some other conventions use "θ"
instead.
+     * Direction in the EPSG database is "North", but the "Up" direction may also be used
with a similar
+     * axis named "elevation".
      */
     public static final String SPHERICAL_LATITUDE = "Spherical latitude";
 

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=1687825&r1=1687824&r2=1687825&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] Fri Jun 26 17:54:06 2015
@@ -358,12 +358,13 @@ public class ReferencingServices extends
      * since that legacy format did not specified any information about the coordinate system
in use.
      * This method should not need to be invoked for parsing WKT version 2.
      *
+     * @param  properties The coordinate system name, and optionally other properties.
      * @param  axes The axes of the unknown coordinate system.
      * @return An "abstract" coordinate system using the given axes.
      *
      * @since 0.6
      */
-    public CoordinateSystem createAbstractCS(final CoordinateSystemAxis[] axes) {
+    public CoordinateSystem createAbstractCS(final Map<String,?> properties, final
CoordinateSystemAxis[] axes) {
         throw moduleNotFound();
     }
 
@@ -392,18 +393,17 @@ public class ReferencingServices extends
     }
 
     /**
-     * Suggests an abbreviation for the given axis direction. The unit of measurement may
be used
-     * for resolving some ambiguities like whether {@link AxisDirection#EAST} is for "x"
(Easting)
-     * or "λ" (Longitude).
-     *
-     * @param name      The axis name for which to suggest an abbreviation.
-     * @param direction The axis direction for which to suggest an abbreviation.
-     * @param unit      The axis unit of measurement, for disambiguation.
-     * @return A suggested abbreviation.
+     * Returns an axis direction from a pole along a meridian.
+     * The given meridian is usually, but not necessarily, relative to the Greenwich meridian.
+     *
+     * @param  baseDirection The base direction, which must be {@link AxisDirection#NORTH}
or {@link AxisDirection#SOUTH}.
+     * @param  meridian The meridian in degrees, relative to a unspecified (usually Greenwich)
prime meridian.
+     *         Meridians in the East hemisphere are positive and meridians in the West hemisphere
are negative.
+     * @return The axis direction along the given meridian.
      *
      * @since 0.6
      */
-    public String suggestAbbreviation(final String name, final AxisDirection direction, final
Unit<?> unit) {
+    public AxisDirection directionAlongMeridian(final AxisDirection baseDirection, final
double meridian) {
         throw moduleNotFound();
     }
 

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java?rev=1687825&r1=1687824&r2=1687825&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
[UTF-8] Fri Jun 26 17:54:06 2015
@@ -93,13 +93,14 @@ public final class WKTKeywords extends S
      * and {@link org.apache.sis.referencing.crs.DefaultGeographicCRS}.
      */
     public static final String
-            BBox        = "BBox",
-            Datum       = "Datum",
-            GeodeticCRS = "GeodeticCRS",
-            BaseGeodCRS = "BaseGeodCRS",
-            GeodCRS     = "GeodCRS",
-            GeogCS      = "GeogCS",
-            GeocCS      = "GeocCS";
+            BBox          = "BBox",
+            Datum         = "Datum",
+            GeodeticDatum = "GeodeticDatum",
+            GeodeticCRS   = "GeodeticCRS",
+            BaseGeodCRS   = "BaseGeodCRS",
+            GeodCRS       = "GeodCRS",
+            GeogCS        = "GeogCS",
+            GeocCS        = "GeocCS";
 
     /**
      * Related to {@link org.apache.sis.referencing.crs.DefaultVerticalCRS}.
@@ -178,4 +179,20 @@ public final class WKTKeywords extends S
             Concat_MT      = "Concat_MT",
             PassThrough_MT = "PassThrough_MT",
             Fitted_CS      = "Fitted_CS";
+
+    /**
+     * Coordinate system types. They are not WKT keywords, but are legal values for the "type"
+     * element in a {@code "CS[…]"} element.
+     */
+    public static final String
+            affine      = "affine",
+            Cartesian   = "Cartesian",      // Upper case 'C' is intentional.
+            cylindrical = "cylindrical",
+            ellipsoidal = "ellipsoidal",
+            linear      = "linear",
+            parametric  = "parametric",
+            polar       = "polar",
+            spherical   = "spherical",
+            temporal    = "temporal",
+            vertical    = "vertical";
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java?rev=1687825&r1=1687824&r2=1687825&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
[UTF-8] Fri Jun 26 17:54:06 2015
@@ -21,18 +21,16 @@ import java.util.List;
 import java.util.Date;
 import java.util.Locale;
 import java.util.LinkedHashMap;
-import java.util.Calendar;
-import java.util.TimeZone;
 import java.text.DateFormat;
 import java.text.NumberFormat;
 import java.text.DecimalFormat;
 import java.text.ParsePosition;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import javax.measure.unit.Unit;
 import javax.measure.unit.UnitFormat;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
+import org.apache.sis.internal.util.StandardDateFormat;
 import org.apache.sis.measure.Units;
 import org.apache.sis.util.Workaround;
 
@@ -252,43 +250,14 @@ abstract class AbstractParser implements
     /**
      * Parses the date at the given position.
      * This is a helper method for {@link Element} only.
+     *
+     * <p>The WKT 2 format expects dates formatted according the ISO 9075-2 standard.</p>
      */
     final Date parseDate(final String text, final ParsePosition position) {
         if (dateFormat == null) {
-            dateFormat = new SimpleDateFormat(WKTFormat.DATE_PATTERN, symbols.getLocale());
-        }
-        /*
-         * Following is a workaround specific to the JDK6 branch. Since JDK6 does not understand
the 'Z' suffix,
-         * we handle it in this method. The Apache SIS branch for JDK7 does not need this
hack since JDK7 supports
-         * parsing the 'Z' suffix.
-         */
-        final Date date = dateFormat.parse(text, position);
-        if (date != null) {
-            final int p = position.getIndex();
-            if (p < text.length() && text.charAt(p) == 'Z') {
-                position.setIndex(p + 1);
-                final Calendar cal = dateFormat.getCalendar();
-                final int year   = cal.get(Calendar.YEAR);
-                final int month  = cal.get(Calendar.MONTH);
-                final int day    = cal.get(Calendar.DAY_OF_MONTH);
-                final int hour   = cal.get(Calendar.HOUR_OF_DAY);
-                final int minute = cal.get(Calendar.MINUTE);
-                final int second = cal.get(Calendar.SECOND);
-                final int millis = cal.get(Calendar.MILLISECOND);
-                final TimeZone timezone = cal.getTimeZone();
-                final long time;
-                try {
-                    cal.setTimeZone(TimeZone.getTimeZone("UTC"));
-                    cal.set(year, month, day, hour, minute, second);
-                    cal.set(Calendar.MILLISECOND, millis);
-                    time = cal.getTimeInMillis();
-                } finally {
-                    cal.setTimeZone(timezone);
-                }
-                date.setTime(time);
-            }
+            dateFormat = new StandardDateFormat(symbols.getLocale());
         }
-        return date;
+        return dateFormat.parse(text, position);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1687825&r1=1687824&r2=1687825&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8]
(original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8]
Fri Jun 26 17:54:06 2015
@@ -538,7 +538,7 @@ final class Element {
                 if (element.list != null) {
                     for (int i=0; i<keys.length; i++) {
                         if (element.keyword.equalsIgnoreCase(keys[i])) {
-                            keywordIndex = (byte) i;
+                            element.keywordIndex = (byte) i;
                             iterator.remove();
                             return element;
                         }
@@ -607,8 +607,7 @@ final class Element {
     }
 
     /**
-     * Returns the index of the keyword in the array given to the {@link #pullElement(String...)}
-     * or {@link #pullOptionalElement(String...)} method.
+     * Returns the index of the keyword in the array given to the {@link #pullElement(int,
String...)} method.
      */
     final int getKeywordIndex() {
         return keywordIndex;

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=1687825&r1=1687824&r2=1687825&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] Fri Jun 26 17:54:06 2015
@@ -175,7 +175,7 @@ public abstract class FormattableObject
         formatter.configure(convention, null, colorize ? Colors.DEFAULT : null,
                 convention.majorVersion() == 1, WKTFormat.DEFAULT_INDENTATION);
         if (!strict) {
-            formatter.encoding = CharEncoding.UNICODE;
+            formatter.transliterator = Transliterator.IDENTITY;
         }
         final String wkt;
         try {

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=1687825&r1=1687824&r2=1687825&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] Fri Jun 26 17:54:06 2015
@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Locale;
-import java.util.TimeZone;
 import java.util.Date;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -66,6 +65,7 @@ import org.apache.sis.util.ArgumentCheck
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.Citations;
 import org.apache.sis.internal.util.PatchedUnitFormat;
+import org.apache.sis.internal.util.StandardDateFormat;
 import org.apache.sis.internal.simple.SimpleExtent;
 import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.internal.metadata.ReferencingServices;
@@ -173,11 +173,11 @@ public class Formatter implements Locali
     private Citation authority;
 
     /**
-     * {@link CharEncoding#UNICODE} for preserving non-ASCII characters. The default value
is
-     * {@link CharEncoding#DEFAULT}, which causes replacements like "é" → "e" in all elements
-     * except {@code REMARKS["…"]}. May also be a user-supplied encoding.
+     * {@link Transliterator#IDENTITY} for preserving non-ASCII characters. The default value
is
+     * {@link Transliterator#DEFAULT}, which causes replacements like "é" → "e" in all
elements
+     * except {@code REMARKS["…"]}. May also be a user-supplied transliterator.
      */
-    CharEncoding encoding;
+    Transliterator transliterator;
 
     /**
      * The enclosing WKT element being formatted.
@@ -337,10 +337,9 @@ public class Formatter implements Locali
         this.lineSeparator = this.symbols.lineSeparator();
         this.indentation   = (byte) indentation;
         this.numberFormat  = symbols.createNumberFormat();
-        this.dateFormat    = new SimpleDateFormat(WKTFormat.DATE_PATTERN + "'Z'", symbols.getLocale());
+        this.dateFormat    = new StandardDateFormat(symbols.getLocale());
         this.unitFormat    = new PatchedUnitFormat(UnitFormat.getInstance(symbols.getLocale()));
         this.buffer        = new StringBuffer();
-        dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     }
 
     /**
@@ -384,12 +383,12 @@ public class Formatter implements Locali
     final void configure(Convention convention, final Citation authority, final Colors colors,
             final boolean toUpperCase, final byte indentation)
     {
-        this.convention   = convention;
-        this.authority    = (authority != null) ? authority : convention.getNameAuthority();
-        this.colors       = colors;
-        this.toUpperCase  = toUpperCase;
-        this.indentation  = indentation;
-        this.encoding     = (convention == Convention.INTERNAL) ? CharEncoding.UNICODE :
CharEncoding.DEFAULT;
+        this.convention     = convention;
+        this.authority      = (authority != null) ? authority : convention.getNameAuthority();
+        this.colors         = colors;
+        this.toUpperCase    = toUpperCase;
+        this.indentation    = indentation;
+        this.transliterator = (convention == Convention.INTERNAL) ? Transliterator.IDENTITY
: Transliterator.DEFAULT;
     }
 
     /**
@@ -410,20 +409,20 @@ public class Formatter implements Locali
      * according ISO 19162 specification. Return values can be:
      *
      * <ul>
-     *   <li>{@link CharEncoding#DEFAULT} for performing replacements like "é" →
"e"
+     *   <li>{@link Transliterator#DEFAULT} for performing replacements like "é" →
"e"
      *       in all WKT elements except {@code REMARKS["…"]}.</li>
-     *   <li>{@link CharEncoding#UNICODE} for preserving non-ASCII characters.</li>
+     *   <li>{@link Transliterator#IDENTITY} for preserving non-ASCII characters.</li>
      *   <li>Any other user-supplied mapping.</li>
      * </ul>
      *
      * @return The mapper between Java character sequences and the characters to write in
WKT.
      *
-     * @see WKTFormat#setCharEncoding(CharEncoding)
+     * @see WKTFormat#setTransliterator(Transliterator)
      *
      * @since 0.6
      */
-    public final CharEncoding getCharEncoding() {
-        return encoding;
+    public final Transliterator getTransliterator() {
+        return transliterator;
     }
 
     /**
@@ -870,11 +869,11 @@ public class Formatter implements Locali
                 String pattern = null;
                 if (dateFormat instanceof SimpleDateFormat && (max.getTime() - min.getTime())
>= TEMPORAL_THRESHOLD) {
                     final String p = ((SimpleDateFormat) dateFormat).toPattern();
-                    if (p.length() > WKTFormat.SHORT_DATE_PATTERN.length() &&
-                        p.startsWith(WKTFormat.SHORT_DATE_PATTERN))
+                    if (p.length() > StandardDateFormat.SHORT_PATTERN.length() &&
+                        p.startsWith(StandardDateFormat.SHORT_PATTERN))
                     {
                         pattern = p;
-                        ((SimpleDateFormat) dateFormat).applyPattern(WKTFormat.SHORT_DATE_PATTERN);
+                        ((SimpleDateFormat) dateFormat).applyPattern(StandardDateFormat.SHORT_PATTERN);
                     }
                 }
                 openElement(true, WKTKeywords.TimeExtent);
@@ -968,7 +967,7 @@ public class Formatter implements Locali
         if (type == ElementKind.REMARKS) {
             buffer.append(text);
         } else {
-            buffer.append(encoding.filter(text));
+            buffer.append(transliterator.filter(text));
         }
         closeQuote(base);
         resetColor();



Mime
View raw message