You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/10/05 08:05:28 UTC
svn commit: r1629469 [3/3] - in /sis/branches/JDK8:
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/
core/sis-metadata/src/main/java/org/apache/sis/int...
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java Sun Oct 5 06:05:27 2014
@@ -24,7 +24,7 @@ import javax.xml.bind.annotation.XmlRoot
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.opengis.referencing.datum.TemporalDatum;
import org.apache.sis.internal.jaxb.gml.UniversalTimeAdapter;
import org.apache.sis.internal.metadata.MetadataUtilities;
@@ -120,7 +120,7 @@ public class DefaultTemporalDatum extend
* </tr>
* <tr>
* <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
- * <td>{@link ReferenceIdentifier} or {@link String}</td>
+ * <td>{@link Identifier} or {@link String}</td>
* <td>{@link #getName()}</td>
* </tr>
* <tr>
@@ -130,7 +130,7 @@ public class DefaultTemporalDatum extend
* </tr>
* <tr>
* <td>{@value org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td>
- * <td>{@link ReferenceIdentifier} (optionally as array)</td>
+ * <td>{@link Identifier} (optionally as array)</td>
* <td>{@link #getIdentifiers()}</td>
* </tr>
* <tr>
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlElem
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.opengis.referencing.datum.VerticalDatum;
import org.opengis.referencing.datum.VerticalDatumType;
import org.apache.sis.io.wkt.Formatter;
@@ -120,7 +120,7 @@ public class DefaultVerticalDatum extend
* </tr>
* <tr>
* <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
- * <td>{@link ReferenceIdentifier} or {@link String}</td>
+ * <td>{@link Identifier} or {@link String}</td>
* <td>{@link #getName()}</td>
* </tr>
* <tr>
@@ -130,7 +130,7 @@ public class DefaultVerticalDatum extend
* </tr>
* <tr>
* <td>{@value org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td>
- * <td>{@link ReferenceIdentifier} (optionally as array)</td>
+ * <td>{@link Identifier} (optionally as array)</td>
* <td>{@link #getIdentifiers()}</td>
* </tr>
* <tr>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/CodeTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -18,7 +18,7 @@ package org.apache.sis.internal.jaxb.ref
import java.util.Collections;
import org.opengis.referencing.crs.GeographicCRS;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.apache.sis.metadata.iso.ImmutableIdentifier;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.metadata.iso.citation.HardCodedCitations;
@@ -39,11 +39,11 @@ import static org.junit.Assert.*;
*/
public final strictfp class CodeTest extends TestCase {
/**
- * Tests the {@link Code#Code(ReferenceIdentifier)} constructor with {@code "EPSG:4326"} identifier.
+ * Tests the {@link Code#Code(Identifier)} constructor with {@code "EPSG:4326"} identifier.
*/
@Test
public void testSimple() {
- final ReferenceIdentifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326");
+ final Identifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326");
final Code value = new Code(id);
assertEquals("codeSpace", "EPSG", value.codeSpace);
assertEquals("code", "4326", value.code);
@@ -51,7 +51,7 @@ public final strictfp class CodeTest ext
* Reverse operation. Note that the authority is lost since there is no room for that in a
* <gml:identifier> element. Current implementation sets the authority to the code space.
*/
- final ReferenceIdentifier actual = value.getIdentifier();
+ final Identifier actual = value.getIdentifier();
assertSame ("authority", Citations.EPSG, actual.getAuthority());
assertEquals("codeSpace", "EPSG", actual.getCodeSpace());
assertNull ("version", actual.getVersion());
@@ -59,12 +59,12 @@ public final strictfp class CodeTest ext
}
/**
- * Tests the {@link Code#Code(ReferenceIdentifier)} constructor with {@code "EPSG:8.3:4326"} identifier.
+ * Tests the {@link Code#Code(Identifier)} constructor with {@code "EPSG:8.3:4326"} identifier.
*/
@Test
@DependsOnMethod("testSimple")
public void testWithVersion() {
- final ReferenceIdentifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326", "8.2", null);
+ final Identifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326", "8.2", null);
final Code value = new Code(id);
assertEquals("codeSpace", "EPSG:8.2", value.codeSpace);
assertEquals("code", "4326", value.code);
@@ -72,7 +72,7 @@ public final strictfp class CodeTest ext
* Reverse operation. Note that the authority is lost since there is no room for that in a
* <gml:identifier> element. Current implementation sets the authority to the code space.
*/
- final ReferenceIdentifier actual = value.getIdentifier();
+ final Identifier actual = value.getIdentifier();
assertSame ("authority", Citations.EPSG, actual.getAuthority());
assertEquals("codeSpace", "EPSG", actual.getCodeSpace());
assertEquals("version", "8.2", actual.getVersion());
@@ -85,7 +85,7 @@ public final strictfp class CodeTest ext
@Test
@DependsOnMethod("testWithVersion")
public void testForIdentifiedObject() {
- final ReferenceIdentifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326", "8.2", null);
+ final Identifier id = new ImmutableIdentifier(HardCodedCitations.OGP, "EPSG", "4326", "8.2", null);
final Code value = Code.forIdentifiedObject(GeographicCRS.class, Collections.singleton(id));
assertNotNull(value);
assertEquals("codeSpace", "OGP", value.codeSpace);
@@ -103,7 +103,7 @@ public final strictfp class CodeTest ext
final Code value = new Code();
value.codeSpace = "OGP";
value.code = "urn:ogc:def:crs:EPSG:8.2:4326";
- final ReferenceIdentifier actual = value.getIdentifier();
+ final Identifier actual = value.getIdentifier();
assertSame ("authority", Citations.OGP, actual.getAuthority());
assertEquals("codeSpace", "EPSG", actual.getCodeSpace());
assertEquals("version", "8.2", actual.getVersion());
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -22,7 +22,7 @@ import javax.measure.unit.SI;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDirection;
import org.opengis.parameter.ParameterValue;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import javax.measure.unit.Unit;
@@ -110,9 +110,9 @@ public final strictfp class ParametersTe
{
assertEquals(valueDomain, Parameters.getValueDomain(descriptor));
assertEquals(valueDomain, Parameters.getValueDomain(new ParameterDescriptor<T>() {
- @Override public ReferenceIdentifier getName() {return descriptor.getName();}
+ @Override public Identifier getName() {return descriptor.getName();}
@Override public Collection<GenericName> getAlias() {return descriptor.getAlias();}
- @Override public Set<ReferenceIdentifier> getIdentifiers() {return descriptor.getIdentifiers();}
+ @Override public Set<Identifier> getIdentifiers() {return descriptor.getIdentifiers();}
@Override public InternationalString getRemarks() {return descriptor.getRemarks();}
@Override public InternationalString getDescription() {return descriptor.getDescription();}
@Override public ParameterDirection getDirection() {return descriptor.getDirection();}
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractIdentifiedObjectTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -23,7 +23,7 @@ import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Collections;
import org.opengis.test.Validators;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.apache.sis.metadata.iso.ImmutableIdentifier;
import org.apache.sis.referencing.datum.AbstractDatum;
import org.apache.sis.internal.jaxb.referencing.Code;
@@ -56,10 +56,10 @@ public final strictfp class AbstractIden
*
* @param identifier The value for the {@code "identifiers"} property.
*/
- private static Map<String,Object> properties(final Set<ReferenceIdentifier> identifiers) {
+ private static Map<String,Object> properties(final Set<Identifier> identifiers) {
final Map<String,Object> properties = new HashMap<>(8);
assertNull(properties.put("name", "GRS 1980"));
- assertNull(properties.put("identifiers", identifiers.toArray(new ReferenceIdentifier[identifiers.size()])));
+ assertNull(properties.put("identifiers", identifiers.toArray(new Identifier[identifiers.size()])));
assertNull(properties.put("codespace", "EPSG"));
assertNull(properties.put("version", "8.3"));
assertNull(properties.put("alias", "International 1979"));
@@ -76,11 +76,11 @@ public final strictfp class AbstractIden
* @param gmlID The expected value of {@link AbstractIdentifiedObject#getID()}.
* @return The value of {@link AbstractIdentifiedObject#getIdentifier()}.
*/
- private static ReferenceIdentifier validate(final AbstractIdentifiedObject object,
- final Set<ReferenceIdentifier> identifiers, final String gmlID)
+ private static Identifier validate(final AbstractIdentifiedObject object,
+ final Set<Identifier> identifiers, final String gmlID)
{
Validators.validate(object);
- final ReferenceIdentifier name = object.getName();
+ final Identifier name = object.getName();
assertEquals("name", "GRS 1980", name.getCode());
assertEquals("codespace", "EPSG", name.getCodeSpace());
assertEquals("version", "8.3", name.getVersion());
@@ -130,9 +130,9 @@ public final strictfp class AbstractIden
*/
@Test
public void testWithoutIdentifier() {
- final Set<ReferenceIdentifier> identifiers = Collections.<ReferenceIdentifier>emptySet();
+ final Set<Identifier> identifiers = Collections.<Identifier>emptySet();
final AbstractIdentifiedObject object = new AbstractIdentifiedObject(properties(identifiers));
- final ReferenceIdentifier gmlId = validate(object, identifiers, "GRS1980");
+ final Identifier gmlId = validate(object, identifiers, "GRS1980");
assertNull("gmlId", gmlId);
}
@@ -149,10 +149,10 @@ public final strictfp class AbstractIden
@Test
@DependsOnMethod("testWithoutIdentifier")
public void testWithSingleIdentifier() {
- final ReferenceIdentifier identifier = new ImmutableIdentifier(null, "EPSG", "7019");
- final Set<ReferenceIdentifier> identifiers = Collections.singleton(identifier);
+ final Identifier identifier = new ImmutableIdentifier(null, "EPSG", "7019");
+ final Set<Identifier> identifiers = Collections.singleton(identifier);
final AbstractIdentifiedObject object = new AbstractIdentifiedObject(properties(identifiers));
- final ReferenceIdentifier gmlId = validate(object, identifiers, "epsg-7019");
+ final Identifier gmlId = validate(object, identifiers, "epsg-7019");
assertNotNull("gmlId", gmlId);
assertEquals ("gmlId.codespace", "EPSG", gmlId.getCodeSpace());
assertEquals ("gmlId.code", "7019", gmlId.getCode());
@@ -166,11 +166,11 @@ public final strictfp class AbstractIden
@Test
@DependsOnMethod("testWithSingleIdentifier")
public void testWithManyIdentifiers() {
- final Set<ReferenceIdentifier> identifiers = new LinkedHashSet<>(4);
+ final Set<Identifier> identifiers = new LinkedHashSet<>(4);
assertTrue(identifiers.add(new NamedIdentifier(EPSG, "7019")));
assertTrue(identifiers.add(new NamedIdentifier(EPSG, "IgnoreMe")));
final AbstractIdentifiedObject object = new AbstractIdentifiedObject(properties(identifiers));
- final ReferenceIdentifier gmlId = validate(object, identifiers, "epsg-7019");
+ final Identifier gmlId = validate(object, identifiers, "epsg-7019");
assertNotNull("gmlId", gmlId);
assertEquals ("gmlId.codespace", "EPSG", gmlId.getCodeSpace());
assertEquals ("gmlId.code", "7019", gmlId.getCode());
@@ -184,10 +184,10 @@ public final strictfp class AbstractIden
@Test
@DependsOnMethod("testWithManyIdentifiers")
public void testAsSubtype() {
- final ReferenceIdentifier identifier = new NamedIdentifier(EPSG, "7019");
- final Set<ReferenceIdentifier> identifiers = Collections.singleton(identifier);
+ final Identifier identifier = new NamedIdentifier(EPSG, "7019");
+ final Set<Identifier> identifiers = Collections.singleton(identifier);
final AbstractIdentifiedObject object = new AbstractDatum(properties(identifiers));
- final ReferenceIdentifier gmlId = validate(object, identifiers, "epsg-datum-7019");
+ final Identifier gmlId = validate(object, identifiers, "epsg-datum-7019");
assertNotNull("gmlId", gmlId);
assertEquals ("gmlId.codespace", "EPSG", gmlId.getCodeSpace());
assertEquals ("gmlId.code", "7019", gmlId.getCode());
@@ -199,9 +199,9 @@ public final strictfp class AbstractIden
@Test
@DependsOnMethod("testWithoutIdentifier")
public void testSerialization() {
- final Set<ReferenceIdentifier> identifiers = Collections.emptySet();
- final AbstractIdentifiedObject object = new AbstractIdentifiedObject(properties(identifiers));
- final AbstractIdentifiedObject actual = assertSerializedEquals(object);
+ final Set<Identifier> identifiers = Collections.emptySet();
+ final AbstractIdentifiedObject object = new AbstractIdentifiedObject(properties(identifiers));
+ final AbstractIdentifiedObject actual = assertSerializedEquals(object);
assertNotSame(object, actual);
assertNull("gmlId", validate(actual, identifiers, "GRS1980"));
}
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -20,7 +20,7 @@ import org.opengis.util.NameSpace;
import org.opengis.util.LocalName;
import org.opengis.util.GenericName;
import org.opengis.metadata.citation.Citation;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.apache.sis.metadata.iso.ImmutableIdentifier;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
@@ -75,23 +75,23 @@ public final strictfp class BuilderTest
fail("Setting a different codespace shall not be allowed.");
} catch (IllegalStateException e) {
final String message = e.getMessage();
- assertTrue(message, message.contains(ReferenceIdentifier.AUTHORITY_KEY));
+ assertTrue(message, message.contains(Identifier.AUTHORITY_KEY));
}
/*
* The failed attempt to set a new codespace shall not have modified builder state.
*/
- assertEquals("EPSG", builder.properties.get(ReferenceIdentifier.CODESPACE_KEY));
- assertSame ( OGP, builder.properties.get(ReferenceIdentifier.AUTHORITY_KEY));
+ assertEquals("EPSG", builder.properties.get(Identifier.CODESPACE_KEY));
+ assertSame ( OGP, builder.properties.get(Identifier.AUTHORITY_KEY));
/*
* After a cleanup (normally after a createXXX(…) method call), user shall be allowed to
* set a new codespace again. Note that the cleanup operation shall not clear the codespace.
*/
builder.onCreate(true);
- assertEquals("EPSG", builder.properties.get(ReferenceIdentifier.CODESPACE_KEY));
- assertSame ( OGP, builder.properties.get(ReferenceIdentifier.AUTHORITY_KEY));
+ assertEquals("EPSG", builder.properties.get(Identifier.CODESPACE_KEY));
+ assertSame ( OGP, builder.properties.get(Identifier.AUTHORITY_KEY));
builder.setCodeSpace(EPSG, "EPSG");
- assertEquals("EPSG", builder.properties.get(ReferenceIdentifier.CODESPACE_KEY));
- assertSame ( EPSG, builder.properties.get(ReferenceIdentifier.AUTHORITY_KEY));
+ assertEquals("EPSG", builder.properties.get(Identifier.CODESPACE_KEY));
+ assertSame ( EPSG, builder.properties.get(Identifier.AUTHORITY_KEY));
}
/**
@@ -104,10 +104,9 @@ public final strictfp class BuilderTest
final LocalName alias1 = SIS_NAMES.createLocalName(null, "Mercator (1SP)");
final LocalName alias2 = SIS_NAMES.createLocalName(null, "Mercator_1SP");
final LocalName alias3 = SIS_NAMES.createLocalName(null, "CT_Mercator");
- assertEquals("Mercator (variant A)", name .toString());
- assertEquals("Mercator (1SP)", alias1.toString());
- assertEquals("Mercator_1SP", alias2.toString());
- assertEquals("CT_Mercator", alias3.toString());
+ assertEquals("Mercator (1SP)", alias1.toString());
+ assertEquals("Mercator_1SP", alias2.toString());
+ assertEquals("CT_Mercator", alias3.toString());
// The test.
final BuilderMock builder = new BuilderMock();
@@ -165,8 +164,8 @@ public final strictfp class BuilderTest
@Test
public void testIdentifiers() {
// Expected values to be used later in the test.
- final ReferenceIdentifier id1 = new ImmutableIdentifier(OGP, "EPSG", "9804");
- final ReferenceIdentifier id2 = new ImmutableIdentifier(GEOTIFF, "GeoTIFF", "7");
+ final Identifier id1 = new ImmutableIdentifier(OGP, "EPSG", "9804");
+ final Identifier id2 = new ImmutableIdentifier(GEOTIFF, "GeoTIFF", "7");
assertEquals("EPSG:9804", IdentifiedObjects.toString(id1));
assertEquals("GeoTIFF:7", IdentifiedObjects.toString(id2));
@@ -176,7 +175,6 @@ public final strictfp class BuilderTest
assertSame(builder, builder.addIdentifier( "9804"));
assertSame(builder, builder.addIdentifier(GEOTIFF, "7"));
builder.onCreate(false);
- assertArrayEquals(new ReferenceIdentifier[] {id1, id2},
- (ReferenceIdentifier[]) builder.properties.get(IDENTIFIERS_KEY));
+ assertArrayEquals(new Identifier[] {id1, id2}, (Identifier[]) builder.properties.get(IDENTIFIERS_KEY));
}
}
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -18,10 +18,10 @@ package org.apache.sis.referencing;
import javax.measure.unit.SI;
import javax.measure.unit.NonSI;
+import org.opengis.metadata.Identifier;
import org.opengis.metadata.extent.Extent;
import org.opengis.metadata.extent.GeographicExtent;
import org.opengis.metadata.extent.GeographicBoundingBox;
-import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.referencing.datum.Ellipsoid;
import org.opengis.referencing.datum.PrimeMeridian;
import org.opengis.referencing.datum.GeodeticDatum;
@@ -118,7 +118,7 @@ public final strictfp class GeodeticObje
* <table class="sis">
* <caption>Verified properties</caption>
* <tr><th>Property</th> <th>Expected value</th></tr>
- * <tr><td>{@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain PrimeMeridian#getName() name}</td>
+ * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain PrimeMeridian#getName() name}</td>
* <td>{@code "Greenwich"}</td></tr>
* <tr><td>{@linkplain PrimeMeridian#getGreenwichLongitude() Greenwich longitude}</td>
* <td>0</td></tr>
@@ -141,7 +141,7 @@ public final strictfp class GeodeticObje
* <table class="sis">
* <caption>Verified properties</caption>
* <tr><th>Property</th> <th>Expected value</th></tr>
- * <tr><td>{@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain PrimeMeridian#getName() name}</td>
+ * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain PrimeMeridian#getName() name}</td>
* <td>{@code "Paris"}</td></tr>
* <tr><td>{@linkplain PrimeMeridian#getGreenwichLongitude() Greenwich longitude}</td>
* <td>2.5969213</td></tr>
@@ -164,7 +164,7 @@ public final strictfp class GeodeticObje
* <table class="sis">
* <caption>Verified properties</caption>
* <tr><th>Property</th> <th>Expected value</th></tr>
- * <tr><td>{@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain Ellipsoid#getName() name}</td>
+ * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain Ellipsoid#getName() name}</td>
* <td>{@code "WGS 84"}</td></tr>
* <tr><td>{@linkplain Ellipsoid#getAxisUnit() Axis unit}</td>
* <td>{@link SI#METRE}</td></tr>
@@ -196,7 +196,7 @@ public final strictfp class GeodeticObje
* <table class="sis">
* <caption>Verified properties</caption>
* <tr><th>Property</th> <th>Expected value</th></tr>
- * <tr><td>{@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
+ * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
* <td>{@code "World Geodetic System 1984"}</td></tr>
* <tr><td>{@linkplain GeodeticDatum#getDomainOfValidity() Domain of validity}</td>
* <td>{@linkplain #assertIsWorld(GeographicBoundingBox) Is world} or absent</td></tr>
@@ -224,7 +224,7 @@ public final strictfp class GeodeticObje
* <table class="sis">
* <caption>Verified properties</caption>
* <tr><th>Property</th> <th>Expected value</th></tr>
- * <tr><td>{@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticCRS#getName() name}</td>
+ * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain GeodeticCRS#getName() name}</td>
* <td>{@code "WGS 84"}</td></tr>
* <tr><td>{@linkplain GeodeticCRS#getDomainOfValidity() Domain of validity}</td>
* <td>{@linkplain #assertIsWorld(GeographicBoundingBox) Is world} or absent</td></tr>
@@ -256,7 +256,7 @@ public final strictfp class GeodeticObje
* <table class="sis">
* <caption>Verified properties</caption>
* <tr><th>Property</th> <th>Expected value</th></tr>
- * <tr><td>{@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
+ * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
* <td>{@code "Mean Sea Level"}</td></tr>
* <tr><td>{@linkplain GeodeticDatum#getDomainOfValidity() Domain of validity}</td>
* <td>{@linkplain #assertIsWorld(GeographicBoundingBox) Is world} or absent</td></tr>
@@ -280,7 +280,7 @@ public final strictfp class GeodeticObje
* <tr><th>Property</th> <th colspan="2">Expected value</th></tr>
* <tr><td>{@linkplain CartesianCS#getDimension() Dimension}</td>
* <td colspan="2">2</td></tr>
- * <tr><td>Axes {@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
+ * <tr><td>Axes {@linkplain Identifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
* <td>{@code "Easting"}</td>
* <td>{@code "Northing"}</td></tr>
* <tr><td>Axes {@linkplain CoordinateSystemAxis#getAbbreviation() abbreviation}</td>
@@ -329,7 +329,7 @@ public final strictfp class GeodeticObje
* <tr><th>Property</th> <th colspan="2">Expected value</th></tr>
* <tr><td>{@linkplain EllipsoidalCS#getDimension() Dimension}</td>
* <td colspan="2">2</td></tr>
- * <tr><td>Axes {@linkplain ReferenceIdentifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
+ * <tr><td>Axes {@linkplain Identifier#getCode() Code} of the {@linkplain GeodeticDatum#getName() name}</td>
* <td>{@code "Geodetic latitude"}</td>
* <td>{@code "Geodetic longitude"}</td></tr>
* <tr><td>Axes {@linkplain CoordinateSystemAxis#getDirection() direction}</td>
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -17,10 +17,10 @@
package org.apache.sis.referencing;
import java.util.Locale;
-import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.util.InternationalString;
import org.opengis.util.NameSpace;
import org.opengis.util.GenericName;
+import org.opengis.metadata.Identifier;
import org.opengis.test.Validators;
import org.apache.sis.util.iso.DefaultInternationalString;
import org.apache.sis.test.DependsOnMethod;
@@ -49,7 +49,7 @@ public final strictfp class NamedIdentif
@Test
public void testCreateFromCode() {
final NamedIdentifier identifier = new NamedIdentifier(OGP, "EPSG", "4326", "8.3", null);
- Validators.validate((ReferenceIdentifier) identifier);
+ Validators.validate((Identifier) identifier);
Validators.validate((GenericName) identifier);
// ImmutableIdentifier properties
@@ -79,7 +79,7 @@ public final strictfp class NamedIdentif
public void testCreateFromName() {
final NameSpace scope = SIS_NAMES.createNameSpace(SIS_NAMES.createLocalName(null, "OGP"), null);
final NamedIdentifier identifier = new NamedIdentifier(SIS_NAMES.createGenericName(scope, "EPSG", "4326"));
- Validators.validate((ReferenceIdentifier) identifier);
+ Validators.validate((Identifier) identifier);
Validators.validate((GenericName) identifier);
// ImmutableIdentifier properties
@@ -116,7 +116,7 @@ public final strictfp class NamedIdentif
@DependsOnMethod("testCreateFromCode")
public void testCreateFromInternationalString() {
final NamedIdentifier identifier = createI18N();
- Validators.validate((ReferenceIdentifier) identifier);
+ Validators.validate((Identifier) identifier);
Validators.validate((GenericName) identifier);
// ImmutableIdentifier properties
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -17,10 +17,10 @@
package org.apache.sis.referencing.crs;
import org.opengis.test.Validators;
+import org.opengis.metadata.Identifier;
import org.opengis.referencing.cs.EllipsoidalCS;
import org.opengis.referencing.cs.CoordinateSystemAxis;
import org.opengis.referencing.crs.GeographicCRS;
-import org.opengis.referencing.ReferenceIdentifier;
import org.apache.sis.referencing.cs.AxesConvention;
import org.apache.sis.referencing.CommonCRS;
import org.apache.sis.io.wkt.Convention;
@@ -96,7 +96,7 @@ public final strictfp class DefaultGeogr
@Test
public void testIdentifiers() {
GeographicCRS crs = CommonCRS.WGS72.geographic();
- ReferenceIdentifier identifier = getSingleton(crs.getIdentifiers());
+ Identifier identifier = getSingleton(crs.getIdentifiers());
assertEquals("codespace", "EPSG", identifier.getCodeSpace());
assertEquals("code", "4322", identifier.getCode());
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapEntry.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -19,6 +19,8 @@ package org.apache.sis.internal.jaxb;
import java.util.AbstractMap;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
+import org.opengis.util.InternationalString;
+import org.apache.sis.internal.util.Citations;
/**
@@ -30,7 +32,7 @@ import org.opengis.metadata.citation.Cit
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3 (derived from geotk-3.18)
- * @version 0.3
+ * @version 0.5
* @module
*/
final class IdentifierMapEntry extends AbstractMap.SimpleEntry<Citation,String> implements Identifier {
@@ -63,6 +65,42 @@ final class IdentifierMapEntry extends A
}
/**
+ * Infers a code space from the authority.
+ *
+ * @return The code space, or {@code null} if none.
+ *
+ * @since 0.5
+ */
+ @Override
+ public String getCodeSpace() {
+ return Citations.getIdentifier(getAuthority());
+ }
+
+ /**
+ * Returns {@code null} since this class does not hold version information.
+ *
+ * @return {@code null}.
+ *
+ * @since 0.5
+ */
+ @Override
+ public String getVersion() {
+ return null;
+ }
+
+ /**
+ * Returns {@code null} since this class does not hold natural language description.
+ *
+ * @return {@code null}.
+ *
+ * @since 0.5
+ */
+ @Override
+ public InternationalString getDescription() {
+ return null;
+ }
+
+ /**
* Same than the above, but as an immutable entry. We use this implementation when the
* entry has been created on-the-fly at iteration time rather than being stored in the
* identifier collection.
@@ -70,7 +108,10 @@ final class IdentifierMapEntry extends A
static final class Immutable extends AbstractMap.SimpleImmutableEntry<Citation,String> implements Identifier {
private static final long serialVersionUID = -6857931598565368465L;
Immutable(Citation authority, String code) {super(authority, code);}
- @Override public Citation getAuthority() {return getKey();}
- @Override public String getCode() {return getValue();}
+ @Override public Citation getAuthority() {return getKey();}
+ @Override public String getCode() {return getValue();}
+ @Override public String getCodeSpace() {return Citations.getIdentifier(getAuthority());}
+ @Override public String getVersion() {return null;}
+ @Override public InternationalString getDescription() {return null;}
}
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/SpecializedIdentifier.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -24,6 +24,7 @@ import java.util.logging.Level;
import java.util.logging.LogRecord;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
+import org.opengis.util.InternationalString;
import org.apache.sis.xml.XLink;
import org.apache.sis.xml.IdentifierMap;
import org.apache.sis.xml.IdentifierSpace;
@@ -45,7 +46,7 @@ import java.util.Objects;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3 (derived from geotk-3.19)
- * @version 0.3
+ * @version 0.5
* @module
*/
public final class SpecializedIdentifier<T> implements Identifier, Serializable {
@@ -192,6 +193,42 @@ public final class SpecializedIdentifier
}
/**
+ * Infers a code space from the authority.
+ *
+ * @return The code space, or {@code null} if none.
+ *
+ * @since 0.5
+ */
+ @Override
+ public String getCodeSpace() {
+ return Citations.getIdentifier(authority);
+ }
+
+ /**
+ * Returns {@code null} since this class does not hold version information.
+ *
+ * @return {@code null}.
+ *
+ * @since 0.5
+ */
+ @Override
+ public String getVersion() {
+ return null;
+ }
+
+ /**
+ * Returns {@code null} since this class does not hold natural language description.
+ *
+ * @return {@code null}.
+ *
+ * @since 0.5
+ */
+ @Override
+ public InternationalString getDescription() {
+ return null;
+ }
+
+ /**
* Returns a hash code value for this identifier.
*/
@Override
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -22,10 +22,10 @@ import java.util.Collections;
import java.io.Serializable;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.extent.Extent;
import org.opengis.referencing.IdentifiedObject;
-import org.opengis.referencing.ReferenceIdentifier;
import org.apache.sis.internal.util.Citations;
import org.apache.sis.util.iso.DefaultNameSpace;
import org.apache.sis.util.LenientComparable;
@@ -57,7 +57,7 @@ public class SimpleIdentifiedObject impl
/**
* The primary name by which this object is identified.
*/
- protected ReferenceIdentifier name;
+ protected Identifier name;
/**
* Creates an identified object without identifier.
@@ -80,7 +80,7 @@ public class SimpleIdentifiedObject impl
*
* @param name The primary name by which this object is identified.
*/
- public SimpleIdentifiedObject(final ReferenceIdentifier name) {
+ public SimpleIdentifiedObject(final Identifier name) {
this.name = name;
}
@@ -90,7 +90,7 @@ public class SimpleIdentifiedObject impl
* @return The identifier given at construction time.
*/
@Override
- public ReferenceIdentifier getName() {
+ public Identifier getName() {
return name;
}
@@ -104,7 +104,7 @@ public class SimpleIdentifiedObject impl
* @return The identifiers, or an empty set if none.
*/
@Override
- public final Set<ReferenceIdentifier> getIdentifiers() {
+ public final Set<Identifier> getIdentifiers() {
return Collections.emptySet();
}
@@ -168,7 +168,7 @@ public class SimpleIdentifiedObject impl
@Override
public final int hashCode() {
int code = (int) serialVersionUID;
- final ReferenceIdentifier name = getName();
+ final Identifier name = getName();
if (name != null) {
code ^= name.hashCode();
}
@@ -234,7 +234,7 @@ public class SimpleIdentifiedObject impl
public String toString() {
final String code, codespace;
final Citation authority;
- final ReferenceIdentifier name = this.name;
+ final Identifier name = this.name;
if (name != null) {
code = name.getCode();
codespace = name.getCodeSpace();
Copied: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java (from r1628382, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java?p2=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java&p1=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java&r1=1628382&r2=1629469&rev=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleReferenceIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -18,7 +18,7 @@ package org.apache.sis.internal.simple;
import java.io.Serializable;
import org.opengis.util.InternationalString;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.apache.sis.internal.util.Citations;
import org.apache.sis.util.CharSequences;
@@ -32,17 +32,17 @@ import java.util.Objects;
/**
- * An implementation of {@link ReferenceIdentifier} as a wrapper around a {@link Citation}.
- * {@code ReferenceIdentifier} is defined by the ISO 19111 standard and is implemented publicly
- * in the {@link org.apache.sis.referencing} package. This class is provided for codes that do
- * not depend on the {@code sis-referencing} module but still need a lightweight implementation.
+ * An implementation of {@link Identifier} as a wrapper around a {@link Citation}.
+ * {@code Identifier} is defined by the ISO 19115 standard and is implemented publicly
+ * in the {@link org.apache.sis.metadata} package. This class is provided for codes that do
+ * not depend on the {@code sis-metadata} module but still need a lightweight implementation.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.4
+ * @version 0.5
* @module
*/
-public class SimpleReferenceIdentifier implements ReferenceIdentifier, Serializable {
+public class SimpleIdentifier implements Identifier, Serializable {
/**
* For cross-version compatibility.
*/
@@ -74,14 +74,14 @@ public class SimpleReferenceIdentifier i
* @param authority Responsible party for definition and maintenance of the code, or null.
* @param code Alphanumeric value identifying an instance in the namespace.
*/
- public SimpleReferenceIdentifier(final Citation authority, final String code) {
+ public SimpleIdentifier(final Citation authority, final String code) {
this.authority = authority;
this.code = code;
}
/**
- * Organization or party responsible for definition and maintenance of the
- * {@linkplain #getCode() code}, or {@code null} if none. It can be a
+ * Returns the organization or party responsible for definition and maintenance
+ * of the {@linkplain #getCode() code}, or {@code null} if none. It can be a
* bibliographical reference to an international standard such as ISO 19115.
*
* <p>The default implementation returns the citation specified at construction time;</p>
@@ -138,16 +138,28 @@ public class SimpleReferenceIdentifier i
}
/**
+ * Returns a natural language description of the meaning of the code value.
+ *
+ * @return Natural language description, or {@code null} if none.
+ *
+ * @since 0.5
+ */
+ @Override
+ public InternationalString getDescription() {
+ return null;
+ }
+
+ /**
* Returns {@code true} if the given object is of the same class than this
- * {@code SimpleReferenceIdentifier} and has the same values.
+ * {@code SimpleIdentifier} and has the same values.
*
- * @param obj The object to compare with this {@code SimpleReferenceIdentifier} for equality.
+ * @param obj The object to compare with this {@code SimpleIdentifier} for equality.
* @return {@code true} if both objects are equal.
*/
@Override
public boolean equals(final Object obj) {
if (obj != null && obj.getClass() == getClass()) {
- final SimpleReferenceIdentifier that = (SimpleReferenceIdentifier) obj;
+ final SimpleIdentifier that = (SimpleIdentifier) obj;
return Objects.equals(code, that.code) && Objects.equals(authority, that.authority);
}
return false;
@@ -201,7 +213,7 @@ public class SimpleReferenceIdentifier i
/**
* Returns a pseudo Well Known Text for this identifier.
- * While this method is not defined in the {@link ReferenceIdentifier} interface, it is often
+ * While this method is not defined in the {@link Identifier} interface, it is often
* defined in related interfaces like {@link org.opengis.referencing.IdentifiedObject}.
*
* @return Pseudo Well Known Text for this identifier.
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -18,7 +18,7 @@ package org.apache.sis.internal.util;
import java.util.Map;
import java.util.Collections;
-import org.opengis.referencing.ReferenceIdentifier;
+import org.opengis.metadata.Identifier;
import static org.apache.sis.util.CharSequences.*;
import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
@@ -453,7 +453,7 @@ public final class DefinitionURI {
* @param identifier The identifier to format.
* @return An identifier using the URN syntax, or {@code null} if an information is missing.
*/
- public static String format(final String type, final ReferenceIdentifier identifier) {
+ public static String format(final String type, final Identifier identifier) {
final StringBuilder buffer = new StringBuilder(PREFIX);
for (int p=0; p<4; p++) {
final String component;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -21,8 +21,8 @@ import java.text.Format;
import java.text.FieldPosition;
import java.text.ParsePosition;
import org.opengis.util.GenericName;
+import org.opengis.metadata.Identifier;
import org.opengis.referencing.IdentifiedObject;
-import org.opengis.referencing.ReferenceIdentifier;
import org.apache.sis.internal.util.Citations;
import org.apache.sis.util.iso.DefaultNameSpace;
import org.apache.sis.util.resources.Vocabulary;
@@ -59,7 +59,7 @@ final class IdentifiedObjectFormat exten
*/
@Override
public StringBuffer format(final Object obj, final StringBuffer toAppendTo, final FieldPosition pos) {
- final ReferenceIdentifier identifier = ((IdentifiedObject) obj).getName();
+ final Identifier identifier = ((IdentifiedObject) obj).getName();
if (identifier == null) {
return toAppendTo.append(Vocabulary.getResources(locale).getString(Vocabulary.Keys.Unnamed));
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -107,7 +107,7 @@ public class DefaultRecord implements Re
/**
* Returns the dictionary of all (<var>name</var>, <var>value</var>) pairs in this record.
- * This method returns a view which will delegate all {@get} and {@code pt} operations to
+ * This method returns a view which will delegate all {@code get} and {@code pt} operations to
* the {@link #locate(MemberName)} and {@link #set(MemberName, Object)} methods respectively.
*
* @return The dictionary of all (<var>name</var>, <var>value</var>) pairs in this record.
Copied: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java (from r1628382, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleReferenceIdentifierTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java?p2=sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java&p1=sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleReferenceIdentifierTest.java&r1=1628382&r2=1629469&rev=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleReferenceIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/simple/SimpleIdentifierTest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -23,35 +23,35 @@ import static org.junit.Assert.*;
/**
- * Tests {@link SimpleReferenceIdentifier}.
+ * Tests {@link SimpleIdentifier}.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
* @version 0.3
* @module
*/
-public final strictfp class SimpleReferenceIdentifierTest extends TestCase {
+public final strictfp class SimpleIdentifierTest extends TestCase {
/**
- * Tests {@link SimpleReferenceIdentifier#toString()}.
+ * Tests {@link SimpleIdentifier#toString()}.
*/
@Test
public void testToString() {
final SimpleCitation authority = new SimpleCitation("EPSG");
- assertEquals("SimpleReferenceIdentifier[“EPSG:4326”]", new SimpleReferenceIdentifier(authority, "4326").toString());
- assertEquals("SimpleReferenceIdentifier[“EPSG”]", new SimpleReferenceIdentifier(authority, null ).toString());
- assertEquals("SimpleReferenceIdentifier[“4326”]", new SimpleReferenceIdentifier(null, "4326").toString());
- assertEquals("SimpleReferenceIdentifier[]", new SimpleReferenceIdentifier(null, null ).toString());
+ assertEquals("SimpleIdentifier[“EPSG:4326”]", new SimpleIdentifier(authority, "4326").toString());
+ assertEquals("SimpleIdentifier[“EPSG”]", new SimpleIdentifier(authority, null ).toString());
+ assertEquals("SimpleIdentifier[“4326”]", new SimpleIdentifier(null, "4326").toString());
+ assertEquals("SimpleIdentifier[]", new SimpleIdentifier(null, null ).toString());
}
/**
- * Tests {@link SimpleReferenceIdentifier#toWKT()}.
+ * Tests {@link SimpleIdentifier#toWKT()}.
*/
@Test
public void testToWKT() {
final SimpleCitation authority = new SimpleCitation("EPSG");
- assertEquals("ID[\"EPSG\", \"4326\"]", new SimpleReferenceIdentifier(authority, "4326").toWKT());
- assertEquals("ID[\"EPSG\", null]", new SimpleReferenceIdentifier(authority, null ).toWKT());
- assertEquals("ID[null, \"4326\"]", new SimpleReferenceIdentifier(null, "4326").toWKT());
- assertEquals("ID[null, null]", new SimpleReferenceIdentifier(null, null ).toWKT());
+ assertEquals("ID[\"EPSG\", \"4326\"]", new SimpleIdentifier(authority, "4326").toWKT());
+ assertEquals("ID[\"EPSG\", null]", new SimpleIdentifier(authority, null ).toWKT());
+ assertEquals("ID[null, \"4326\"]", new SimpleIdentifier(null, "4326").toWKT());
+ assertEquals("ID[null, null]", new SimpleIdentifier(null, null ).toWKT());
}
}
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -16,8 +16,8 @@
*/
package org.apache.sis.internal.util;
-import org.opengis.referencing.ReferenceIdentifier;
-import org.apache.sis.internal.simple.SimpleReferenceIdentifier;
+import org.opengis.metadata.Identifier;
+import org.apache.sis.internal.simple.SimpleIdentifier;
import org.apache.sis.internal.simple.SimpleCitation;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
@@ -147,11 +147,11 @@ public final strictfp class DefinitionUR
}
/**
- * Tests {@link DefinitionURI#toURN(String, ReferenceIdentifier)}.
+ * Tests {@link DefinitionURI#format(String, Identifier)}.
*/
@Test
public void testToURN() {
- final ReferenceIdentifier identifier = new SimpleReferenceIdentifier(new SimpleCitation("EPSG"), "4326");
+ final Identifier identifier = new SimpleIdentifier(new SimpleCitation("EPSG"), "4326");
assertEquals("urn:ogc:def:crs:EPSG::4326", DefinitionURI.format("crs", identifier));
}
}
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -25,9 +25,9 @@ import javax.xml.bind.annotation.XmlRoot
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.opengis.referencing.IdentifiedObject;
-import org.opengis.referencing.ReferenceIdentifier;
import org.apache.sis.internal.util.CollectionsExt;
import org.apache.sis.internal.jaxb.gco.GO_GenericName;
@@ -39,12 +39,12 @@ import org.apache.sis.internal.jaxb.gco.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.4
+ * @version 0.5
* @module
*/
@SuppressWarnings("serial")
@XmlRootElement(name = "IO_IdentifiedObject")
-public strictfp class IdentifiedObjectMock implements IdentifiedObject, ReferenceIdentifier, Serializable {
+public strictfp class IdentifiedObjectMock implements IdentifiedObject, Identifier, Serializable {
/**
* The object name to be returned by {@link #getCode()}.
*/
@@ -100,7 +100,7 @@ public strictfp class IdentifiedObjectMo
* @return The name of this object, or {@code null} if none.
*/
@Override
- public final ReferenceIdentifier getName() {
+ public final Identifier getName() {
return (code != null) ? this : null;
}
@@ -160,7 +160,19 @@ public strictfp class IdentifiedObjectMo
* @return The identifiers of this object.
*/
@Override
- public final Set<ReferenceIdentifier> getIdentifiers() {
+ public final Set<Identifier> getIdentifiers() {
+ return null;
+ }
+
+ /**
+ * Returns the description (currently null).
+ *
+ * @return The description associated to this object.
+ *
+ * @since 0.5
+ */
+ @Override
+ public InternationalString getDescription() {
return null;
}
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -87,7 +87,7 @@ import org.junit.BeforeClass;
org.apache.sis.util.iso.DefaultNameFactoryTest.class,
org.apache.sis.util.iso.NamesTest.class,
org.apache.sis.util.iso.TypeNamesTest.class,
- org.apache.sis.internal.simple.SimpleReferenceIdentifierTest.class,
+ org.apache.sis.internal.simple.SimpleIdentifierTest.class,
org.apache.sis.util.iso.DefaultRecordTypeTest.class,
org.apache.sis.util.iso.DefaultRecordSchemaTest.class,
org.apache.sis.util.iso.DefaultRecordTest.class,
Modified: sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -18,8 +18,8 @@ package org.apache.sis.internal.profile.
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.metadata.Identifier;
import org.opengis.referencing.ReferenceSystem;
-import org.opengis.referencing.ReferenceIdentifier;
import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
import org.apache.sis.util.ComparisonMode;
@@ -71,7 +71,7 @@ public class DirectReferenceSystem exten
*
* @param identifier The reference system identifier.
*/
- public DirectReferenceSystem(final ReferenceIdentifier identifier) {
+ public DirectReferenceSystem(final Identifier identifier) {
super(identifier);
}
Modified: sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java?rev=1629469&r1=1629468&r2=1629469&view=diff
==============================================================================
--- sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK8/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java [UTF-8] Sun Oct 5 06:05:27 2014
@@ -18,8 +18,8 @@ package org.apache.sis.internal.profile.
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.metadata.Identifier;
import org.opengis.referencing.ReferenceSystem;
-import org.opengis.referencing.ReferenceIdentifier;
import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
import org.apache.sis.util.ComparisonMode;
@@ -71,7 +71,7 @@ public class IndirectReferenceSystem ext
*
* @param identifier The reference system identifier.
*/
- public IndirectReferenceSystem(final ReferenceIdentifier identifier) {
+ public IndirectReferenceSystem(final Identifier identifier) {
super(identifier);
}