sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626641 - in /sis/branches/JDK7: ./ core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/ core/sis-build-helper/src/main/javadoc/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-metadata/src/main/java/org/apac...
Date Sun, 21 Sep 2014 21:56:43 GMT
Author: desruisseaux
Date: Sun Sep 21 21:56:42 2014
New Revision: 1626641

URL: http://svn.apache.org/r1626641
Log:
Merge from the JDK8 branch.

Removed:
    sis/branches/JDK7/core/sis-build-helper/src/main/javadoc/stylesheet.css
    sis/branches/JDK7/core/sis-metadata/src/main/javadoc/stylesheet.css
    sis/branches/JDK7/core/sis-referencing/src/main/javadoc/stylesheet.css
    sis/branches/JDK7/core/sis-utility/src/main/javadoc/stylesheet.css
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
    sis/branches/JDK7/pom.xml

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1626367-1626640

Modified: sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -25,6 +25,9 @@ import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
+import java.io.FilenameFilter;
+import java.nio.file.FileSystemException;
+import java.nio.file.Files;
 import com.sun.javadoc.RootDoc;
 import com.sun.tools.doclets.formats.html.HtmlDoclet;
 
@@ -78,7 +81,10 @@ public final class Doclet extends HtmlDo
         }
         final boolean status = HtmlDoclet.start(new FilteredRootDoc(root, Arrays.copyOf(filteredOptions,
n)));
         if (stylesheetFile != null && outputDirectory != null) try {
-            copyStylesheet(new File(stylesheetFile), new File(outputDirectory));
+            final File input  = new File(stylesheetFile);
+            final File output = new File(outputDirectory);
+            copyStylesheet(input, output);
+            copyResources(input.getParentFile(), output);
         } catch (IOException e) {
             root.printError(e.toString());
             return false;
@@ -140,4 +146,47 @@ public final class Doclet extends HtmlDo
             }
         }
     }
+
+    /**
+     * Creates links to Javadoc resources in the top-level directory (not from "{@code doc-files}"
subdirectories).
+     * While the Maven documentation said that the "{@code src/main/javadoc}" directory is
copied by default, or a
+     * directory can be specified with {@code <javadocResourcesDirectory>}, I have
been unable to make it work even
+     * with absolute paths.
+     *
+     * @param  inputFile        The directory containing resources.
+     * @param  outputDirectory  The directory where to copy the resource files.
+     * @throws IOException      If an error occurred while reading or writing.
+     */
+    private static void copyResources(final File inputDirectory, final File outputDirectory)
throws IOException {
+        final File[] inputFiles = inputDirectory.listFiles(new FilenameFilter() {
+            @Override public boolean accept(final File dir, final String name) {
+                return !name.startsWith(".") &&
+                       !name.equals("overview.html") &&
+                       !name.equals("stylesheet.css");
+            }
+        });
+        try {
+            for (final File input : inputFiles) {
+                final File output = new File(outputDirectory, input.getName());
+                if (!output.exists()) { // For avoiding a failure if the target exists.
+                    Files.createLink(output.toPath(), input.toPath());
+                }
+            }
+        } catch (UnsupportedOperationException | FileSystemException e) {
+            /*
+             * If hard links are not supported, performs plain copy instead.
+             */
+            final byte[] buffer = new byte[4096];
+            for (final File input : inputFiles) {
+                try (final FileInputStream  in  = new FileInputStream(input);
+                     final FileOutputStream out = new FileOutputStream(new File(outputDirectory,
input.getName())))
+                {
+                    int c;
+                    while ((c = in.read(buffer)) >= 0) {
+                        out.write(buffer, 0, c);
+                    }
+                }
+            }
+        }
+    }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -23,6 +23,7 @@ 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;
@@ -318,6 +319,7 @@ public class Formatter implements Locali
         this.dateFormat    = new SimpleDateFormat(WKTFormat.DATE_PATTERN, symbols.getLocale());
         this.unitFormat    = UnitFormat.getInstance(symbols.getLocale());
         this.buffer        = new StringBuffer();
+        dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -103,7 +103,7 @@ public class WKTFormat extends CompoundF
      *
      * @see #createFormat(Class)
      */
-    static final String DATE_PATTERN = "yyyy-MM-dd";
+    static final String DATE_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SX";
 
     /**
      * The symbols to use for this formatter.

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -619,10 +619,10 @@ public class ImmutableIdentifier extends
      * The {@code CITATION[…]} element inside an {@code ID[…]}.
      */
     private static final class Cite extends FormattableObject {
-        /** The component of the citation to format. */
+        /** The value of the citation to format. */
         private final String identifier;
 
-        /** Creates a new citation with the given component. */
+        /** Creates a new citation with the given value. */
         Cite(final String identifier) {
             this.identifier = identifier;
         }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -86,6 +86,11 @@ public class DefaultBand extends Default
     private Unit<Length> boundUnits;
 
     /**
+     * Designation of criterion for defining maximum and minimum wavelengths for a spectral
band.
+     */
+    private BandDefinition bandBoundaryDefinition;
+
+    /**
      * Wavelength at which the response is the highest.
      */
     private Double peakResponse;
@@ -96,11 +101,6 @@ public class DefaultBand extends Default
     private Integer toneGradation;
 
     /**
-     * Designation of criterion for defining maximum and minimum wavelengths for a spectral
band.
-     */
-    private BandDefinition bandBoundaryDefinition;
-
-    /**
      * Smallest distance between which separate points can be distinguished, as specified
in
      * instrument design.
      */
@@ -259,6 +259,27 @@ public class DefaultBand extends Default
     }
 
     /**
+     * Returns the designation of criterion for defining maximum and minimum wavelengths
for a spectral band.
+     *
+     * @return Criterion for defining maximum and minimum wavelengths, or {@code null}.
+     */
+    @Override
+    @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
+    public BandDefinition getBandBoundaryDefinition() {
+        return bandBoundaryDefinition;
+    }
+
+    /**
+     * Sets designation of criterion for defining maximum and minimum wavelengths for a spectral
band.
+     *
+     * @param newValue The new band definition.
+     */
+    public void setBandBoundaryDefinition(final BandDefinition newValue) {
+        checkWritePermission();
+        bandBoundaryDefinition = newValue;
+    }
+
+    /**
      * Returns the wavelength at which the response is the highest.
      * The units of measurement is given by {@link #getUnits()}.
      *
@@ -356,27 +377,6 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Returns the designation of criterion for defining maximum and minimum wavelengths
for a spectral band.
-     *
-     * @return Criterion for defining maximum and minimum wavelengths, or {@code null}.
-     */
-    @Override
-    @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
-    public BandDefinition getBandBoundaryDefinition() {
-        return bandBoundaryDefinition;
-    }
-
-    /**
-     * Sets designation of criterion for defining maximum and minimum wavelengths for a spectral
band.
-     *
-     * @param newValue The new band definition.
-     */
-    public void setBandBoundaryDefinition(final BandDefinition newValue) {
-        checkWritePermission();
-        bandBoundaryDefinition = newValue;
-    }
-
-    /**
      * Returns the smallest distance between which separate points can be distinguished,
      * as specified in instrument design.
      *

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -68,44 +68,50 @@ public class DefaultSampleDimension exte
     private static final long serialVersionUID = 4517148689016920767L;
 
     /**
+     * Minimum value of data values in each dimension included in the resource.
+     */
+    private Double minValue;
+
+    /**
      * Maximum value of data values in each dimension included in the resource.
      */
     private Double maxValue;
 
     /**
-     * Minimum value of data values in each dimension included in the resource.
+     * Mean value of data values in each dimension included in the resource.
      */
-    private Double minValue;
+    private Double meanValue;
 
     /**
-     * Units of data in each dimension included in the resource.
+     * Number of values used in a thematicClassification resource.
      */
-    private Unit<?> units;
+    private Integer numberOfValues;
 
     /**
-     * Scale factor which has been applied to the cell value.
+     * Standard deviation of data values in each dimension included in the resource.
      */
-    private Double scaleFactor;
+    private Double standardDeviation;
 
     /**
-     * Physical value corresponding to a cell value of zero.
+     * Units of data in each dimension included in the resource.
      */
-    private Double offset;
+    private Unit<?> units;
 
     /**
-     * Mean value of data values in each dimension included in the resource.
+     * Scale factor which has been applied to the cell value.
      */
-    private Double meanValue;
+    private Double scaleFactor;
 
     /**
-     * Number of values used in a thematicClassification resource.
+     * Physical value corresponding to a cell value of zero.
      */
-    private Integer numberOfValues;
+    private Double offset;
 
     /**
-     * Standard deviation of data values in each dimension included in the resource.
+     * Maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
      */
-    private Double standardDeviation;
+    private Integer bitsPerValue;
 
     /**
      * Type of other attribute description.
@@ -119,12 +125,6 @@ public class DefaultSampleDimension exte
     private Record otherProperty;
 
     /**
-     * Maximum number of significant bits in the uncompressed representation
-     * for the value in each band of each pixel.
-     */
-    private Integer bitsPerValue;
-
-    /**
      * Constructs an initially empty sample dimension.
      */
     public DefaultSampleDimension() {
@@ -142,17 +142,17 @@ public class DefaultSampleDimension exte
     public DefaultSampleDimension(final SampleDimension object) {
         super(object);
         if (object != null) {
-            maxValue          = object.getMaxValue();
             minValue          = object.getMinValue();
-            units             = object.getUnits();
-            scaleFactor       = object.getScaleFactor();
-            offset            = object.getOffset();
+            maxValue          = object.getMaxValue();
             meanValue         = object.getMeanValue();
             numberOfValues    = object.getNumberOfValues();
             standardDeviation = object.getStandardDeviation();
+            units             = object.getUnits();
+            scaleFactor       = object.getScaleFactor();
+            offset            = object.getOffset();
+            bitsPerValue      = object.getBitsPerValue();
             otherPropertyType = object.getOtherPropertyType();
             otherProperty     = object.getOtherProperty();
-            bitsPerValue      = object.getBitsPerValue();
         }
     }
 
@@ -230,129 +230,154 @@ public class DefaultSampleDimension exte
     }
 
     /**
-     * Returns the units of data in the dimension.
+     * Returns the mean value of data values in each dimension included in the resource.
      *
-     * @return The units of data in the dimension, or {@code null} if unspecified.
+     * @return The mean value of data values in each dimension included in the resource,
or {@code null} if none.
      */
     @Override
-    @XmlElement(name = "units")
-    public Unit<?> getUnits() {
-        return units;
+/// @XmlElement(name = "meanValue")
+    public Double getMeanValue() {
+        return meanValue;
     }
 
     /**
-     * Sets the units of data in the dimension.
+     * Sets the mean value of data values in each dimension included in the resource.
      *
-     * @param newValue The new units of data in the dimension.
+     * @param newValue The new mean value of data values in each dimension included in the
resource.
      */
-    public void setUnits(final Unit<?> newValue) {
+    public void setMeanValue(final Double newValue) {
         checkWritePermission();
-        units = newValue;
+        meanValue = newValue;
     }
 
     /**
-     * Returns the scale factor which has been applied to the cell value.
+     * Returns the number of values used in a thematic classification resource.
      *
-     * @return Scale factor which has been applied to the cell value, or {@code null} if
none.
+     * @return The number of values used in a thematic classification resource, or {@code
null} if none.
      */
     @Override
-/// @XmlElement(name = "scaleFactor")
-    public Double getScaleFactor() {
-        return scaleFactor;
+/// @XmlElement(name = "numberOfValues")
+    public Integer getNumberOfValues() {
+        return numberOfValues;
     }
 
     /**
-     * Sets the scale factor which has been applied to the cell value.
+     * Sets the number of values used in a thematic classification resource.
      *
-     * @param newValue The new scale factor which has been applied to the cell value.
+     * @param newValues The new number of values used in a thematic classification resource.
      */
-    public void setScaleFactor(final Double newValue) {
+    public void setNumberOfValues(final Integer newValues) {
         checkWritePermission();
-        scaleFactor = newValue;
+        numberOfValues = newValues;
     }
 
     /**
-     * Returns the physical value corresponding to a cell value of zero.
+     * Returns the standard deviation of data values in each dimension included in the resource.
      *
-     * @return The physical value corresponding to a cell value of zero, or {@code null}
if none.
+     * @return Standard deviation of data values in each dimension included in the resource,
or {@code null} if none.
      */
     @Override
-/// @XmlElement(name = "offset")
-    public Double getOffset() {
-        return offset;
+/// @XmlElement(name = "standardDeviation")
+    public Double getStandardDeviation() {
+        return standardDeviation;
     }
 
     /**
-     * Sets the physical value corresponding to a cell value of zero.
+     * Sets the standard deviation of data values in each dimension included in the resource.
      *
-     * @param newValue The new physical value corresponding to a cell value of zero, or {@code
null} if none..
+     * @param newValue The new standard deviation of data values in each dimension included
in the resource.
      */
-    public void setOffset(final Double newValue) {
+    public void setStandardDeviation(final Double newValue) {
         checkWritePermission();
-        offset = newValue;
+        standardDeviation = newValue;
     }
 
     /**
-     * Returns the mean value of data values in each dimension included in the resource.
+     * Returns the units of data in the dimension.
      *
-     * @return The mean value of data values in each dimension included in the resource,
or {@code null} if none.
+     * @return The units of data in the dimension, or {@code null} if unspecified.
      */
     @Override
-/// @XmlElement(name = "meanValue")
-    public Double getMeanValue() {
-        return meanValue;
+    @XmlElement(name = "units")
+    public Unit<?> getUnits() {
+        return units;
     }
 
     /**
-     * Sets the mean value of data values in each dimension included in the resource.
+     * Sets the units of data in the dimension.
      *
-     * @param newValue The new mean value of data values in each dimension included in the
resource.
+     * @param newValue The new units of data in the dimension.
      */
-    public void setMeanValue(final Double newValue) {
+    public void setUnits(final Unit<?> newValue) {
         checkWritePermission();
-        meanValue = newValue;
+        units = newValue;
     }
 
     /**
-     * Returns the number of values used in a thematic classification resource.
+     * Returns the scale factor which has been applied to the cell value.
      *
-     * @return The number of values used in a thematic classification resource, or {@code
null} if none.
+     * @return Scale factor which has been applied to the cell value, or {@code null} if
none.
      */
     @Override
-/// @XmlElement(name = "numberOfValues")
-    public Integer getNumberOfValues() {
-        return numberOfValues;
+/// @XmlElement(name = "scaleFactor")
+    public Double getScaleFactor() {
+        return scaleFactor;
     }
 
     /**
-     * Sets the number of values used in a thematic classification resource.
+     * Sets the scale factor which has been applied to the cell value.
      *
-     * @param newValues The new number of values used in a thematic classification resource.
+     * @param newValue The new scale factor which has been applied to the cell value.
      */
-    public void setNumberOfValues(final Integer newValues) {
+    public void setScaleFactor(final Double newValue) {
         checkWritePermission();
-        numberOfValues = newValues;
+        scaleFactor = newValue;
     }
 
     /**
-     * Returns the standard deviation of data values in each dimension included in the resource.
+     * Returns the maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
      *
-     * @return Standard deviation of data values in each dimension included in the resource,
or {@code null} if none.
+     * @return Maximum number of significant bits in the uncompressed representation
+     *         for the value in each band of each pixel, or {@code null} if none.
      */
     @Override
-/// @XmlElement(name = "standardDeviation")
-    public Double getStandardDeviation() {
-        return standardDeviation;
+    @ValueRange(minimum = 1)
+/// @XmlElement(name = "bitsPerValues")
+    public Integer getBitsPerValue() {
+        return bitsPerValue;
     }
 
     /**
-     * Sets the standard deviation of data values in each dimension included in the resource.
+     * Sets the maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
      *
-     * @param newValue The new standard deviation of data values in each dimension included
in the resource.
+     * @param newValue The new maximum number of significant bits.
      */
-    public void setStandardDeviation(final Double newValue) {
+    public void setBitsPerValue(final Integer newValue) {
         checkWritePermission();
-        standardDeviation = newValue;
+        bitsPerValue = newValue;
+    }
+
+    /**
+     * Returns the physical value corresponding to a cell value of zero.
+     *
+     * @return The physical value corresponding to a cell value of zero, or {@code null}
if none.
+     */
+    @Override
+/// @XmlElement(name = "offset")
+    public Double getOffset() {
+        return offset;
+    }
+
+    /**
+     * Sets the physical value corresponding to a cell value of zero.
+     *
+     * @param newValue The new physical value corresponding to a cell value of zero, or {@code
null} if none..
+     */
+    public void setOffset(final Double newValue) {
+        checkWritePermission();
+        offset = newValue;
     }
 
     /**
@@ -398,29 +423,4 @@ public class DefaultSampleDimension exte
         checkWritePermission();
         otherProperty = newValue;
     }
-
-    /**
-     * Returns the maximum number of significant bits in the uncompressed representation
-     * for the value in each band of each pixel.
-     *
-     * @return Maximum number of significant bits in the uncompressed representation
-     *         for the value in each band of each pixel, or {@code null} if none.
-     */
-    @Override
-    @ValueRange(minimum = 1)
-/// @XmlElement(name = "bitsPerValues")
-    public Integer getBitsPerValue() {
-        return bitsPerValue;
-    }
-
-    /**
-     * Sets the maximum number of significant bits in the uncompressed representation
-     * for the value in each band of each pixel.
-     *
-     * @param newValue The new maximum number of significant bits.
-     */
-    public void setBitsPerValue(final Integer newValue) {
-        checkWritePermission();
-        bitsPerValue = newValue;
-    }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -331,18 +331,6 @@ public class DefaultParameterDescriptor<
     }
 
     /**
-     * Creates a new parameter value instance initialized with the {@linkplain #getDefaultValue()
default value}.
-     * The {@linkplain DefaultParameterDescriptor parameter descriptor} for the created parameter
value will be
-     * {@code this} object.
-     *
-     * @return A parameter initialized to the default value.
-     */
-    @Override
-    public ParameterValue<T> createValue() {
-        return new DefaultParameterValue<>(this);
-    }
-
-    /**
      * Returns the class that describe the type of the parameter.
      *
      * @return The parameter value class.
@@ -455,6 +443,18 @@ public class DefaultParameterDescriptor<
     }
 
     /**
+     * Creates a new parameter value instance initialized with the {@linkplain #getDefaultValue()
default value}.
+     * The {@linkplain DefaultParameterDescriptor parameter descriptor} for the created parameter
value will be
+     * {@code this} object.
+     *
+     * @return A parameter initialized to the default value.
+     */
+    @Override
+    public ParameterValue<T> createValue() {
+        return new DefaultParameterValue<>(this);
+    }
+
+    /**
      * Compares the specified object with this parameter for equality.
      * The strictness level is controlled by the second argument.
      * This method compares the following properties in every cases:

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -21,6 +21,7 @@ import java.util.Set;
 import java.util.List;
 import java.util.HashSet;
 import java.util.Collections;
+import org.opengis.parameter.ParameterDirection;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterDescriptor;
@@ -263,16 +264,28 @@ public class DefaultParameterDescriptorG
     }
 
     /**
-     * Creates a new instance of {@linkplain DefaultParameterValueGroup parameter value group}
-     * initialized with the {@linkplain DefaultParameterDescriptor#getDefaultValue default
values}.
-     * The {@linkplain DefaultParameterValueGroup#getDescriptor() parameter descriptor} for
the
-     * created group will be {@code this} object.
+     * Returns an indication if all parameters in this group are inputs to the service, outputs
or both.
+     * If this group contains parameters with different direction, then this method returns
{@code null}.
      *
-     * @return A new parameter instance initialized to the default value.
+     * @return Indication if all parameters are inputs or outputs to the service, or {@code
null} if undetermined.
      */
     @Override
-    public ParameterValueGroup createValue() {
-        return new DefaultParameterValueGroup(this);
+    public ParameterDirection getDirection() {
+        ParameterDirection dir = null;
+        for (final GeneralParameterDescriptor param : descriptors) {
+            final ParameterDirection c = param.getDirection();
+            if (c == null) {
+                return null;
+            }
+            if (c != dir) {
+                if (dir == null) {
+                    dir = c;
+                } else {
+                    return null;
+                }
+            }
+        }
+        return dir;
     }
 
     /**
@@ -323,6 +336,19 @@ public class DefaultParameterDescriptorG
     }
 
     /**
+     * Creates a new instance of {@linkplain DefaultParameterValueGroup parameter value group}
+     * initialized with the {@linkplain DefaultParameterDescriptor#getDefaultValue default
values}.
+     * The {@linkplain DefaultParameterValueGroup#getDescriptor() parameter descriptor} for
the
+     * created group will be {@code this} object.
+     *
+     * @return A new parameter instance initialized to the default value.
+     */
+    @Override
+    public ParameterValueGroup createValue() {
+        return new DefaultParameterValueGroup(this);
+    }
+
+    /**
      * Compares the specified object with this parameter group for equality.
      *
      * @return {@inheritDoc}

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
(original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
Sun Sep 21 21:56:42 2014
@@ -31,6 +31,7 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.Formatter;
+import org.apache.sis.io.wkt.FormattableObject;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.internal.metadata.MetadataUtilities.canSetProperty;
@@ -72,7 +73,7 @@ import java.util.Objects;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4 (derived from geotk-1.2)
- * @version 0.4
+ * @version 0.5
  * @module
  *
  * @see org.apache.sis.referencing.CommonCRS.Temporal#datum()
@@ -288,11 +289,30 @@ public class DefaultTemporalDatum extend
     protected String formatTo(final Formatter formatter) {
         super.formatTo(formatter);
         final Convention convention = formatter.getConvention();
-        if (convention == Convention.INTERNAL) {
-            formatter.append(MetadataUtilities.toDate(origin)); // This is an extension compared
to ISO 19162.
-        } else if (convention.majorVersion() == 1) {
+        formatter.append(new Origin(MetadataUtilities.toDate(origin)));
+        if (convention.majorVersion() == 1) {
             formatter.setInvalidWKT(this, null);
         }
         return "TimeDatum";
     }
+
+    /**
+     * The {@code TIMEORIGIN[…]} element inside an {@code TDATUM[…]}.
+     */
+    private static final class Origin extends FormattableObject {
+        /** The value of the origin to format. */
+        private final Date origin;
+
+        /** Creates a new time origin with the given value. */
+        Origin(final Date origin) {
+            this.origin = origin;
+        }
+
+        /** Formats the time origin. */
+        @Override
+        protected String formatTo(final Formatter formatter) {
+            formatter.append(origin);
+            return "TimeOrigin";
+        }
+    }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -19,6 +19,7 @@ package org.apache.sis.parameter;
 import java.util.Map;
 import java.util.List;
 import java.util.HashMap;
+import org.opengis.parameter.ParameterDirection;
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.ParameterNotFoundException;
 import org.apache.sis.test.DependsOn;
@@ -37,7 +38,7 @@ import static org.opengis.referencing.Id
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.4 (derived from geotk-2.1)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @DependsOn(DefaultParameterDescriptorTest.class)
@@ -95,6 +96,7 @@ public final strictfp class DefaultParam
      */
     @Test
     public void validateTestObjects() {
+        assertEquals(ParameterDirection.IN, M1_M1_O1_O2.getDirection());
         for (final GeneralParameterDescriptor descriptor : M1_M1_O1_O2.descriptors()) {
             AssertionError error = null;
             try {

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -162,7 +162,7 @@ public final strictfp class DefaultCompo
                 "    UNIT[“metre”, 1],\n" +
                 "    AXIS[“Gravity-related height”, UP]],\n" +
                 "  TIMECRS[“Time”,\n" +
-                "    TIMEDATUM[“UNIX”],\n" +
+                "    TIMEDATUM[“UNIX”, TIMEORIGIN[1970-01-01T00:00:00.0Z]],\n" +
                 "    UNIT[“day”, 86400],\n" +
                 "    AXIS[“Time”, FUTURE]]]",
                 HardCodedCRS.GEOID_4D);
@@ -190,7 +190,7 @@ public final strictfp class DefaultCompo
                 "      Axis[“Gravity-related height (H)”, up],\n" +
                 "      LengthUnit[“metre”, 1]],\n" +
                 "  TimeCRS[“Time”,\n" +
-                "    TimeDatum[“UNIX”],\n" +
+                "    TimeDatum[“UNIX”, TimeOrigin[1970-01-01T00:00:00.0Z]],\n" +
                 "    CS[“temporal”, 1],\n" +
                 "      Axis[“Time (t)”, future],\n" +
                 "      TimeUnit[“day”, 86400]],\n" +

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] Sun Sep 21 21:56:42 2014
@@ -20,6 +20,7 @@ import java.util.Date;
 import java.util.Map;
 import java.util.HashMap;
 import javax.xml.bind.JAXBException;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 import org.apache.sis.test.XMLTestCase;
@@ -34,7 +35,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class DefaultTemporalDatumTest extends XMLTestCase {
@@ -49,12 +50,9 @@ public final strictfp class DefaultTempo
     private static final long ORIGIN = -40587 * (24*60*60*1000L);
 
     /**
-     * Tests XML marshalling.
-     *
-     * @throws JAXBException If an error occurred during marshalling.
+     * Creates the temporal datum to use for testing purpose.
      */
-    @Test
-    public void testMarshalling() throws JAXBException {
+    private static DefaultTemporalDatum create() {
         final Map<String,Object> properties = new HashMap<>(4);
         assertNull(properties.put(DefaultTemporalDatum.IDENTIFIERS_KEY,
                 new ImmutableIdentifier(HardCodedCitations.SIS, "SIS", "MJ")));
@@ -62,8 +60,28 @@ public final strictfp class DefaultTempo
         assertNull(properties.put(DefaultTemporalDatum.SCOPE_KEY, "History."));
         assertNull(properties.put(DefaultTemporalDatum.REMARKS_KEY,
                 "Time measured as days since November 17, 1858 at 00:00 UTC."));
+        return new DefaultTemporalDatum(properties, new Date(ORIGIN));
+    }
 
-        final DefaultTemporalDatum datum = new DefaultTemporalDatum(properties, new Date(ORIGIN));
+    /**
+     * Tests {@link DefaultTemporalDatum#toWKT()}.
+     *
+     * @since 0.5
+     */
+    @Test
+    public void testToWKT() {
+        final DefaultTemporalDatum datum = create();
+        assertWktEquals(Convention.WKT2, "TimeDatum[“Modified Julian”, TimeOrigin[1858-11-17T00:00:00.0Z],
Id[“SIS”, “MJ”]]", datum);
+    }
+
+    /**
+     * Tests XML marshalling.
+     *
+     * @throws JAXBException If an error occurred during marshalling.
+     */
+    @Test
+    public void testMarshalling() throws JAXBException {
+        final DefaultTemporalDatum datum = create();
         assertMarshalEqualsFile(XML_FILE, datum, "xlmns:*", "xsi:schemaLocation");
     }
 

Modified: sis/branches/JDK7/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1626641&r1=1626640&r2=1626641&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Sun Sep 21 21:56:42 2014
@@ -517,39 +517,6 @@ Apache SIS is a free software, Java lang
         </configuration>
       </plugin>
 
-      <!-- Copy Javadoc resources in the top-level directory (not from "doc-files" subdirectories).
-           While the Maven documentation said that the "src/main/javadoc" directory is copied
by default,
-           or a directory can be specified with <javadocResourcesDirectory>, I have
been unable to make it
-           work even with absolute paths.
-        -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-resources-plugin</artifactId>
-        <configuration>
-          <encoding>${project.build.sourceEncoding}</encoding>
-        </configuration>
-        <executions>
-          <execution>
-            <id>copy-resources</id>
-            <phase>prepare-package</phase> <!-- TODO: find some way to execute
this plugin only before javadoc, not before JAR. -->
-            <goals>
-              <goal>copy-resources</goal>
-            </goals>
-            <configuration>
-              <resources>
-                <resource>
-                  <directory>src/main/javadoc/</directory>
-                  <includes>
-                    <include>*.png</include>
-                  </includes>
-                </resource>
-              </resources>
-              <outputDirectory>${basedir}/target/site/apidocs/</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
       <!-- JavaDoc configuration. -->
       <plugin>
         <artifactId>maven-javadoc-plugin</artifactId>



Mime
View raw message