sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1617580 - in /sis/branches/JDK8/core/sis-metadata/src: main/java/org/apache/sis/metadata/ main/java/org/apache/sis/metadata/iso/ main/java/org/apache/sis/metadata/iso/extent/ main/java/org/apache/sis/metadata/iso/service/ test/java/org/apa...
Date Tue, 12 Aug 2014 20:29:48 GMT
Author: desruisseaux
Date: Tue Aug 12 20:29:48 2014
New Revision: 1617580

URL: http://svn.apache.org/r1617580
Log:
Updates for GeoAPI changes (review upgrade to ISO 19115:2014).

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultCoupledResource.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationChainMetadata.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyInformation.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -55,7 +55,7 @@ import org.apache.sis.util.logging.Loggi
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.05)
- * @version 0.3
+ * @version 0.5
  * @module
  *
  * @see InformationMap
@@ -319,9 +319,18 @@ final class PropertyInformation<E> exten
     }
 
     /**
+     * Unconditionally returns {@code null}.
+     */
+    @Override
+    public InternationalString getRationale() {
+        return null;
+    }
+
+    /**
      * Unconditionally returns an empty list.
      */
     @Override
+    @Deprecated
     public Collection<InternationalString> getRationales() {
         return Collections.emptyList();
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -16,12 +16,12 @@
  */
 package org.apache.sis.metadata.iso;
 
-import java.net.URI;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.metadata.ApplicationSchemaInformation;
 import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.OnlineResource;
 
 
 /**
@@ -40,16 +40,16 @@ import org.opengis.metadata.citation.Cit
  * @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 = "MD_ApplicationSchemaInformation_Type", propOrder = {
     "name",
     "schemaLanguage",
     "constraintLanguage",
-    "schemaAscii",
-    "graphicsFile",
-    "softwareDevelopmentFile",
+/// "schemaAscii",
+/// "graphicsFile",
+/// "softwareDevelopmentFile",
     "softwareDevelopmentFileFormat"
 })
 @XmlRootElement(name = "MD_ApplicationSchemaInformation")
@@ -59,7 +59,7 @@ public class DefaultApplicationSchemaInf
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -884081423040392985L;
+    private static final long serialVersionUID = 5667352094985433121L;
 
     /**
      * Name of the application schema used.
@@ -79,17 +79,17 @@ public class DefaultApplicationSchemaInf
     /**
      * Full application schema given as an ASCII file.
      */
-    private URI schemaAscii;
+    private CharSequence schemaAscii;
 
     /**
      * Full application schema given as a graphics file.
      */
-    private URI graphicsFile;
+    private OnlineResource graphicsFile;
 
     /**
      * Full application schema given as a software development file.
      */
-    private URI softwareDevelopmentFile;
+    private OnlineResource softwareDevelopmentFile;
 
     /**
      * Software dependent format used for the application schema software dependent file.
@@ -234,8 +234,8 @@ public class DefaultApplicationSchemaInf
      * @return Application schema as an ASCII file, or {@code null}.
      */
     @Override
-    @XmlElement(name = "schemaAscii")
-    public URI getSchemaAscii()  {
+/// @XmlElement(name = "schemaAscii")
+    public CharSequence getSchemaAscii()  {
         return schemaAscii;
     }
 
@@ -244,7 +244,7 @@ public class DefaultApplicationSchemaInf
      *
      * @param newValue The new ASCII file.
      */
-    public void setSchemaAscii(final URI newValue) {
+    public void setSchemaAscii(final CharSequence newValue) {
         checkWritePermission();
         schemaAscii = newValue;
     }
@@ -255,8 +255,8 @@ public class DefaultApplicationSchemaInf
      * @return Application schema as a graphics file, or {@code null}.
      */
     @Override
-    @XmlElement(name = "graphicsFile")
-    public URI getGraphicsFile()  {
+/// @XmlElement(name = "graphicsFile")
+    public OnlineResource getGraphicsFile()  {
         return graphicsFile;
     }
 
@@ -265,7 +265,7 @@ public class DefaultApplicationSchemaInf
      *
      * @param newValue The new graphics file.
      */
-    public void setGraphicsFile(final URI newValue) {
+    public void setGraphicsFile(final OnlineResource newValue) {
         checkWritePermission();
         graphicsFile = newValue;
     }
@@ -276,8 +276,8 @@ public class DefaultApplicationSchemaInf
      * @return Application schema as a software development file, or {@code null}.
      */
     @Override
-    @XmlElement(name = "softwareDevelopmentFile")
-    public URI getSoftwareDevelopmentFile()  {
+/// @XmlElement(name = "softwareDevelopmentFile")
+    public OnlineResource getSoftwareDevelopmentFile()  {
         return softwareDevelopmentFile;
     }
 
@@ -286,7 +286,7 @@ public class DefaultApplicationSchemaInf
      *
      * @param newValue The new software development file.
      */
-    public void setSoftwareDevelopmentFile(final URI newValue) {
+    public void setSoftwareDevelopmentFile(final OnlineResource newValue) {
         checkWritePermission();
         softwareDevelopmentFile = newValue;
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -16,7 +16,9 @@
  */
 package org.apache.sis.metadata.iso;
 
+import java.util.AbstractSet;
 import java.util.Collection;
+import java.util.Iterator;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -28,10 +30,12 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.iso.Types;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
 
 /**
  * New metadata element, not found in ISO 19115, which is required to describe geographic
data.
+ * Metadata elements are contained in a {@linkplain DefaultMetadataExtensionInformation metadata
extension information}.
  *
  * <p><b>Limitations:</b></p>
  * <ul>
@@ -71,7 +75,7 @@ public class DefaultExtendedElementInfor
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = 5892811836634834434L;
+    private static final long serialVersionUID = 489138542195499530L;
 
     /**
      * Name of the extended metadata element.
@@ -144,7 +148,7 @@ public class DefaultExtendedElementInfor
     /**
      * Reason for creating the extended element.
      */
-    private Collection<InternationalString> rationales;
+    private InternationalString rationale;
 
     /**
      * Name of the person or organization creating the extended element.
@@ -194,6 +198,7 @@ public class DefaultExtendedElementInfor
      *
      * @see #castOrCopy(ExtendedElementInformation)
      */
+    @SuppressWarnings("deprecation")
     public DefaultExtendedElementInformation(final ExtendedElementInformation object) {
         super(object);
         if (object != null) {
@@ -208,7 +213,7 @@ public class DefaultExtendedElementInfor
             domainValue       = object.getDomainValue();
             parentEntity      = copyCollection(object.getParentEntity(), String.class);
             rule              = object.getRule();
-            rationales        = copyCollection(object.getRationales(), InternationalString.class);
+            rationale         = object.getRationale();
             sources           = copyCollection(object.getSources(), Responsibility.class);
         }
     }
@@ -263,8 +268,11 @@ public class DefaultExtendedElementInfor
      * Short form suitable for use in an implementation method such as XML or SGML.
      *
      * @return Short form suitable for use in an implementation method such as XML or SGML,
or {@code null}.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "shortName")
     public String getShortName()  {
         return shortName;
@@ -274,7 +282,10 @@ public class DefaultExtendedElementInfor
      * Sets a short form suitable for use in an implementation method such as XML or SGML.
      *
      * @param newValue The new short name.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
+    @Deprecated
     public void setShortName(final String newValue)  {
         checkWritePermission();
         shortName = newValue;
@@ -286,8 +297,11 @@ public class DefaultExtendedElementInfor
      * is {@linkplain Datatype#CODE_LIST_ELEMENT code list element}.
      *
      * @return Three digit code assigned to the extended element, or {@code null}.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
     @Override
+    @Deprecated
     @XmlElement(name = "domainCode")
     public Integer getDomainCode() {
         return domainCode;
@@ -297,7 +311,10 @@ public class DefaultExtendedElementInfor
      * Sets a three digit code assigned to the extended element.
      *
      * @param newValue The new domain code.
+     *
+     * @deprecated Removed as of ISO 19115:2014.
      */
+    @Deprecated
     public void setDomainCode(final Integer newValue) {
         checkWritePermission();
         domainCode = newValue;
@@ -490,20 +507,69 @@ public class DefaultExtendedElementInfor
      * Reason for creating the extended element.
      *
      * @return Reason for creating the extended element.
+     *
+     * @since 0.5
      */
     @Override
+    public InternationalString getRationale() {
+        return rationale;
+    }
+
+    /**
+     * Sets the reason for creating the extended element.
+     *
+     * @param newValue The new rationale.
+     *
+     * @since 0.5
+     */
+    public void setRationale(final InternationalString newValue) {
+        checkWritePermission();
+        rationale = newValue;
+    }
+
+    /**
+     * @deprecated As of ISO 19115:2014, replaced by {@link #getRationale()}.
+     *
+     * @return Reason for creating the extended element.
+     */
+    @Override
+    @Deprecated
     @XmlElement(name = "rationale")
     public Collection<InternationalString> getRationales() {
-        return rationales = nonNullCollection(rationales, InternationalString.class);
+        return new AbstractSet<InternationalString>() {
+            /** Returns 0 if empty, or 1 if a density has been specified. */
+            @Override public int size() {
+                return getRationale() != null ? 1 : 0;
+            }
+
+            /** Returns an iterator over 0 or 1 element. Current iterator implementation
is unmodifiable. */
+            @Override public Iterator<InternationalString> iterator() {
+                return LegacyPropertyAdapter.asCollection(getRationale()).iterator();
+            }
+
+            /** Adds an element only if the set is empty. This method is invoked by JAXB
at unmarshalling time. */
+            @Override public boolean add(final InternationalString newValue) {
+                if (isEmpty()) {
+                    setRationale(newValue);
+                    return true;
+                } else {
+                    LegacyPropertyAdapter.warnIgnoredExtraneous(InternationalString.class,
+                            DefaultExtendedElementInformation.class, "setRationales");
+                    return false;
+                }
+            }
+        };
     }
 
     /**
-     * Sets the reason for creating the extended element.
+     * @deprecated As of ISO 19115:2014, replaced by {@link #setRationale(InternationalString)}.
      *
      * @param newValues The new rationales.
      */
+    @Deprecated
     public void setRationales(final Collection<? extends InternationalString> newValues)
{
-        rationales = writeCollection(newValues, rationales, InternationalString.class);
+        setRationale(LegacyPropertyAdapter.getSingleton(newValues, InternationalString.class,
+                null, DefaultExtendedElementInformation.class, "setRationales"));
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -119,7 +119,7 @@ public class DefaultMetadataExtensionInf
 
     /**
      * Information about on-line sources containing the community profile name and
-     * the extended metadata elements. Information for all new metadata elements.
+     * the extended metadata elements and information for all new metadata elements.
      *
      * @return Online sources to community profile name and extended metadata elements, or
{@code null}.
      */
@@ -140,8 +140,8 @@ public class DefaultMetadataExtensionInf
     }
 
     /**
-     * Provides information about a new metadata element, not found in ISO 19115, which is
-     * required to describe geographic data.
+     * Provides information about a new metadata element, not found in ISO 19115,
+     * which is required to describe resource.
      *
      * @return New metadata elements not found in ISO 19115.
      */

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -116,9 +116,9 @@ public class DefaultBoundingPolygon exte
     }
 
     /**
-     * Returns the sets of points defining the bounding polygon.
+     * Returns the sets of points defining the bounding polygon or other geometry.
      *
-     * @return The sets of points defining the bounding polygon.
+     * @return The sets of points defining the resource boundary.
      */
     @Override
     @XmlElement(name = "polygon", required = true)
@@ -127,9 +127,9 @@ public class DefaultBoundingPolygon exte
     }
 
     /**
-     * Sets the sets of points defining the bounding polygon.
+     * Sets the sets of points defining the resource boundary.
      *
-     * @param newValues The new polygons.
+     * @param newValues The new boundaries.
      */
     public void setPolygons(final Collection<? extends Geometry> newValues) {
         polygons = writeCollection(newValues, polygons, Geometry.class);

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultCoupledResource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultCoupledResource.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultCoupledResource.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultCoupledResource.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -23,7 +23,6 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.util.ScopedName;
-import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.identification.DataIdentification;
 import org.opengis.metadata.service.CoupledResource;
@@ -247,7 +246,7 @@ public class DefaultCoupledResource exte
      * For JAXB marhalling of ISO 19119 document only.
      */
     @XmlElement(name = "operationName")
-    final InternationalString getOperationName() {
+    final String getOperationName() {
         if (LEGACY_XML) {
             final OperationMetadata operation = getOperation();
             if (operation != null) {
@@ -262,7 +261,7 @@ public class DefaultCoupledResource exte
      * {@link OperationName} placeholder. That temporary instance will be replaced by the
real
      * one when the enclosing {@link DefaultServiceIdentification} is unmarshalled.
      */
-    final void setOperationName(final InternationalString name) {
+    final void setOperationName(final String name) {
         if (operation == null) {
             operation = new OperationName(name);
         }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationChainMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationChainMetadata.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationChainMetadata.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationChainMetadata.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.metadata.iso.service;
 
-import java.util.Collection;
+import java.util.List;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -70,7 +70,7 @@ public class DefaultOperationChainMetada
     /**
      * Information about the operations applied by the chain.
      */
-    private Collection<OperationMetadata> operations;
+    private List<OperationMetadata> operations;
 
     /**
      * Constructs an initially empty operation chain metadata.
@@ -79,16 +79,12 @@ public class DefaultOperationChainMetada
     }
 
     /**
-     * Constructs a new operation chain metadata initialized to the specified values.
+     * Constructs a new operation chain metadata initialized to the specified name.
      *
-     * @param name      The name as used by the service for this chain.
-     * @param operation Information about the operations applied by the chain.
+     * @param name The name as used by the service for this chain.
      */
-    public DefaultOperationChainMetadata(final CharSequence name,
-                                         final OperationMetadata operation)
-    {
-        this.name       = Types.toInternationalString(name);
-        this.operations = singleton(operation, OperationMetadata.class);
+    public DefaultOperationChainMetadata(final CharSequence name) {
+        this.name = Types.toInternationalString(name);
     }
 
     /**
@@ -105,7 +101,7 @@ public class DefaultOperationChainMetada
         if (object != null) {
             this.name        = object.getName();
             this.description = object.getDescription();
-            this.operations  = copyCollection(object.getOperations(), OperationMetadata.class);
+            this.operations  = copyList(object.getOperations(), OperationMetadata.class);
         }
     }
 
@@ -183,8 +179,8 @@ public class DefaultOperationChainMetada
      */
     @Override
     @XmlElement(name = "operation", required = true)
-    public Collection<OperationMetadata> getOperations() {
-        return operations = nonNullCollection(operations, OperationMetadata.class);
+    public List<OperationMetadata> getOperations() {
+        return operations = nonNullList(operations, OperationMetadata.class);
     }
 
     /**
@@ -192,7 +188,7 @@ public class DefaultOperationChainMetada
      *
      * @param newValues The new information about the operations applied by the chain.
      */
-    public void setOperations(final Collection<? extends OperationMetadata> newValues)
{
-        operations = writeCollection(newValues, operations, OperationMetadata.class);
+    public void setOperations(final List<? extends OperationMetadata> newValues) {
+        operations = writeList(newValues, operations, OperationMetadata.class);
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -27,7 +27,6 @@ import org.opengis.metadata.citation.Onl
 import org.opengis.metadata.service.DistributedComputingPlatform;
 import org.opengis.metadata.service.OperationMetadata;
 import org.opengis.metadata.service.Parameter;
-import org.apache.sis.util.iso.Types;
 
 
 /**
@@ -67,7 +66,7 @@ public class DefaultOperationMetadata ex
     /**
      * An unique identifier for this interface.
      */
-    private InternationalString operationName;
+    private String operationName;
 
     /**
      * Distributed computing platforms on which the operation has been implemented.
@@ -112,11 +111,11 @@ public class DefaultOperationMetadata ex
      * @param platform      Distributed computing platforms on which the operation has been
implemented.
      * @param connectPoint  Handle for accessing the service interface.
      */
-    public DefaultOperationMetadata(final CharSequence operationName,
+    public DefaultOperationMetadata(final String operationName,
                                     final DistributedComputingPlatform platform,
                                     final OnlineResource connectPoint)
     {
-        this.operationName                 = Types.toInternationalString(operationName);
+        this.operationName                 = operationName;
         this.distributedComputingPlatforms = singleton(platform, DistributedComputingPlatform.class);
         this.connectPoints                 = singleton(connectPoint, OnlineResource.class);
     }
@@ -175,8 +174,8 @@ public class DefaultOperationMetadata ex
      */
     @Override
     @XmlElement(name = "operationName", required = true)
-    public InternationalString getOperationName() {
-        return this.operationName;
+    public String getOperationName() {
+        return operationName;
     }
 
     /**
@@ -184,9 +183,9 @@ public class DefaultOperationMetadata ex
      *
      * @param newValue The new unique identifier for this interface.
      */
-    public void setOperationName(final InternationalString newValue) {
+    public void setOperationName(final String newValue) {
         checkWritePermission();
-        this.operationName = newValue;
+        operationName = newValue;
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -21,7 +21,6 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Locale;
 import java.io.Serializable;
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.service.CoupledResource;
@@ -49,19 +48,19 @@ final class OperationName implements Ope
     /**
      * The operation name.
      */
-    private final InternationalString operationName;
+    private final String operationName;
 
     /**
      * Creates a new placeholder for the operation of the given name.
      */
-    OperationName(final InternationalString operationName) {
+    OperationName(final String operationName) {
         this.operationName = operationName;
     }
 
     /**
      * Returns the operation name.
      */
-    @Override public InternationalString                      getOperationName()        
        {return operationName;}
+    @Override public String                                   getOperationName()        
        {return operationName;}
     @Override public InternationalString                      getInvocationName()       
        {return null;}
     @Override public InternationalString                      getOperationDescription() 
        {return null;}
     @Override public Collection<DistributedComputingPlatform> getDistributedComputingPlatforms()
{return Collections.emptySet();}
@@ -90,18 +89,16 @@ final class OperationName implements Ope
     static void resolve(final Collection<OperationMetadata> containsOperations, final
Collection<CoupledResource> coupledResources) {
         final Map<String,OperationMetadata> byName = new HashMap<>();
         for (final OperationMetadata operation : containsOperations) {
-            final InternationalString name = operation.getOperationName();
-            add(byName, name.toString(Locale.ROOT), operation);
-            add(byName, name.toString(/*default*/), operation);
+            add(byName, operation.getOperationName(), operation);
         }
         for (final CoupledResource resource : coupledResources) {
             if (resource instanceof DefaultCoupledResource) {
                 OperationMetadata operation = resource.getOperation();
                 if (operation instanceof OperationName) {
-                    final InternationalString name = operation.getOperationName();
-                    operation = byName.get(name.toString(Locale.ROOT));
+                    final String name = operation.getOperationName();
+                    operation = byName.get(name);
                     if (operation == null) {
-                        operation = byName.get(name.toString());
+                        operation = byName.get(name);
                         if (operation == null) {
                             continue;
                         }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java?rev=1617580&r1=1617579&r2=1617580&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
[UTF-8] Tue Aug 12 20:29:48 2014
@@ -20,7 +20,6 @@ import org.opengis.util.ScopedName;
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.service.DistributedComputingPlatform;
 import org.opengis.metadata.service.OperationMetadata;
-import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.xml.NilReason;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -73,7 +72,7 @@ public final strictfp class DefaultCoupl
         /*
          * If the name doesn't match, no replacement shall be done.
          */
-        final OperationName other = new OperationName(new SimpleInternationalString("Other"));
+        final OperationName other = new OperationName("Other");
         resource.setOperation(other);
         assertSame("Before resolve", other, resource.getOperation());
         OperationName.resolve(singleton(operation), singleton(resource));



Mime
View raw message