sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1466833 - in /sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis: internal/jaxb/metadata/MD_Identifier.java internal/jaxb/metadata/RS_Identifier.java metadata/iso/UnmodifiableIdentifier.java referencing/
Date Thu, 11 Apr 2013 10:44:55 GMT
Author: desruisseaux
Date: Thu Apr 11 10:44:55 2013
New Revision: 1466833

URL: http://svn.apache.org/r1466833
Log:
Moved DefaultReferenceIdentifier from org.apache.sis.referencing to org.apache.sis.metadata.iso.
We have to make this move because OSGi will not allow different modules to use the same package.
Renamed to UnmodifiableIdentifier in this process in order to better differentiate this class
from the other "Default*" class in the metadata packages.

Added:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/UnmodifiableIdentifier.java
      - copied, changed from r1466650, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/referencing/DefaultReferenceIdentifier.java
Removed:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/referencing/
Modified:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java?rev=1466833&r1=1466832&r2=1466833&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
[UTF-8] Thu Apr 11 10:44:55 2013
@@ -23,7 +23,7 @@ import org.opengis.metadata.Identifier;
 import org.opengis.referencing.ReferenceIdentifier;
 
 import org.apache.sis.metadata.iso.DefaultIdentifier;
-import org.apache.sis.referencing.DefaultReferenceIdentifier;
+import org.apache.sis.metadata.iso.UnmodifiableIdentifier;
 import org.apache.sis.internal.jaxb.gco.PropertyType;
 
 
@@ -107,15 +107,15 @@ public final class MD_Identifier extends
      * @return The metadata to be marshalled.
      */
     @XmlElement(name = "RS_Identifier")
-    public DefaultReferenceIdentifier getReferenceIdentifier() {
+    public UnmodifiableIdentifier getReferenceIdentifier() {
         if (skip()) return null;
         final Identifier metadata = this.metadata;
         if (!(metadata instanceof ReferenceIdentifier)) {
             return null;
         }
-        return (metadata instanceof DefaultReferenceIdentifier) ?
-            (DefaultReferenceIdentifier) metadata :
-            new DefaultReferenceIdentifier((ReferenceIdentifier) metadata);
+        return (metadata instanceof UnmodifiableIdentifier) ?
+            (UnmodifiableIdentifier) metadata :
+            new UnmodifiableIdentifier((ReferenceIdentifier) metadata);
     }
 
     /**
@@ -123,7 +123,7 @@ public final class MD_Identifier extends
      *
      * @param metadata The unmarshalled metadata.
      */
-    public void setReferenceIdentifier(final DefaultReferenceIdentifier metadata) {
+    public void setReferenceIdentifier(final UnmodifiableIdentifier metadata) {
         this.metadata = metadata;
     }
 }

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java?rev=1466833&r1=1466832&r2=1466833&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_Identifier.java
[UTF-8] Thu Apr 11 10:44:55 2013
@@ -18,7 +18,7 @@ package org.apache.sis.internal.jaxb.met
 
 import javax.xml.bind.annotation.XmlElementRef;
 import org.opengis.referencing.ReferenceIdentifier;
-import org.apache.sis.referencing.DefaultReferenceIdentifier;
+import org.apache.sis.metadata.iso.UnmodifiableIdentifier;
 import org.apache.sis.internal.jaxb.gco.PropertyType;
 
 
@@ -81,13 +81,13 @@ public final class RS_Identifier extends
      * @return The metadata to be marshalled.
      */
     @XmlElementRef
-    public DefaultReferenceIdentifier getElement() {
+    public UnmodifiableIdentifier getElement() {
         if (skip()) return null;
         final ReferenceIdentifier metadata = this.metadata;
-        if (metadata instanceof DefaultReferenceIdentifier) {
-            return (DefaultReferenceIdentifier) metadata;
+        if (metadata instanceof UnmodifiableIdentifier) {
+            return (UnmodifiableIdentifier) metadata;
         } else {
-            return new DefaultReferenceIdentifier(metadata);
+            return new UnmodifiableIdentifier(metadata);
         }
     }
 
@@ -96,7 +96,7 @@ public final class RS_Identifier extends
      *
      * @param metadata The unmarshalled metadata.
      */
-    public void setElement(final DefaultReferenceIdentifier metadata) {
+    public void setElement(final UnmodifiableIdentifier metadata) {
         this.metadata = metadata;
     }
 }

Copied: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/UnmodifiableIdentifier.java
(from r1466650, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/referencing/DefaultReferenceIdentifier.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/UnmodifiableIdentifier.java?p2=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/UnmodifiableIdentifier.java&p1=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/referencing/DefaultReferenceIdentifier.java&r1=1466650&r2=1466833&rev=1466833&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/referencing/DefaultReferenceIdentifier.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/UnmodifiableIdentifier.java
[UTF-8] Thu Apr 11 10:44:55 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.referencing;
+package org.apache.sis.metadata.iso;
 
 import java.util.Map;
 import java.util.Locale;
@@ -30,7 +30,6 @@ import org.opengis.metadata.citation.Cit
 import org.opengis.parameter.InvalidParameterValueException;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.opengis.util.InternationalString;
-import org.apache.sis.xml.Namespaces;
 import org.apache.sis.util.Deprecable;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.logging.Logging;
@@ -51,7 +50,9 @@ import java.util.Objects;
 
 
 /**
- * An identification of a {@link org.opengis.referencing.crs.CoordinateReferenceSystem} object.
+ * Unmodifiable value uniquely identifying an object within a namespace, together with a
version.
+ * This kind of identifier is primarily used for identification of
+ * {@link org.opengis.referencing.crs.CoordinateReferenceSystem} objects.
  *
  * @author Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.03)
@@ -59,8 +60,8 @@ import java.util.Objects;
  * @module
  */
 @Immutable
-@XmlRootElement(name = "RS_Identifier", namespace = Namespaces.GMD)
-public class DefaultReferenceIdentifier implements ReferenceIdentifier, Deprecable, Serializable
{
+@XmlRootElement(name = "RS_Identifier")
+public class UnmodifiableIdentifier implements ReferenceIdentifier, Deprecable, Serializable
{
     /**
      * For cross-version compatibility.
      */
@@ -71,7 +72,7 @@ public class DefaultReferenceIdentifier 
      *
      * @see #getCode()
      */
-    @XmlElement(required = true, namespace = Namespaces.GMD)
+    @XmlElement(required = true)
     @XmlJavaTypeAdapter(StringAdapter.class)
     private final String code;
 
@@ -81,7 +82,7 @@ public class DefaultReferenceIdentifier 
      *
      * @see #getCodeSpace()
      */
-    @XmlElement(required = true, namespace = Namespaces.GMD)
+    @XmlElement(required = true)
     @XmlJavaTypeAdapter(StringAdapter.class)
     private final String codeSpace;
 
@@ -91,7 +92,7 @@ public class DefaultReferenceIdentifier 
      *
      * @see #getAuthority()
      */
-    @XmlElement(required = true, namespace = Namespaces.GMD)
+    @XmlElement(required = true)
     @XmlJavaTypeAdapter(CI_Citation.class)
     private final Citation authority;
 
@@ -104,20 +105,20 @@ public class DefaultReferenceIdentifier 
      *
      * @see #getVersion()
      */
-    @XmlElement(namespace = Namespaces.GMD)
+    @XmlElement
     private final String version;
 
     /**
      * Comments on or information about this identifier, or {@code null} if none.
      *
-     * @see #getRemarks
+     * @see #getRemarks()
      */
     private final InternationalString remarks;
 
     /**
      * Empty constructor for JAXB.
      */
-    private DefaultReferenceIdentifier() {
+    private UnmodifiableIdentifier() {
         code      = null;
         codeSpace = null;
         authority = null;
@@ -132,14 +133,14 @@ public class DefaultReferenceIdentifier 
      *
      * @param identifier The identifier to copy.
      */
-    public DefaultReferenceIdentifier(final ReferenceIdentifier identifier) {
+    public UnmodifiableIdentifier(final ReferenceIdentifier identifier) {
         ensureNonNull("identifier", identifier);
         code      = identifier.getCode();
         codeSpace = identifier.getCodeSpace();
         authority = identifier.getAuthority();
         version   = identifier.getVersion();
-        if (identifier instanceof DefaultReferenceIdentifier) {
-            remarks = ((DefaultReferenceIdentifier) identifier).getRemarks();
+        if (identifier instanceof UnmodifiableIdentifier) {
+            remarks = ((UnmodifiableIdentifier) identifier).getRemarks();
         } else {
             remarks = null;
         }
@@ -158,7 +159,7 @@ public class DefaultReferenceIdentifier 
      *          Identifier code or name, optionally from a controlled list or pattern defined
by
      *          a code space. The code can not be null.
      */
-    public DefaultReferenceIdentifier(final Citation authority, final String codeSpace, final
String code) {
+    public UnmodifiableIdentifier(final Citation authority, final String codeSpace, final
String code) {
         this(authority, codeSpace, code, null, null);
     }
 
@@ -181,7 +182,7 @@ public class DefaultReferenceIdentifier 
      * @param remarks
      *          Comments on or information about this identifier, or {@code null} if none.
      */
-    public DefaultReferenceIdentifier(final Citation authority, final String codeSpace,
+    public UnmodifiableIdentifier(final Citation authority, final String codeSpace,
             final String code, final String version, final InternationalString remarks)
     {
         ensureNonNull("code", code);
@@ -240,7 +241,7 @@ public class DefaultReferenceIdentifier 
      * @throws InvalidParameterValueException if a property has an invalid value.
      * @throws IllegalArgumentException if a property is invalid for some other reason.
      */
-    public DefaultReferenceIdentifier(final Map<String,?> properties) throws IllegalArgumentException
{
+    public UnmodifiableIdentifier(final Map<String,?> properties) throws IllegalArgumentException
{
         this(properties, true);
     }
 
@@ -256,7 +257,7 @@ public class DefaultReferenceIdentifier 
      * @throws InvalidParameterValueException if a property has an invalid value.
      * @throws IllegalArgumentException if a property is invalid for some other reason.
      */
-    DefaultReferenceIdentifier(final Map<String,?> properties, final boolean standalone)
+    UnmodifiableIdentifier(final Map<String,?> properties, final boolean standalone)
             throws IllegalArgumentException
     {
         ensureNonNull("properties", properties);
@@ -338,7 +339,7 @@ public class DefaultReferenceIdentifier 
             if (remarks == null) {
                 remarks = localized;
             } else {
-                Logging.log(DefaultReferenceIdentifier.class, "<init>",
+                Logging.log(UnmodifiableIdentifier.class, "<init>",
                     Messages.getResources(null).getLogRecord(Level.WARNING, Messages.Keys.LocalesDiscarded));
             }
         }
@@ -474,8 +475,8 @@ public class DefaultReferenceIdentifier 
     /**
      * Returns {@code true} if the object represented by this identifier is deprecated. In
such
      * case, the {@linkplain #getRemarks() remarks} may contains the new identifier to use.
-     * <p>
-     * The default implementation returns {@code false} in all cases.
+     *
+     * <p>The default implementation returns {@code false} in all cases.</p>
      *
      * @see AbstractIdentifiedObject#isDeprecated()
      *
@@ -513,7 +514,7 @@ public class DefaultReferenceIdentifier 
             return true;
         }
         if (object != null && object.getClass() == getClass()) {
-            final DefaultReferenceIdentifier that = (DefaultReferenceIdentifier) object;
+            final UnmodifiableIdentifier that = (UnmodifiableIdentifier) object;
             return Objects.equals(code,      that.code)      &&
                    Objects.equals(codeSpace, that.codeSpace) &&
                    Objects.equals(authority, that.authority) &&



Mime
View raw message