sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1516797 - in /sis/branches/JDK7/core: sis-referencing/src/main/java/org/apache/sis/io/wkt/ sis-utility/src/main/java/org/apache/sis/util/
Date Fri, 23 Aug 2013 09:56:43 GMT
Author: desruisseaux
Date: Fri Aug 23 09:56:43 2013
New Revision: 1516797

URL: http://svn.apache.org/r1516797
Log:
Javadoc and minor tuning.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Colors.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/ElementKind.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Symbols.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/UnformattableObjectException.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/package-info.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Colors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Colors.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Colors.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Colors.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -25,6 +25,15 @@ import org.apache.sis.util.resources.Err
 
 /**
  * The colors to use for formatting <cite>Well Known Text</cite> (WKT) objects.
+ * Colors are identified by their names and can be mapped to {@link ElementKind}.
+ * The currently supported color names are:
+ *
+ * <ul>
+ *   <li>{@code "red"}, {@code "green"}, {@code "yellow"}, {@code "blue"}, {@code "magenta"},
{@code "cyan"},
+ *       {@code "gray"}.</li>
+ * </ul>
+ *
+ * The above list may be expanded in any future SIS version.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4 (derived from geotk-3.00)
@@ -81,16 +90,16 @@ public class Colors implements Serializa
     }
 
     /**
-     * Sets the color of the given syntactic element.
+     * Sets the color of the given syntactic element from a color name.
      * The color names supported in the current implementation are
      * {@code "red"}, {@code "green"}, {@code "yellow"}, {@code "blue"}, {@code "magenta"},
{@code "cyan"}
-     * and {@code "gray"}.
+     * and {@code "gray"}, case-insensitive.
      *
      * @param  key   The syntactic element for which to set the color.
      * @param  color The color to give to the specified element, or {@code null} if none.
      * @throws IllegalArgumentException If the given color name is not recognized.
      */
-    public void set(final ElementKind key, final String color) throws IllegalArgumentException
{
+    public void setName(final ElementKind key, final String color) throws IllegalArgumentException
{
         if (color == null) {
             map.remove(key);
         } else {
@@ -104,7 +113,7 @@ public class Colors implements Serializa
      * @param key The syntactic element for which to get the color.
      * @return The color of the specified element, or {@code null} if none.
      */
-    public String get(final ElementKind key) {
+    public String getName(final ElementKind key) {
         final X364 color = map.get(key);
         return (color != null) ? color.color : null;
     }
@@ -145,7 +154,7 @@ public class Colors implements Serializa
          * Do not allow color changes.
          */
         @Override
-        public void set(final ElementKind key, final String color) {
+        public void setName(final ElementKind key, final String color) {
             throw new UnsupportedOperationException(Errors.format(Errors.Keys.UnmodifiableObject_1,
"Colors"));
         }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -37,17 +37,20 @@ import static javax.measure.unit.NonSI.D
 
 /**
  * The convention to use for WKT formatting.
- * This enumeration exists as an attempt to address some of the problems documented in the
Frank Warmerdam's
+ * This enumeration attempts to address some of the variability documented in the Frank Warmerdam's
  * <a href="http://home.gdal.org/projects/opengis/wktproblems.html">OGC WKT Coordinate
System Issues</a> page.
  *
- * <p>The various conventions differ mostly in parameter names, and sometime in WKT
syntax.
- * For example the {@linkplain org.apache.sis.referencing.operation.projection.Mercator projection}
- * has a parameter named "<cite>Longitude of natural origin</cite>" by {@linkplain
#EPSG},
- * "{@code central_meridian}" by {@linkplain #OGC} and "{@code NatOriginLong}" by {@linkplain
#GEOTIFF}.
- * In addition the unit of the prime meridian shall be the angular unit of the enclosing
- * {@linkplain GeographicCRS geographic CRS} according the {@linkplain #OGC} standard,
- * but is restricted to decimal degrees by {@linkplain #ESRI}.
- * Other differences are documented in the javadoc of each enumeration value.</p>
+ * <p>The various conventions differ mostly in:</p>
+ * <ul>
+ *   <li><em>Parameter names</em> - for example the {@linkplain org.apache.sis.referencing.operation.projection.Mercator
+ *       Mercator projection} has a parameter named "<cite>Longitude of natural origin</cite>"
by {@linkplain #EPSG},
+ *       "{@code central_meridian}" by {@linkplain #OGC} and "{@code NatOriginLong}" by {@linkplain
#GEOTIFF}.</li>
+ *   <li><em>WKT syntax</em> - for example {@linkplain #ORACLE Oracle}
does not enclose Bursa-Wolf parameters in a
+ *       {@code TOWGS84[…]} element.</li>
+ *   <li><em>Unit of measurement</em> - for example the unit of the prime
meridian shall be the angular unit of the
+ *       enclosing {@linkplain GeographicCRS geographic CRS} according the {@linkplain #OGC}
standard,
+ *       but is restricted to decimal degrees by {@linkplain #ESRI}.</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4 (derived from geotk-3.20)
@@ -61,13 +64,15 @@ public enum Convention {
     /**
      * The <a href="http://www.opengeospatial.org">Open Geospatial consortium</a>
convention.
      * This is the default convention for all WKT formatting in the Apache SIS library.
+     * Some worthy aspects to note:
      *
-     * {@section Spacial case}
-     * For {@link GeocentricCRS}, this convention uses the legacy set of Cartesian axes.
-     * Those axes were defined in OGC 01-009 as <var>Other</var>,
-     * <var>{@linkplain DefaultCoordinateSystemAxis#EASTING Easting}</var> and
-     * <var>{@linkplain DefaultCoordinateSystemAxis#NORTHING Northing}</var>
-     * in metres, where the "<var>Other</var>" axis is toward prime meridian.
+     * <ul>
+     *   <li>For {@link GeocentricCRS}, this convention uses the legacy set of Cartesian
axes.
+     *     Those axes were defined in OGC 01-009 as <var>Other</var>,
+     *     <var>{@linkplain DefaultCoordinateSystemAxis#EASTING Easting}</var>
and
+     *     <var>{@linkplain DefaultCoordinateSystemAxis#NORTHING Northing}</var>
+     *     in metres, where the "<var>Other</var>" axis is toward prime meridian.</li>
+     * </ul>
      *
      * @see Citations#OGC
      * @see #toConformCS(CoordinateSystem)
@@ -77,13 +82,15 @@ public enum Convention {
     /**
      * The <a href="http://www.epsg.org">European Petroleum Survey Group</a>
convention.
      * This convention uses the most descriptive parameter and projection names.
+     * Some worthy aspects to note:
      *
-     * {@section Spacial case}
-     * For {@link GeocentricCRS}, this convention uses the new set of Cartesian axes.
-     * Those axes are defined in ISO 19111 as
-     * <var>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_X Geocentric X}</var>,
-     * <var>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Y Geocentric Y}</var>
and
-     * <var>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Z Geocentric Z}</var>
in metres.
+     * <ul>
+     *   <li>For {@link GeocentricCRS}, this convention uses the new set of Cartesian
axes.
+     *     Those axes are defined in ISO 19111 as
+     *     <var>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_X Geocentric X}</var>,
+     *     <var>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Y Geocentric Y}</var>
and
+     *     <var>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Z Geocentric Z}</var>
in metres.</li>
+     * </ul>
      *
      * @see Citations#EPSG
      * @see #toConformCS(CoordinateSystem)
@@ -134,7 +141,11 @@ public enum Convention {
 
     /**
      * The <a href="http://www.unidata.ucar.edu/software/netcdf-java">NetCDF</a>
convention.
-     * This convention is similar to the {@link #OGC} convention except for parameter and
projection names.
+     * This convention is similar to the {@link #OGC} convention except in the following
aspects:
+     *
+     * <ul>
+     *   <li>Parameter and projection names.</li>
+     * </ul>
      *
      * @see Citations#NETCDF
      */
@@ -142,7 +153,11 @@ public enum Convention {
 
     /**
      * The <a href="http://www.remotesensing.org/geotiff/geotiff.html">GeoTIFF</a>
convention.
-     * This convention is similar to the {@link #OGC} convention except for parameter and
projection names.
+     * This convention is similar to the {@link #OGC} convention except in the following
aspects:
+     *
+     * <ul>
+     *   <li>Parameter and projection names.</li>
+     * </ul>
      *
      * @see Citations#GEOTIFF
      */
@@ -150,10 +165,10 @@ public enum Convention {
 
     /**
      * The <a href="http://trac.osgeo.org/proj/">Proj.4</a> convention.
-     * This convention uses very short parameter and projection names.
-     * Other differences are:
+     * This convention is similar to the {@link #OGC} convention except in the following
aspects:
      *
      * <ul>
+     *   <li>Very short parameter and projection names.</li>
      *   <li>The angular units of {@code PRIMEM} and {@code PARAMETER} elements are
always degrees,
      *       no matter the units of the enclosing {@code GEOGCS} element.</li>
      * </ul>
@@ -209,44 +224,42 @@ public enum Convention {
     final boolean unitUS;
 
     /**
-     * The citation for this enumeration.
+     * The organization, standard or project that defines this convention.
      */
-    private final Citation citation;
+    private final Citation authority;
 
     /**
      * Creates a new enumeration value.
      */
-    private Convention(final Citation citation, final Unit<Angle> angularUnit, final
boolean unitUS) {
-        this.citation = citation;
+    private Convention(final Citation authority, final Unit<Angle> angularUnit, final
boolean unitUS) {
+        this.authority = authority;
         this.forcedAngularUnit = angularUnit;
         this.unitUS = unitUS;
     }
 
     /**
-     * Returns the citation for this enumeration.
-     * This is one of the constants defined in the {@link Citations} class.
+     * Returns the citation for the organization, standard of project that defines this convention.
      *
-     * @return The citation for this enum.
+     * @return The organization, standard or project that defines this convention.
      *
      * @see WKTFormat#getAuthority()
      */
-    public Citation getCitation() {
-        return citation;
+    public Citation getAuthority() {
+        return authority;
     }
 
     /**
-     * Returns the convention for the given citation.
+     * Returns the convention for the organization, standard or project specified by the
given citation.
      *
-     * @param  citation The citation for which to get the convention, or {@code null}.
-     * @param  defaultConvention The default convention to return if none where found for
-     *         the given citation. May be {@code null}.
+     * @param  authority The organization, standard or project for which to get the convention,
or {@code null}.
+     * @param  defaultConvention The default convention to return if none where found for
the given citation.
      * @return The convention, or {@code null} if no matching convention were found and the
      *         {@code defaultConvention} argument is {@code null}.
      */
-    public static Convention forCitation(final Citation citation, final Convention defaultConvention)
{
-        if (citation != null) {
+    public static Convention forCitation(final Citation authority, final Convention defaultConvention)
{
+        if (authority != null) {
             for (final Convention candidate : values()) {
-                if (Citations.identifierMatches(candidate.getCitation(), citation)) {
+                if (Citations.identifierMatches(candidate.getAuthority(), authority)) {
                     return candidate;
                 }
             }
@@ -255,18 +268,17 @@ public enum Convention {
     }
 
     /**
-     * Returns the convention for the given identifier.
+     * Returns the convention for the organization, standard or project specified by the
given identifier.
      *
-     * @param  identifier The identifier for which to get the convention, or {@code null}.
-     * @param  defaultConvention The default convention to return if none where found for
-     *         the given identifier. May be {@code null}.
+     * @param  authority The organization, standard or project for which to get the convention,
or {@code null}.
+     * @param  defaultConvention The default convention to return if none where found for
the given identifier.
      * @return The convention, or {@code null} if no matching convention were found and the
      *         {@code defaultConvention} argument is {@code null}.
      */
-    public static Convention forIdentifier(final String identifier, final Convention defaultConvention)
{
-        if (identifier != null) {
+    public static Convention forIdentifier(final String authority, final Convention defaultConvention)
{
+        if (authority != null) {
             for (final Convention candidate : values()) {
-                if (Citations.identifierMatches(candidate.getCitation(), identifier)) {
+                if (Citations.identifierMatches(candidate.getAuthority(), authority)) {
                     return candidate;
                 }
             }
@@ -279,17 +291,20 @@ public enum Convention {
      * for converting between the legacy (OGC 01-009) {@link GeocentricCRS} axis directions,
      * and the new (ISO 19111) directions. Those directions are:
      *
-     * <ul>
-     *   <li>OGC 01-009: Other,
-     *     {@linkplain DefaultCoordinateSystemAxis#EASTING Easting},
-     *     {@linkplain DefaultCoordinateSystemAxis#NORTHING Northing}.
-     *   </li>
-     *   <li>ISO 19111:
-     *     {@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_X Geocentric X},
-     *     {@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Y Geocentric Y},
-     *     {@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Z Geocentric Z}.
-     *   </li>
-     * </ul>
+     * <table class="sis">
+     * <tr>
+     *   <th>ISO 19111</th>
+     *   <th>OGC 01-009</th>
+     * </tr><tr>
+     *   <td>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_X Geocentric X}</td>
+     *   <td>Other</td>
+     * </tr><tr>
+     *   <td>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Y Geocentric Y}</td>
+     *   <td>{@linkplain DefaultCoordinateSystemAxis#EASTING Easting}</td>
+     * </tr><tr>
+     *   <td>{@linkplain DefaultCoordinateSystemAxis#GEOCENTRIC_Z Geocentric Z}</td>
+     *   <td>{@linkplain DefaultCoordinateSystemAxis#NORTHING Northing}</td>
+     * </tr></table>
      *
      * @param  cs The coordinate system.
      * @return A coordinate system equivalent to the given one but with conform axis names,

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/ElementKind.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/ElementKind.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/ElementKind.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/ElementKind.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -38,14 +38,14 @@ public enum ElementKind {
     INTEGER,
 
     /**
-     * {@linkplain javax.measure.unit.Unit Units of measurement}.
-     * In referencing WKT, this is the text inside {@code UNIT} elements.
+     * {@linkplain javax.measure.unit.Unit Units of measurement},
+     * often represented by {@code UNIT[…]} elements.
      */
     UNIT,
 
     /**
-     * {@linkplain org.opengis.referencing.cs.CoordinateSystemAxis Axes}.
-     * In referencing WKT, this is the text inside {@code AXIS} elements.
+     * {@linkplain org.opengis.referencing.cs.CoordinateSystemAxis Axes},
+     * often represented by {@code AXIS[…]} elements.
      */
     AXIS,
 
@@ -55,20 +55,20 @@ public enum ElementKind {
     CODE_LIST,
 
     /**
-     * {@linkplain org.opengis.parameter.ParameterValue Parameter values}.
-     * In referencing WKT, this is the text inside {@code PARAMETER} elements.
+     * {@linkplain org.opengis.parameter.ParameterValue Parameter values},
+     * often represented by {@code PARAMETER[…]} elements.
      */
     PARAMETER,
 
     /**
-     * {@linkplain org.opengis.referencing.operation.OperationMethod Operation methods}.
-     * In referencing WKT, this is the text inside {@code PROJECTION} elements.
+     * {@linkplain org.opengis.referencing.operation.OperationMethod Operation methods},
+     * often represented by {@code PROJECTION[…]} elements.
      */
     METHOD,
 
     /**
-     * {@linkplain org.opengis.referencing.datum.Datum Datum}.
-     * In referencing WKT, this is the text inside {@code DATUM} elements.
+     * {@linkplain org.opengis.referencing.datum.Datum Datum},
+     * often represented by {@code DATUM[…]} elements.
      */
     DATUM,
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Symbols.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Symbols.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Symbols.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Symbols.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -31,15 +31,18 @@ import static org.apache.sis.util.Argume
  * Newly created {@code Symbols} instances use the following defaults:
  *
  * <ul>
+ *   <li>An English locale for {@linkplain java.text.DecimalFormatSymbols decimal format
symbols}.</li>
  *   <li>Square brackets, as in {@code DATUM["WGS84"]}. An alternative allowed by the
WKT
  *       specification is curly brackets as in {@code DATUM("WGS84")}.</li>
+ *   <li>English quotation mark ({@code '"'}).</li>
+ *   <li>Coma separator followed by a space ({@code ", "}).</li>
  * </ul>
  *
- * {@section Relationship between <code>Symbols</code> locale and <code>WKTFormat</code>
locale}
- * The {@link Locale} property of {@link WKTFormat} specifies the language to use when formatting
- * {@link org.opengis.util.InternationalString}. This can be set to any value. On the contrary,
- * the {@code Locale} property of {@code Symbols} specifies the {@linkplain java.text.DecimalFormatSymbols
- * decimal format symbols} and is very rarely set to an other locale than an English one.
+ * {@note <b>Relationship between <code>Symbols</code> locale and <code>WKTFormat</code>
locale</b><br>
+ *        The <code>WKTFormat</code> <code>Locale</code> property
specifies the language to use when
+ *        formatting <code>InternationalString</code> instances. This can be
set to any value.
+ *        On the contrary, the <code>Locale</code> property of this <code>Symbols</code>
class controls
+ *        the decimal format symbols and is very rarely set to an other locale than an English
one.}
  *
  * @author  Martin Desruisseaux (IRD)
  * @since   0.4 (derived from geotk-2.1)
@@ -68,7 +71,7 @@ public class Symbols implements Localize
     public static final Symbols CURLY_BRACKETS = new Immutable('(', ')', '[', ']');
 
     /**
-     * The default set of symbols.
+     * The default set of symbols, as documented in the class javadoc.
      * This is currently set to {@link #SQUARE_BRACKETS}.
      *
      * @see Colors#DEFAULT
@@ -220,11 +223,21 @@ public class Symbols implements Localize
     }
 
     /**
+     * Returns the number of paired brackets. For example if the WKT parser accepts both
the
+     * {@code [ ]} and {@code ( )} paired brackets, then this method returns 2.
+     *
+     * @return The number of bracket pairs.
+     */
+    public final int getNumPairedBracket() {
+        return brackets.length / 2;
+    }
+
+    /**
      * Returns the opening bracket character at the given index.
      * Index 0 stands for the default bracket used at formatting time.
      * All other index are for optional brackets accepted at parsing time.
      *
-     * @param  index Index of the opening bracket to get.
+     * @param  index Index of the opening bracket to get, from 0 to {@link #getNumPairedBracket()}
exclusive.
      * @return The opening bracket at the given index, as a Unicode code point.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
@@ -237,7 +250,7 @@ public class Symbols implements Localize
      * Index 0 stands for the default bracket used at formatting time.
      * All other index are for optional brackets accepted at parsing time.
      *
-     * @param  index Index of the closing bracket to get.
+     * @param  index Index of the closing bracket to get, from 0 to {@link #getNumPairedBracket()}
exclusive.
      * @return The closing bracket at the given index, as a Unicode code point.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      */
@@ -282,7 +295,7 @@ public class Symbols implements Localize
 
     /**
      * Returns the character used for opening a sequence of values.
-     * This is usually {@code '{'}.
+     * This is usually <code>'{'</code>.
      *
      * @return The character used for opening a sequence of values, as a Unicode code point.
      */
@@ -292,7 +305,7 @@ public class Symbols implements Localize
 
     /**
      * Returns the character used for closing a sequence of values.
-     * This is usually {@code '}'}.
+     * This is usually <code>'}'</code>.
      *
      * @return The character used for closing a sequence of values, as a Unicode code point.
      */
@@ -396,8 +409,9 @@ public class Symbols implements Localize
      * <ul>
      *   <li>The search is case-insensitive.</li>
      *   <li>Characters between the {@linkplain #getOpenQuote() open quote} and the
-     *       {@link #getCloseQuote() close quote} are ignored.</li>
-     *   <li>The element found in the given WKT must not be a substring of a larger
Unicode identifier.</li>
+     *       {@linkplain #getCloseQuote() close quote} are ignored.</li>
+     *   <li>The element found in the given WKT can not be preceded by other
+     *       {@linkplain Character#isUnicodeIdentifierPart(int) Unicode identifier characters}.</li>
      *   <li>The element found in the given WKT must be followed, ignoring space, by
an
      *       {@linkplain #getOpeningBracket(int) opening bracket}.</li>
      * </ul>
@@ -420,14 +434,15 @@ public class Symbols implements Localize
 
     /**
      * Returns {@code true} if the given WKT contains at least one instance of the {@code
AXIS[…]} element.
-     * Invoking this method is equivalent to invoking {@link #containsElement(CharSequence,
CharSequence)}
-     * for the {@code "AXIS"} element.
+     * Invoking this method is equivalent to invoking
+     * <code>{@linkplain #containsElement(CharSequence, String) containsElement}(wkt,
"AXIS")</code>.
      *
      * <p>The check for axis elements is of particular interest because the axis order
is a frequent cause
-     * of confusion when processing geographic data. Some applications just ignore the axis
order declared
-     * in the WKT in favor of their hard-coded (<var>longitude</var>, <var>latitude</var>)
axis order.
-     * Consequently, the presence of {@code AXIS[…]} elements in a WKT may be an indication
that the encoded
-     * object may not be directly usable by some external softwares.</p>
+     * of confusion when processing geographic data. Some applications just ignore any declared
axis order
+     * in favor of their own hard-coded (<var>longitude</var>, <var>latitude</var>)
axis order.
+     * Consequently, the presence of {@code AXIS[…]} elements in a WKT is an indication
that the encoded
+     * object may not be understood as intended by some external softwares.
+     * See for example {@link Convention#ESRI}.</p>
      *
      * @param  wkt The WKT to inspect.
      * @return {@code true} if the given WKT contains at least one instance of the {@code
AXIS[…]} element.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/UnformattableObjectException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/UnformattableObjectException.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/UnformattableObjectException.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/UnformattableObjectException.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -22,7 +22,7 @@ package org.apache.sis.io.wkt;
  * A formatting may fail because an object is too complex for the WKT format capability.
  *
  * {@example An engineering CRS can not be represented in the WKT 1 format if all axes
- *           does not use the same unit of measurement. However such CRS can be represented
+ *           do not use the same unit of measurement. However such CRS can be represented
  *           in the WKT 2 format.}
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/package-info.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/package-info.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -19,7 +19,7 @@
  * <a href="http://www.geoapi.org/snapshot/javadoc/org/opengis/referencing/doc-files/WKT.html"><cite>Well
  * Known Text</cite> (WKT)</a> parsing and formatting. This package provides
the internal mechanism used
  * by SIS implementation. Most users do not need to know about it, except if they want to
customize the
- * WKT output. For example it is possible to:
+ * parsing process or the WKT output. For example this package allows to:
  *
  * <ul>
  *   <li>{@linkplain org.apache.sis.io.wkt.WKTFormat#setConvention Format the parameters
using the names
@@ -39,7 +39,7 @@
  * here in future versions.
  *
  * {@section Referencing WKT}
- * Parsing of {@linkplain org.apache.sis.referencing.crs.AbstractCoordinateReferenceSystem
Coordinate Reference System}
+ * Parsing of {@linkplain org.apache.sis.referencing.crs.AbstractCRS Coordinate Reference
System}
  * and {@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform Math
Transform} objects
  * are performed by the {@link org.apache.sis.io.wkt.ReferencingParser} class. The parser
provides methods for:
  *
@@ -57,7 +57,7 @@
  *
  * {@section References}
  * <ul>
- *   <li><a href="http://www.geoapi.org/snapshot/javadoc/org/opengis/referencing/doc-files/WKT.html">Well
Known Text specification</a></li>
+ *   <li><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Well
Known Text specification</a></li>
  *   <li><a href="http://home.gdal.org/projects/opengis/wktproblems.html">OGC
WKT Coordinate System Issues</a></li>
  *   <li><a href="http://en.wikipedia.org/wiki/Well-known_text">Well Known Text
in Wikipedia</a></li>
  * </ul>

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -544,15 +544,10 @@ public final class ArgumentChecks extend
      * @since 0.4
      */
     public static void ensureValidUnicodeCodePoint(final String name, final int code) throws
IllegalArgumentException {
-        final Object value;
-        if (code < Character.MIN_CODE_POINT) {
-            value = code;
-        } else if (code > Character.MAX_CODE_POINT) {
-            value = "U+" + Integer.toHexString(code).toUpperCase();
-        } else {
-            return;
+        if (!Character.isValidCodePoint(code)) {
+            throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalUnicodeCodePoint_2,
name,
+                    (code < Character.MIN_CODE_POINT) ? code : "U+" + Integer.toHexString(code).toUpperCase()));
         }
-        throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalUnicodeCodePoint_2,
name, value));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1516797&r1=1516796&r2=1516797&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
[UTF-8] Fri Aug 23 09:56:43 2013
@@ -1783,8 +1783,11 @@ cmp:    while (ia < lga) {
         // because we compare code points while String.regionMatches(…) compares characters.
         final int limit  = text.length();
         final int length = part.length();
+        if (fromIndex < 0) { // Not checked before because we want NullPointerException
if an argument is null.
+            return false;
+        }
         for (int i=0; i<length;) {
-            if (fromIndex < 0 || fromIndex >= limit) {
+            if (fromIndex >= limit) {
                 return false;
             }
             final int c1 = codePointAt(part, i);



Mime
View raw message