sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1617769 - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ core/sis-metadata/src/test/java/org/apache/sis/metadata/ core/sis-utility/sr...
Date Wed, 13 Aug 2014 17:17:51 GMT
Author: desruisseaux
Date: Wed Aug 13 17:17:50 2014
New Revision: 1617769

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

Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TypeMapTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
    sis/branches/JDK6/pom.xml
    sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1617581-1617764
  Merged /sis/branches/JDK7:r1617583-1617766

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -146,6 +146,13 @@ class PropertyAccessor {
      * {@preformat java
      *     type.isAssignableFrom(implementation);
      * }
+     *
+     * <div class="note"><b>Design note:</b>
+     * We could enforce the above-cited restriction with type parameter: if the {@link #type}
field is declared
+     * as {@code Class<T>}, then this {@code implementation} field would be declared
as {@code Class<? extends T>}.
+     * However this is not useful for this internal class because the {@code <T>} type
is never known; we have the
+     * {@code <?>} type everywhere except in tests, which result in compiler warnings
at {@code PropertyAccessor}
+     * construction.</div>
      */
     final Class<?> implementation;
 

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -88,7 +88,7 @@ public class DefaultCitation extends ISO
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 3490090845236158848L;
+    private static final long serialVersionUID = -7343644724857519090L;
 
     /**
      * The authority for International Standard Book Number.
@@ -158,13 +158,16 @@ public class DefaultCitation extends ISO
      * Other information required to complete the citation that is not recorded elsewhere.
      * May be {@code null} if none.
      */
-    private InternationalString otherCitationDetails;
+    private Collection<InternationalString> otherCitationDetails;
 
     /**
      * Common title with holdings note. Note: title identifies elements of a series
      * collectively, combined with information about what volumes are available at the
      * source cited. May be {@code null} if there is no title.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
+    @Deprecated
     private InternationalString collectiveTitle;
 
     /**
@@ -232,6 +235,7 @@ public class DefaultCitation extends ISO
      *
      * @see #castOrCopy(Citation)
      */
+    @SuppressWarnings("deprecation")
     public DefaultCitation(final Citation object) {
         super(object);
         if (object != null) {
@@ -244,7 +248,7 @@ public class DefaultCitation extends ISO
             citedResponsibleParties = copyCollection(object.getCitedResponsibleParties(),
Responsibility.class);
             presentationForms       = copyCollection(object.getPresentationForms(), PresentationForm.class);
             series                  = object.getSeries();
-            otherCitationDetails    = object.getOtherCitationDetails();
+            otherCitationDetails    = copyCollection(object.getOtherCitationDetails(), InternationalString.class);
             collectiveTitle         = object.getCollectiveTitle();
             onlineResources         = copyCollection(object.getOnlineResources(), OnlineResource.class);
             graphics                = copyCollection(object.getGraphics(), BrowseGraphic.class);
@@ -507,26 +511,28 @@ public class DefaultCitation extends ISO
      */
     @Override
     @XmlElement(name = "otherCitationDetails")
-    public InternationalString getOtherCitationDetails() {
-        return otherCitationDetails;
+    public Collection<InternationalString> getOtherCitationDetails() {
+        return otherCitationDetails = nonNullCollection(otherCitationDetails, InternationalString.class);
     }
 
     /**
      * Sets other information required to complete the citation that is not recorded elsewhere.
      *
-     * @param newValue Other citations details, or {@code null} if none.
+     * @param newValues Other citations details.
      */
-    public void setOtherCitationDetails(final InternationalString newValue) {
-        checkWritePermission();
-        otherCitationDetails = newValue;
+    public void setOtherCitationDetails(final Collection<? extends InternationalString>
newValues) {
+        otherCitationDetails = writeCollection(newValues, otherCitationDetails, InternationalString.class);
     }
 
     /**
      * Returns the common title with holdings note.
      *
      * @return The common title, or {@code null} if none.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "collectiveTitle")
     public InternationalString getCollectiveTitle() {
         return collectiveTitle;
@@ -537,7 +543,10 @@ public class DefaultCitation extends ISO
      * combined with information about what volumes are available at the source cited.
      *
      * @param newValue The new collective title, or {@code null} if none.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
+    @Deprecated
     public void setCollectiveTitle(final InternationalString newValue) {
         checkWritePermission();
         collectiveTitle = newValue;

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -43,7 +43,7 @@ import org.apache.sis.metadata.iso.ISOMe
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @XmlType(name = "CI_OnlineResource_Type", propOrder = {
@@ -93,6 +93,12 @@ public class DefaultOnlineResource exten
     private OnLineFunction function;
 
     /**
+     * Request used to access the resource depending on the protocol.
+     * This is used mainly for POST requests.
+     */
+    private String protocolRequest;
+
+    /**
      * Creates an initially empty on line resource.
      */
     public DefaultOnlineResource() {
@@ -126,6 +132,7 @@ public class DefaultOnlineResource exten
             name               = object.getName();
             description        = object.getDescription();
             function           = object.getFunction();
+            protocolRequest    = object.getProtocolRequest();
         }
     }
 
@@ -241,7 +248,7 @@ public class DefaultOnlineResource exten
 
     /**
      * Returns the location (address) for on-line access using a Uniform Resource Locator
address or
-     * similar addressing scheme such as "{@code http://www.statkart.no/isotc211}".
+     * similar addressing scheme.
      *
      * @return Location for on-line access using a Uniform Resource Locator address or similar
scheme, or {@code null}.
      */
@@ -265,6 +272,10 @@ public class DefaultOnlineResource exten
     /**
      * Returns the connection protocol to be used.
      *
+     * <div class="note"><b>Example:</b>
+     * ftp, http get KVP, http POST, <i>etc</i>.
+     * </div>
+     *
      * @return Connection protocol to be used, or {@code null}.
      */
     @Override
@@ -274,7 +285,7 @@ public class DefaultOnlineResource exten
     }
 
     /**
-     * Returns the connection protocol to be used.
+     * Sets the connection protocol to be used.
      *
      * @param newValue The new protocol, or {@code null} if none.
      */
@@ -282,4 +293,39 @@ public class DefaultOnlineResource exten
         checkWritePermission();
         protocol = newValue;
     }
+
+    /**
+     * Returns the request used to access the resource depending on the protocol.
+     * This is used mainly for POST requests.
+     *
+     * <div class="note"><b>Example:</b>
+     * {@preformat xml
+     *     <GetFeature service="WFS" version="2.0.0"
+     *                 outputFormat="application/gml+xml;verson=3.2"
+     *                 xmlns="(…snip…)">
+     *         <Query typeNames="Roads"/>
+     *     </GetFeature>
+     * }
+     * </div>
+     *
+     * @return Request used to access the resource.
+     *
+     * @since 0.5
+     */
+    @Override
+    public String getProtocolRequest() {
+        return protocolRequest;
+    }
+
+    /**
+     * Sets the request to be used.
+     *
+     * @param newValue The new request, or {@code null} if none.
+     *
+     * @since 0.5
+     */
+    public void setProtocolRequest(final String newValue) {
+        checkWritePermission();
+        protocolRequest = newValue;
+    }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -62,7 +62,7 @@ public final strictfp class NameMapTest 
             new SimpleEntry<String,String>("presentationForm",      "presentationForms"),
             new SimpleEntry<String,String>("series",                "series"),
             new SimpleEntry<String,String>("otherCitationDetails",  "otherCitationDetails"),
-            new SimpleEntry<String,String>("collectiveTitle",       "collectiveTitle"),
+//          new SimpleEntry<String,String>("collectiveTitle",       "collectiveTitle"),
 -- deprecated as of ISO 19115:2014
             new SimpleEntry<String,String>("ISBN",                  "ISBN"),
             new SimpleEntry<String,String>("ISSN",                  "ISSN"),
             new SimpleEntry<String,String>("graphic",               "graphics"),

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -180,8 +180,8 @@ public final strictfp class PropertyAcce
             Citation.class, "getCitedResponsibleParties", "citedResponsibleParties", "citedResponsibleParty",
"Cited responsible parties",  Responsibility[].class,
             Citation.class, "getPresentationForms",       "presentationForms",       "presentationForm",
     "Presentation forms",         PresentationForm[].class,
             Citation.class, "getSeries",                  "series",                  "series",
               "Series",                     Series.class,
-            Citation.class, "getOtherCitationDetails",    "otherCitationDetails",    "otherCitationDetails",
 "Other citation details",     InternationalString.class,
-            Citation.class, "getCollectiveTitle",         "collectiveTitle",         "collectiveTitle",
      "Collective title",           InternationalString.class,
+            Citation.class, "getOtherCitationDetails",    "otherCitationDetails",    "otherCitationDetails",
 "Other citation details",     InternationalString[].class,
+//          Citation.class, "getCollectiveTitle",         "collectiveTitle",         "collectiveTitle",
      "Collective title",           InternationalString.class,   -- deprecated as of ISO 19115:2014
             Citation.class, "getISBN",                    "ISBN",                    "ISBN",
                 "ISBN",                       String.class,
             Citation.class, "getISSN",                    "ISSN",                    "ISSN",
                 "ISSN",                       String.class,
             Citation.class, "getGraphics",                "graphics",                "graphic",
              "Graphics",                   BrowseGraphic[].class,
@@ -647,6 +647,6 @@ public final strictfp class PropertyAcce
     @Test
     public void testToString() {
         final PropertyAccessor accessor = createPropertyAccessor();
-        assertEquals("PropertyAccessor[15 getters & 15 setters in DefaultCitation:Citation
from “ISO 19115”]", accessor.toString());
+        assertEquals("PropertyAccessor[14 getters (+1 ext.) & 15 setters in DefaultCitation:Citation
from “ISO 19115”]", accessor.toString());
     }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -32,6 +32,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.TestUtilities.createRandomNumberGenerator;
 
 
@@ -65,7 +66,7 @@ public final strictfp class TreeNodeChil
     static DefaultCitation metadataWithoutCollections() {
         final DefaultCitation citation = new DefaultCitation("Some title");
         citation.setEdition(new SimpleInternationalString("Some edition"));
-        citation.setOtherCitationDetails(new SimpleInternationalString("Some other details"));
+        citation.setOtherCitationDetails(singleton(new SimpleInternationalString("Some other
details")));
         return citation;
     }
 
@@ -308,7 +309,7 @@ public final strictfp class TreeNodeChil
             "PresentationForm[MAP_HARDCOPY]",
             null, // series
             "Some other details",
-            null, // collective title
+//          null, // collective title  -- deprecated as of ISO 19115:2014.
             null, // ISBN
             null, // ISSN
             null, // onlineResources (collection)

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -251,7 +251,7 @@ public final strictfp class TreeNodeTest
                 null,       // role
               ZERO,         // presentationForm
               ONE,          // presentationForm
-              null);        // otherCitationDetails
+              ZERO);        // otherCitationDetails
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TypeMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TypeMapTest.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TypeMapTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TypeMapTest.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -74,7 +74,7 @@ public final strictfp class TypeMapTest 
             new SimpleEntry<String,Class<?>>("presentationForm",      PresentationForm.class),
             new SimpleEntry<String,Class<?>>("series",                Series.class),
             new SimpleEntry<String,Class<?>>("otherCitationDetails",  InternationalString.class),
-            new SimpleEntry<String,Class<?>>("collectiveTitle",       InternationalString.class),
+//          new SimpleEntry<String,Class<?>>("collectiveTitle",       InternationalString.class),
 -- deprecated as of ISO 19115:2014
             new SimpleEntry<String,Class<?>>("ISBN",                  String.class),
             new SimpleEntry<String,Class<?>>("ISSN",                  String.class),
             new SimpleEntry<String,Class<?>>("graphic",               BrowseGraphic.class),

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -23,7 +23,8 @@ import org.opengis.metadata.Identifier;
 import org.apache.sis.xml.NilReason;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
-import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty;
+import org.apache.sis.metadata.iso.citation.DefaultIndividual;
+import org.apache.sis.metadata.iso.citation.DefaultResponsibility;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -66,7 +67,7 @@ public final strictfp class ValueMapTest
     /**
      * The author of the metadata instance created by {@link #createCitation()}.
      */
-    private DefaultResponsibleParty author;
+    private DefaultResponsibility author;
 
     /**
      * Creates the metadata instance to be used for testing purpose.
@@ -89,9 +90,9 @@ public final strictfp class ValueMapTest
      */
     private Map<String,Object> createCitation() {
         title    = new SimpleInternationalString("Undercurrent");
-        author   = new DefaultResponsibleParty();
+        author   = new DefaultResponsibility();
         citation = new DefaultCitation(title);
-        author.setIndividualName("Testsuya Toyoda");
+        author.setParties(singleton(new DefaultIndividual("Testsuya Toyoda", null, null)));
         citation.getCitedResponsibleParties().add(author);
         citation.setISBN("9782505004509");
         citation.setEdition(NilReason.UNKNOWN.createNilObject(InternationalString.class));
@@ -170,6 +171,7 @@ public final strictfp class ValueMapTest
             new SimpleEntry<String,Object>("identifiers",             citation.getIdentifiers()),
             new SimpleEntry<String,Object>("citedResponsibleParties", singletonList(author)),
             new SimpleEntry<String,Object>("presentationForms",       emptySet()),
+            new SimpleEntry<String,Object>("otherCitationDetails",    emptyList()),
             new SimpleEntry<String,Object>("ISBN",                    "9782505004509"),
             new SimpleEntry<String,Object>("graphics",                emptyList()),
             new SimpleEntry<String,Object>("onlineResources",         emptyList())
@@ -200,6 +202,7 @@ public final strictfp class ValueMapTest
             new SimpleEntry<String,Object>("identifiers",             citation.getIdentifiers()),
             new SimpleEntry<String,Object>("citedResponsibleParties", singletonList(author)),
             new SimpleEntry<String,Object>("presentationForms",       emptySet()),
+            new SimpleEntry<String,Object>("otherCitationDetails",    emptyList()),
             new SimpleEntry<String,Object>("ISBN",                    "9782505004509"),
             new SimpleEntry<String,Object>("graphics",                emptyList()),
             new SimpleEntry<String,Object>("onlineResources",         emptyList())
@@ -230,8 +233,8 @@ public final strictfp class ValueMapTest
             new SimpleEntry<String,Object>("citedResponsibleParties", singletonList(author)),
             new SimpleEntry<String,Object>("presentationForms",       emptySet()),
             new SimpleEntry<String,Object>("series",                  null),
-            new SimpleEntry<String,Object>("otherCitationDetails",    null),
-            new SimpleEntry<String,Object>("collectiveTitle",         null),
+            new SimpleEntry<String,Object>("otherCitationDetails",    emptyList()),
+//          new SimpleEntry<String,Object>("collectiveTitle",         null),  -- deprecated
as of ISO 19115:2014.
             new SimpleEntry<String,Object>("ISBN",                    "9782505004509"),
             new SimpleEntry<String,Object>("ISSN",                    null),
             new SimpleEntry<String,Object>("graphics",                emptyList()),

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -89,12 +89,13 @@ public class SimpleCitation implements C
     @Override public Collection<Responsibility>       getCitedResponsibleParties()
{return Collections.emptyList();}
     @Override public Collection<PresentationForm>     getPresentationForms()      
{return Collections.emptyList();}
     @Override public Series                           getSeries()                  {return
null;}
-    @Override public InternationalString              getOtherCitationDetails()    {return
null;}
-    @Override public InternationalString              getCollectiveTitle()         {return
null;}
+    @Override public Collection<InternationalString>  getOtherCitationDetails()   
{return Collections.emptyList();}
     @Override public String                           getISBN()                    {return
null;}
     @Override public String                           getISSN()                    {return
null;}
     @Override public Collection<OnlineResource>       getOnlineResources()        
{return Collections.emptyList();}
     @Override public Collection<BrowseGraphic>        getGraphics()               
{return Collections.emptyList();}
+    @Deprecated
+    @Override public InternationalString              getCollectiveTitle()         {return
null;}
 
     /**
      * Compares the given object with this citation for equality.

Modified: sis/branches/JDK6/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/pom.xml?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/pom.xml (original)
+++ sis/branches/JDK6/pom.xml Wed Aug 13 17:17:50 2014
@@ -234,6 +234,12 @@ Apache SIS is a free software, Java lang
       </roles>
     </contributor>
     <contributor>
+      <name>Christina Hough</name>
+      <roles>
+        <role>translator</role>
+      </roles>
+    </contributor>
+    <contributor>
       <name>Gregory D. Reddin</name>
       <!-- id>greddin</id -->
       <roles>

Modified: sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1617769&r1=1617768&r2=1617769&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
[UTF-8] Wed Aug 13 17:17:50 2014
@@ -71,6 +71,7 @@ import org.apache.sis.internal.metadata.
 // Consequently the compiled class files should not have this dependency.
 import ucar.nc2.constants.CF;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.storage.netcdf.AttributeNames.*;
 
 
@@ -281,7 +282,7 @@ final class MetadataReader {
     private static Address createAddress(final String email) {
         if (email != null) {
             final DefaultAddress address = new DefaultAddress();
-            address.getElectronicMailAddresses().add(email);
+            address.setElectronicMailAddresses(singleton(email));
             return address;
         }
         return null;
@@ -293,8 +294,8 @@ final class MetadataReader {
     private static Contact createContact(final Address address, final OnlineResource url)
{
         if (address != null || url != null) {
             final DefaultContact contact = new DefaultContact();
-            contact.setAddress(address);
-            contact.setOnlineResource(url);
+            if (address != null) contact.setAddresses(singleton(address));
+            if (url     != null) contact.setOnlineResources(singleton(url));
             return contact;
         }
         return null;
@@ -424,18 +425,18 @@ final class MetadataReader {
         final String references = decoder.stringValue(REFERENCES);
         final DefaultCitation citation = new DefaultCitation(title);
         if (identifier != null) {
-            citation.getIdentifiers().add(identifier);
+            citation.setIdentifiers(singleton(identifier));
         }
-        if (creation != null) citation.getDates().add(new DefaultCitationDate(creation, DateType.CREATION));
-        if (modified != null) citation.getDates().add(new DefaultCitationDate(modified, DateType.REVISION));
-        if (issued   != null) citation.getDates().add(new DefaultCitationDate(issued,   DateType.PUBLICATION));
+        if (creation != null) citation.setDates(singleton(new DefaultCitationDate(creation,
DateType.CREATION)));
+        if (modified != null) citation.getDates()  .add  (new DefaultCitationDate(modified,
DateType.REVISION));
+        if (issued   != null) citation.getDates()  .add  (new DefaultCitationDate(issued,
  DateType.PUBLICATION));
         if (pointOfContact != null) {
             // Same responsible party than the contact, except for the role.
             final DefaultResponsibleParty np = new DefaultResponsibleParty(Role.ORIGINATOR);
             np.setIndividualName  (pointOfContact.getIndividualName());
             np.setOrganisationName(pointOfContact.getOrganisationName());
             np.setContactInfo     (pointOfContact.getContactInfo());
-            citation.getCitedResponsibleParties().add(np);
+            citation.setCitedResponsibleParties(singleton(np));
         }
         for (final String path : searchPath) {
             decoder.setSearchPath(path);
@@ -445,7 +446,9 @@ final class MetadataReader {
             }
         }
         decoder.setSearchPath(searchPath);
-        citation.setOtherCitationDetails(toInternationalString(references));
+        if (references != null) {
+            citation.setOtherCitationDetails(singleton(toInternationalString(references)));
+        }
         return citation.isEmpty() ? null : citation;
     }
 
@@ -499,7 +502,7 @@ final class MetadataReader {
                     // Takes only ONE extent, because a NetCDF file may declare many time
the same
                     // extent with different precision. The groups are ordered in such a
way that
                     // the first extent should be the most accurate one.
-                    identification.getExtents().add(extent);
+                    identification.setExtents(singleton(extent));
                     hasExtent = true;
                 }
             }
@@ -519,7 +522,7 @@ final class MetadataReader {
         identification.setAbstract(toInternationalString(summary));
         identification.setPurpose (toInternationalString(purpose));
         if (pointOfContact != null) {
-            identification.getPointOfContacts().add(pointOfContact);
+            identification.setPointOfContacts(singleton(pointOfContact));
         }
         addKeywords(identification, project,   "project"); // Not necessarily the same string
than PROJECT.
         addKeywords(identification, publisher, "dataCenter");
@@ -641,7 +644,7 @@ final class MetadataReader {
             if (extent == null) {
                 extent = new DefaultExtent();
             }
-            extent.getVerticalElements().add(new DefaultVerticalExtent(min, max, VERTICAL_CRS));
+            extent.setVerticalElements(singleton(new DefaultVerticalExtent(min, max, VERTICAL_CRS)));
         }
         /*
          * Get the start and end times as Date objects if available, or as numeric values
otherwise.
@@ -672,7 +675,7 @@ final class MetadataReader {
             if (extent == null) {
                 extent = new DefaultExtent();
             }
-            extent.getTemporalElements().add(t);
+            extent.setTemporalElements(singleton(t));
         } catch (UnsupportedOperationException e) {
             decoder.listeners.warning(null, e);
         }
@@ -684,7 +687,7 @@ final class MetadataReader {
             if (extent == null) {
                 extent = new DefaultExtent();
             }
-            extent.getGeographicElements().add(new DefaultGeographicDescription(null, identifier));
+            extent.setGeographicElements(singleton(new DefaultGeographicDescription(null,
identifier)));
         }
         return extent;
     }
@@ -850,7 +853,7 @@ final class MetadataReader {
             metadata.setFileIdentifier(code);
         }
         metadata.setDateStamp(decoder.dateValue(METADATA_CREATION));
-        metadata.getHierarchyLevels().add(ScopeCode.DATASET);
+        metadata.setHierarchyLevels(singleton(ScopeCode.DATASET));
         final String wms = decoder.stringValue("wms_service");
         final String wcs = decoder.stringValue("wcs_service");
         if (wms != null || wcs != null) {
@@ -906,7 +909,7 @@ final class MetadataReader {
          */
         final DataIdentification identification = createIdentificationInfo(identifier, publisher);
         if (identification != null) {
-            metadata.getIdentificationInfo().add(identification);
+            metadata.setIdentificationInfo(singleton(identification));
         }
         metadata.setContentInfo(createContentInfo());
         /*



Mime
View raw message