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 2018/03/08 15:30:30 UTC
svn commit: r1826246 [2/4] - in /sis/trunk: ./ core/sis-metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/geoapi/
core/sis-metadata/src/main/java/org/apache/sis/internal/geoapi/evolution/
core/sis-metadata/src/main/java/org/apache/sis/i...
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TM_Primitive.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -18,8 +18,6 @@ package org.apache.sis.internal.jaxb.gml
import java.util.Date;
import javax.xml.bind.annotation.XmlElement;
-import org.opengis.temporal.Period;
-import org.opengis.temporal.Instant;
import org.opengis.temporal.TemporalPrimitive;
import org.apache.sis.internal.jaxb.Context;
import org.apache.sis.internal.jaxb.XmlUtilities;
@@ -27,6 +25,10 @@ import org.apache.sis.internal.jaxb.gco.
import org.apache.sis.internal.util.TemporalUtilities;
import org.apache.sis.util.resources.Errors;
+// Branch-dependent imports
+import org.apache.sis.internal.geoapi.temporal.Period;
+import org.apache.sis.internal.geoapi.temporal.Instant;
+
/**
* JAXB adapter for {@link TemporalPrimitive}, in order to integrate the value in an element complying
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -22,10 +22,12 @@ import javax.xml.bind.annotation.XmlElem
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.datatype.DatatypeConfigurationException;
-import org.opengis.temporal.Instant;
import org.apache.sis.internal.jaxb.Context;
import org.apache.sis.internal.jaxb.XmlUtilities;
+// Branch-dependent imports
+import org.apache.sis.internal.geoapi.temporal.Instant;
+
/**
* Encapsulates a {@code gml:TimeInstant}. This element may be used alone, or included in a
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriod.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriod.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriod.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriod.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -20,8 +20,8 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.temporal.Period;
import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.geoapi.temporal.Period;
import static org.apache.sis.internal.jaxb.LegacyNamespaces.VERSION_3_0;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriodBound.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriodBound.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriodBound.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/TimePeriodBound.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -21,7 +21,9 @@ import javax.xml.bind.annotation.XmlElem
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.datatype.XMLGregorianCalendar;
-import org.opengis.temporal.Instant;
+
+// Branch-dependent imports
+import org.apache.sis.internal.geoapi.temporal.Instant;
/**
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MX_DataFile.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MX_DataFile.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MX_DataFile.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MX_DataFile.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -60,7 +60,7 @@ public final class MX_DataFile extends P
/**
* Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
- * in a {@code <gmx:MX_DataFile>} XML element.
+ * in a {@code <gcx:MX_DataFile>} XML element.
*
* @param metadata the metadata element to marshall.
* @return a {@code PropertyType} wrapping the given the metadata element.
@@ -72,7 +72,7 @@ public final class MX_DataFile extends P
/**
* Invoked by JAXB at marshalling time for getting the actual metadata to write
- * inside the {@code <gmx:MX_DataFile>} XML element.
+ * inside the {@code <gcx:MX_DataFile>} XML element.
* This is the value or a copy of the value given in argument to the {@code wrap} method.
*
* @return the metadata to be marshalled.
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -22,16 +22,17 @@ import java.util.Collection;
import java.util.Locale;
import java.util.TimeZone;
import javax.sql.DataSource;
+import org.opengis.util.CodeList;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Role;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.citation.PresentationForm;
import org.opengis.metadata.citation.ResponsibleParty;
-import org.apache.sis.internal.simple.CitationConstant;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.internal.util.MetadataServices;
import org.apache.sis.internal.metadata.sql.Initializer;
import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.jaxb.Context;
import org.apache.sis.metadata.iso.ImmutableIdentifier;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.metadata.iso.citation.DefaultCitation;
@@ -49,7 +50,7 @@ import static java.util.Collections.sing
* Implements the metadata services needed by the {@code "sis-utility"} module.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
* @since 0.6
* @module
*/
@@ -61,15 +62,28 @@ public final class ServicesForUtility ex
}
/**
- * Returns the constant defined in the {@link Citations} class for the given name.
+ * {@code true} if this thread is in the process of reading a XML document with JAXB.
*
- * @param name the name of one of the citation constants defined in the {@code Citations} class.
- * @return the requested citation, or {@code null} if there is no constant for the given name.
+ * @return if XML unmarshalling is in progress in current thread.
*/
@Override
- public CitationConstant getCitationConstant(final String name) {
- final Citation c = Citations.fromName(name);
- return (c instanceof CitationConstant) ? (CitationConstant) c : null;
+ public boolean isUnmarshalling() {
+ final Context context = Context.current();
+ return (context != null) && !Context.isFlagSet(context, Context.MARSHALLING);
+ }
+
+ /**
+ * Returns the title of the given enumeration or code list value.
+ *
+ * @param code the code for which to get the title.
+ * @param locale desired locale for the title.
+ * @return the title.
+ *
+ * @see org.apache.sis.util.iso.Types#getCodeTitle(CodeList)
+ */
+ @Override
+ public String getCodeTitle(final CodeList<?> code, final Locale locale) {
+ return Types.getCodeTitle(code).toString(locale);
}
/**
@@ -83,8 +97,7 @@ public final class ServicesForUtility ex
* need to make sure that the given key is present in the alternate titles, since we rely on that when
* checking for code spaces.
*/
- @Override
- public Citation createCitation(final String key) {
+ public static Citation createCitation(final String key) {
CharSequence title;
CharSequence alternateTitle = null;
CharSequence edition = null;
@@ -182,7 +195,7 @@ public final class ServicesForUtility ex
title = "S-57";
break;
}
- default: return super.createCitation(key);
+ default: return null;
}
/*
* Do not use the 'c.getFoo().add(foo)' pattern below. Use the 'c.setFoo(singleton(foo))' pattern instead.
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/package-info.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/package-info.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -24,7 +24,7 @@
* may change in incompatible ways in any future version without notice.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.7
+ * @version 1.0
* @since 0.3
* @module
*/
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/CitationConstant.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/CitationConstant.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/CitationConstant.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/CitationConstant.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -24,7 +24,7 @@ import org.opengis.metadata.citation.Cit
import org.opengis.metadata.citation.CitationDate;
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.citation.PresentationForm;
-import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.ResponsibleParty;
import org.opengis.metadata.citation.Series;
import org.opengis.metadata.identification.BrowseGraphic;
import org.opengis.util.InternationalString;
@@ -163,12 +163,10 @@ public class CitationConstant extends Si
@Override public InternationalString getEdition() {return delegate().getEdition();}
@Override public Date getEditionDate() {return delegate().getEditionDate();}
@Override public Collection<? extends Identifier> getIdentifiers() {return delegate().getIdentifiers();}
- @Override public Collection<? extends Responsibility> getCitedResponsibleParties() {return delegate().getCitedResponsibleParties();}
+ @Override public Collection<? extends ResponsibleParty> getCitedResponsibleParties() {return delegate().getCitedResponsibleParties();}
@Override public Collection<PresentationForm> getPresentationForms() {return delegate().getPresentationForms();}
@Override public Series getSeries() {return delegate().getSeries();}
- @Override public Collection<? extends InternationalString> getOtherCitationDetails() {return delegate().getOtherCitationDetails();}
- @Override public Collection<? extends OnlineResource> getOnlineResources() {return delegate().getOnlineResources();}
- @Override public Collection<? extends BrowseGraphic> getGraphics() {return delegate().getGraphics();}
+ @Override public InternationalString getOtherCitationDetails() {return delegate().getOtherCitationDetails();}
@Override public String getISBN() {return delegate().getISBN();}
@Override public String getISSN() {return delegate().getISSN();}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleAttributeType.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -16,12 +16,8 @@
*/
package org.apache.sis.internal.simple;
-import java.util.Map;
-import java.util.Collections;
import java.io.Serializable;
import org.opengis.util.Type;
-import org.opengis.feature.Attribute;
-import org.opengis.feature.AttributeType;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.util.TypeName;
@@ -30,7 +26,7 @@ import org.opengis.util.TypeName;
/**
* A simple attribute type containing only a name and a class of values.
* Such simple type are suitable for use in ISO 19103 {@link org.opengis.util.RecordType}
- * in addition to ISO 19109 {@link org.opengis.feature.FeatureType}.
+ * in addition to ISO 19109 {@code org.opengis.feature.FeatureType}.
*
* @author Martin Desruisseaux (Geomatys)
* @version 0.5
@@ -40,7 +36,7 @@ import org.opengis.util.TypeName;
* @since 0.5
* @module
*/
-public final class SimpleAttributeType<V> implements AttributeType<V>, Type, Serializable {
+public final class SimpleAttributeType<V> implements Type, Serializable {
/**
* For cross-version compatibility.
*/
@@ -72,7 +68,6 @@ public final class SimpleAttributeType<V
*
* @return the name of this attribute type.
*/
- @Override
public GenericName getName() {
return name;
}
@@ -92,7 +87,6 @@ public final class SimpleAttributeType<V
*
* @return the class of value for attributes of this type.
*/
- @Override
public Class<V> getValueClass() {
return valueClass;
}
@@ -102,7 +96,6 @@ public final class SimpleAttributeType<V
*
* @return always 1.
*/
- @Override
public int getMinimumOccurs() {
return 1;
}
@@ -112,7 +105,6 @@ public final class SimpleAttributeType<V
*
* @return always 1.
*/
- @Override
public int getMaximumOccurs() {
return 1;
}
@@ -122,7 +114,6 @@ public final class SimpleAttributeType<V
*
* @return always {@code null}.
*/
- @Override
public V getDefaultValue() {
return null;
}
@@ -132,7 +123,6 @@ public final class SimpleAttributeType<V
*
* @return always {@code null}.
*/
- @Override
public InternationalString getDefinition() {
return null;
}
@@ -142,7 +132,6 @@ public final class SimpleAttributeType<V
*
* @return always {@code null}.
*/
- @Override
public InternationalString getDesignation() {
return null;
}
@@ -152,30 +141,11 @@ public final class SimpleAttributeType<V
*
* @return always {@code null}.
*/
- @Override
public InternationalString getDescription() {
return null;
}
/**
- * Not used for this simple attribute type.
- *
- * @return always empty.
- */
- @Override
- public Map<String, AttributeType<?>> characteristics() {
- return Collections.emptyMap();
- }
-
- /**
- * Unsupported operation.
- */
- @Override
- public Attribute<V> newInstance() {
- throw new UnsupportedOperationException();
- }
-
- /**
* Returns a hash code value for this type.
*
* @return a hash code value.
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -26,7 +26,7 @@ import org.opengis.metadata.citation.Cit
import org.opengis.metadata.citation.CitationDate;
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.citation.PresentationForm;
-import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.ResponsibleParty;
import org.opengis.metadata.citation.Series;
import org.opengis.metadata.identification.BrowseGraphic;
import org.opengis.util.InternationalString;
@@ -89,12 +89,10 @@ public class SimpleCitation implements C
@Override public InternationalString getEdition() {return null;}
@Override public Date getEditionDate() {return null;}
@Override public Collection<? extends Identifier> getIdentifiers() {return Collections.emptyList();}
- @Override public Collection<? extends Responsibility> getCitedResponsibleParties() {return Collections.emptyList();}
+ @Override public Collection<? extends ResponsibleParty> getCitedResponsibleParties() {return Collections.emptyList();}
@Override public Collection<PresentationForm> getPresentationForms() {return Collections.emptyList();}
@Override public Series getSeries() {return null;}
- @Override public Collection<? extends InternationalString> getOtherCitationDetails() {return Collections.emptyList();}
- @Override public Collection<? extends OnlineResource> getOnlineResources() {return Collections.emptyList();}
- @Override public Collection<? extends BrowseGraphic> getGraphics() {return Collections.emptyList();}
+ @Override public InternationalString getOtherCitationDetails() {return null;}
@Override public String getISBN() {return null;}
@Override public String getISSN() {return null;}
@Deprecated
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleFormat.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleFormat.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -20,10 +20,8 @@ import java.util.Collection;
import java.util.Collections;
import org.apache.sis.util.Debug;
import org.opengis.util.InternationalString;
-import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.distribution.Distributor;
import org.opengis.metadata.distribution.Format;
-import org.opengis.metadata.distribution.Medium;
/**
@@ -70,16 +68,6 @@ public class SimpleFormat extends Simple
}
/**
- * Citation / URL of the specification format.
- *
- * @return citation / URL of the specification format.
- */
- @Override
- public Citation getFormatSpecificationCitation() {
- return this;
- }
-
- /**
* @deprecated Replaced by {@link #getTitle()}
*
* @return name of a subset, profile, or product specification of the format, or {@code null}.
@@ -135,16 +123,6 @@ public class SimpleFormat extends Simple
}
/**
- * Media used by the format.
- *
- * @return media used by the format.
- */
- @Override
- public Collection<? extends Medium> getMedia() {
- return Collections.emptyList();
- }
-
- /**
* Provides information about the distributor's format.
*
* @return information about the distributor's format.
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -27,6 +27,7 @@ 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;
@@ -56,7 +57,7 @@ public class SimpleIdentifiedObject impl
/**
* The primary name by which this object is identified.
*/
- protected Identifier name;
+ protected ReferenceIdentifier name;
/**
* Creates an identified object without identifier.
@@ -79,7 +80,7 @@ public class SimpleIdentifiedObject impl
*
* @param name the primary name by which this object is identified.
*/
- public SimpleIdentifiedObject(final Identifier name) {
+ public SimpleIdentifiedObject(final ReferenceIdentifier name) {
this.name = name;
}
@@ -89,7 +90,7 @@ public class SimpleIdentifiedObject impl
* @return the identifier given at construction time.
*/
@Override
- public Identifier getName() {
+ public ReferenceIdentifier getName() {
return name;
}
@@ -103,7 +104,7 @@ public class SimpleIdentifiedObject impl
* @return the identifiers, or an empty set if none.
*/
@Override
- public final Set<Identifier> getIdentifiers() {
+ public final Set<ReferenceIdentifier> getIdentifiers() {
return Collections.emptySet();
}
@@ -233,7 +234,7 @@ public class SimpleIdentifiedObject impl
public String toString() {
final String code, codespace;
final Citation authority;
- final Identifier name = this.name;
+ final ReferenceIdentifier name = this.name;
if (name != null) {
code = name.getCode();
codespace = name.getCodeSpace();
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -19,7 +19,7 @@ package org.apache.sis.internal.simple;
import java.util.Objects;
import java.io.Serializable;
import org.opengis.util.InternationalString;
-import org.opengis.metadata.Identifier;
+import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.metadata.citation.Citation;
import org.apache.sis.internal.util.Citations;
import org.apache.sis.util.CharSequences;
@@ -31,14 +31,14 @@ import static org.apache.sis.util.iso.De
/**
- * An implementation of {@link Identifier} as a wrapper around a {@link Citation}.
+ * An implementation of {@link ReferenceIdentifier} as a wrapper around a {@link Citation}.
*
* @author Martin Desruisseaux (Geomatys)
* @version 1.0
* @since 0.3
* @module
*/
-public class SimpleIdentifier implements Identifier, Deprecable, Serializable {
+public class SimpleIdentifier implements ReferenceIdentifier, Deprecable, Serializable {
/**
* For cross-version compatibility.
*/
@@ -147,7 +147,6 @@ public class SimpleIdentifier implements
*
* @since 0.5
*/
- @Override
public InternationalString getDescription() {
return null;
}
@@ -237,7 +236,7 @@ public class SimpleIdentifier implements
/**
* Returns a pseudo Well Known Text for this identifier.
- * While this method is not defined in the {@link Identifier} interface, it is often
+ * While this method is not defined in the {@link ReferenceIdentifier} interface, it is often
* defined in related interfaces like {@link org.opengis.referencing.IdentifiedObject}.
*
* @return pseudo Well Known Text for this identifier.
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/simple/SimpleMetadata.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -16,7 +16,6 @@
*/
package org.apache.sis.internal.simple;
-import java.nio.charset.Charset;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
@@ -25,14 +24,12 @@ import org.opengis.metadata.ApplicationS
import org.opengis.metadata.Identifier;
import org.opengis.metadata.Metadata;
import org.opengis.metadata.MetadataExtensionInformation;
-import org.opengis.metadata.MetadataScope;
import org.opengis.metadata.PortrayalCatalogueReference;
import org.opengis.metadata.acquisition.AcquisitionInformation;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.citation.CitationDate;
-import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.citation.PresentationForm;
-import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.ResponsibleParty;
import org.opengis.metadata.citation.Series;
import org.opengis.metadata.constraint.Constraints;
import org.opengis.metadata.content.ContentInformation;
@@ -40,14 +37,12 @@ import org.opengis.metadata.distribution
import org.opengis.metadata.distribution.Format;
import org.opengis.metadata.extent.Extent;
import org.opengis.metadata.identification.*;
-import org.opengis.metadata.lineage.Lineage;
import org.opengis.metadata.maintenance.MaintenanceInformation;
import org.opengis.metadata.maintenance.ScopeCode;
import org.opengis.metadata.quality.DataQuality;
import org.opengis.metadata.spatial.SpatialRepresentation;
import org.opengis.metadata.spatial.SpatialRepresentationType;
import org.opengis.referencing.ReferenceSystem;
-import org.opengis.temporal.Duration;
import org.opengis.util.InternationalString;
@@ -60,8 +55,8 @@ import org.opengis.util.InternationalStr
* <p>Unless specified otherwise, all methods in this class returns {@code null} or an empty collection by default.
* The exceptions to this rules are the following methods:</p>
* <ul>
- * <li>{@link #getMetadataScopes()} returns {@code this}</li>
- * <li>{@link #getResourceScope()} returns {@link ScopeCode#DATASET}</li>
+ * <li>{@code getMetadataScopes()} returns {@code this}</li>
+ * <li>{@code getResourceScope()} returns {@link ScopeCode#DATASET}</li>
* <li>{@link #getIdentificationInfo()} returns {@code this}</li>
* <li>{@link #getCitation()} returns {@code this}</li>
* <li>{@link #getSpatialRepresentationTypes()} returns {@link SpatialRepresentationType#VECTOR}</li>
@@ -83,7 +78,7 @@ import org.opengis.util.InternationalStr
* @since 0.8
* @module
*/
-public class SimpleMetadata implements Metadata, MetadataScope, DataIdentification, Citation {
+public class SimpleMetadata implements Metadata, DataIdentification, Citation {
/**
* Creates a new metadata object.
*/
@@ -94,16 +89,6 @@ public class SimpleMetadata implements M
* Unique identifier for this metadata record.
*/
@Override
- public Identifier getMetadataIdentifier() {
- return null;
- }
-
- /**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataIdentifier()}
- * in order to include the codespace attribute.
- */
- @Override
- @Deprecated
public String getFileIdentifier() {
return null;
}
@@ -118,19 +103,19 @@ public class SimpleMetadata implements M
}
/**
- * @deprecated As of GeoAPI 3.1, replaced by {@link #getLanguages()}.
+ * Language(s) used for documenting metadata.
+ * Also the language(s) used within the data.
*/
@Override
- @Deprecated
public Locale getLanguage() {
return null;
}
/**
- * @deprecated As of GeoAPI 3.1, replaced by {@link #getLanguages()}.
+ * Language(s) used for documenting metadata.
+ * Also the language(s) used within the data.
*/
@Override
- @Deprecated
public Collection<Locale> getLocales() {
return Collections.emptySet(); // We use 'Set' because we handle 'Locale' like a CodeList.
}
@@ -140,15 +125,15 @@ public class SimpleMetadata implements M
* Also the character coding standard(s) used for the dataset.
*/
@Override
- public Collection<Charset> getCharacterSets() {
+ public Collection<CharacterSet> getCharacterSets() {
return Collections.emptySet(); // We use 'Set' because we handle 'Charset' like a CodeList.
}
/**
- * @deprecated As of GeoAPI 3.1, replaced by {@link #getCharacterSets()}.
+ * The character coding standard used for the metadata set.
+ * Also the character coding standard(s) used for the dataset.
*/
@Override
- @Deprecated
public CharacterSet getCharacterSet() {
return null;
}
@@ -157,66 +142,24 @@ public class SimpleMetadata implements M
* Identification of the parent metadata record.
*/
@Override
- public Citation getParentMetadata() {
- return null;
- }
-
- /**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getParentMetadata()}.
- */
- @Override
- @Deprecated
public String getParentIdentifier() {
return null;
}
/**
- * The scope or type of resource for which metadata is provided.
- * This method returns {@code this} for allowing call to {@link #getResourceScope()}.
- *
- * @see #getResourceScope()
- * @see #getName()
- */
- @Override
- public Collection<MetadataScope> getMetadataScopes() {
- return Collections.singleton(this);
- }
-
- /**
- * Code for the metadata scope, fixed to {@link ScopeCode#DATASET} by default. This is part of the information
- * provided by {@link #getMetadataScopes()}. The {@code DATASET} default value is consistent with the fact that
+ * Code for the metadata scope, fixed to {@link ScopeCode#DATASET} by default.
+ * The {@code DATASET} default value is consistent with the fact that
* {@code SimpleMetadata} implements {@link DataIdentification}.
*/
@Override
- public ScopeCode getResourceScope() {
- return ScopeCode.DATASET;
- }
-
- /**
- * Description of the metadata scope.
- * This is part of the information provided by {@link #getMetadataScopes()}.
- */
- @Override
- public InternationalString getName() {
- return null;
- }
-
- /**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}
- * followed by {@link MetadataScope#getResourceScope()}.
- */
- @Override
- @Deprecated
public Collection<ScopeCode> getHierarchyLevels() {
- return Collections.singleton(getResourceScope());
+ return Collections.singleton(ScopeCode.DATASET);
}
/**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataScopes()}
- * followed by {@link MetadataScope#getName()}.
+ * Description of the metadata scope.
*/
@Override
- @Deprecated
public Collection<String> getHierarchyLevelNames() {
return Collections.emptySet();
}
@@ -225,7 +168,7 @@ public class SimpleMetadata implements M
* Parties responsible for the metadata information.
*/
@Override
- public Collection<Responsibility> getContacts() {
+ public Collection<ResponsibleParty> getContacts() {
return Collections.emptyList();
}
@@ -233,77 +176,31 @@ public class SimpleMetadata implements M
* Date(s) associated with the metadata.
*/
@Override
- public Collection<CitationDate> getDateInfo() {
- return Collections.emptyList();
- }
-
- /**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getDateInfo()}.
- */
- @Override
- @Deprecated
public Date getDateStamp() {
return null;
}
/**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataStandards()}
- * followed by {@link Citation#getTitle()}.
+ * Citation(s) for the standard(s) to which the metadata conform.
*/
@Override
- @Deprecated
public String getMetadataStandardName() {
return null;
}
/**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getMetadataStandards()}
- * followed by {@link Citation#getEdition()}.
+ * As of ISO 19115:2014, replaced by {@code getMetadataStandards()}
+ * followed by {@link Citation#getEdition()}.
*/
@Override
- @Deprecated
public String getMetadataStandardVersion() {
return null;
}
/**
- * Citation(s) for the standard(s) to which the metadata conform.
- */
- @Override
- public Collection<Citation> getMetadataStandards() {
- return Collections.emptyList();
- }
-
- /**
- * Citation(s) for the profile(s) of the metadata standard to which the metadata conform.
- */
- @Override
- public Collection<Citation> getMetadataProfiles() {
- return Collections.emptyList();
- }
-
- /**
- * Reference(s) to alternative metadata or metadata in a non-ISO standard for the same resource.
- */
- @Override
- public Collection<Citation> getAlternativeMetadataReferences() {
- return Collections.emptyList();
- }
-
- /**
* Online location(s) where the metadata is available.
*/
@Override
- public Collection<OnlineResource> getMetadataLinkages() {
- return Collections.emptyList();
- }
-
- /**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getIdentificationInfo()} followed by
- * {@link Identification#getCitation()} followed by {@link Citation#getOnlineResources()}.
- */
- @Override
- @Deprecated
public String getDataSetUri() {
return null;
}
@@ -342,7 +239,6 @@ public class SimpleMetadata implements M
* @see #getPointOfContacts()
* @see #getSpatialRepresentationTypes()
* @see #getSpatialResolutions()
- * @see #getTemporalResolutions()
* @see #getTopicCategories()
* @see #getExtents()
* @see #getResourceFormats()
@@ -365,8 +261,8 @@ public class SimpleMetadata implements M
* Information about the distributor of and options for obtaining the resource(s).
*/
@Override
- public Collection<Distribution> getDistributionInfo() {
- return Collections.emptyList();
+ public Distribution getDistributionInfo() {
+ return null;
}
/**
@@ -417,14 +313,6 @@ public class SimpleMetadata implements M
return null;
}
- /**
- * Information about the provenance, sources and/or the production processes applied to the resource.
- */
- @Override
- public Collection<Lineage> getResourceLineages() {
- return Collections.emptyList();
- }
-
/* -------------------------------------------------------------------------------------------------
* Implementation of the DataIdentification object returned by Metadata.getIdentificationInfo().
@@ -463,7 +351,7 @@ public class SimpleMetadata implements M
* This is part of the information returned by {@link #getIdentificationInfo()}.
*/
@Override
- public Collection<InternationalString> getCredits() {
+ public Collection<String> getCredits() {
return Collections.emptyList();
}
@@ -481,7 +369,7 @@ public class SimpleMetadata implements M
* This is part of the information returned by {@link #getIdentificationInfo()}.
*/
@Override
- public Collection<Responsibility> getPointOfContacts() {
+ public Collection<ResponsibleParty> getPointOfContacts() {
return Collections.emptyList();
}
@@ -506,15 +394,6 @@ public class SimpleMetadata implements M
}
/**
- * Smallest resolvable temporal period in a resource.
- * This is part of the information returned by {@link #getIdentificationInfo()}.
- */
- @Override
- public Collection<Duration> getTemporalResolutions() {
- return Collections.emptyList();
- }
-
- /**
* Main theme(s) of the resource.
* This is part of the information returned by {@link #getIdentificationInfo()}.
* Default implementation returns {@link TopicCategory#LOCATION}.
@@ -535,24 +414,6 @@ public class SimpleMetadata implements M
}
/**
- * Other documentation associated with the resource.
- * This is part of the information returned by {@link #getIdentificationInfo()}.
- */
- @Override
- public Collection<Citation> getAdditionalDocumentations() {
- return Collections.emptyList();
- }
-
- /**
- * Code that identifies the level of processing in the producers coding system of a resource.
- * This is part of the information returned by {@link #getIdentificationInfo()}.
- */
- @Override
- public Identifier getProcessingLevel() {
- return null;
- }
-
- /**
* Information about the frequency of resource updates, and the scope of those updates.
* This is part of the information returned by {@link #getIdentificationInfo()}.
*/
@@ -608,16 +469,7 @@ public class SimpleMetadata implements M
}
/**
- * Associated resource information.
- * This is part of the information returned by {@link #getIdentificationInfo()}.
- */
- @Override
- public Collection<AssociatedResource> getAssociatedResources() {
- return Collections.emptyList();
- }
-
- /**
- * @deprecated As of ISO 19115:2014, replaced by {@link #getAssociatedResources()}.
+ * @deprecated As of ISO 19115:2014, replaced by {@code getAssociatedResources()}.
*/
@Override
@Deprecated
@@ -709,7 +561,7 @@ public class SimpleMetadata implements M
* This is part of the information returned by {@link #getCitation()}.
*/
@Override
- public Collection<Responsibility> getCitedResponsibleParties() {
+ public Collection<ResponsibleParty> getCitedResponsibleParties() {
return Collections.emptyList();
}
@@ -738,8 +590,8 @@ public class SimpleMetadata implements M
* This is part of the information returned by {@link #getCitation()}.
*/
@Override
- public Collection<InternationalString> getOtherCitationDetails() {
- return Collections.emptyList();
+ public InternationalString getOtherCitationDetails() {
+ return null;
}
/**
@@ -768,22 +620,4 @@ public class SimpleMetadata implements M
public String getISSN() {
return null;
}
-
- /**
- * Online references to the cited resource.
- * This is part of the information returned by {@link #getCitation()}.
- */
- @Override
- public Collection<OnlineResource> getOnlineResources() {
- return Collections.emptyList();
- }
-
- /**
- * Citation graphics or logo for cited party.
- * This is part of the information returned by {@link #getCitation()}.
- */
- @Override
- public Collection<BrowseGraphic> getGraphics() {
- return Collections.emptyList();
- }
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -65,7 +65,7 @@ import org.apache.sis.internal.metadata.
import org.apache.sis.internal.metadata.OtherLocales;
import org.apache.sis.internal.metadata.Dependencies;
import org.apache.sis.internal.util.CollectionsExt;
-import org.apache.sis.internal.jaxb.gmd.LocaleAdapter;
+import org.apache.sis.internal.jaxb.lan.LocaleAdapter;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.internal.jaxb.Context;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -689,9 +689,9 @@ public final class Citations extends Sta
*
* @since 0.6
*/
- @SuppressWarnings("deprecation")
public static String getUnicodeIdentifier(final Citation citation) {
- return org.apache.sis.internal.util.Citations.getUnicodeIdentifier(citation);
+ return org.apache.sis.internal.util.Citations.removeIgnorableCharacters(
+ org.apache.sis.internal.util.Citations.getIdentifier(citation, true));
}
/**
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -27,7 +27,7 @@ import org.opengis.metadata.citation.Cit
import org.opengis.metadata.content.FeatureCatalogueDescription;
import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
-import org.apache.sis.internal.jaxb.gmd.LocaleAdapter;
+import org.apache.sis.internal.jaxb.lan.LocaleAdapter;
import org.apache.sis.internal.metadata.Dependencies;
import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -130,6 +130,7 @@ import javax.xml.bind.annotation.adapter
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import org.apache.sis.xml.Namespaces;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.lan.PT_Locale;
import org.apache.sis.internal.jaxb.gco.*;
import org.apache.sis.internal.jaxb.code.*;
import org.apache.sis.internal.jaxb.metadata.*;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -29,7 +29,7 @@ import org.apache.sis.xml.Namespaces;
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
-import org.apache.sis.internal.jaxb.gmx.MimeFileTypeAdapter;
+import org.apache.sis.internal.jaxb.gcx.MimeFileTypeAdapter;
import org.opengis.util.InternationalString;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -89,7 +89,7 @@
@XmlJavaTypeAdapter(CI_Responsibility.class),
@XmlJavaTypeAdapter(GO_DateTime.class),
@XmlJavaTypeAdapter(GO_Integer.class),
- @XmlJavaTypeAdapter(GO_LocalName.class),
+ @XmlJavaTypeAdapter(GO_GenericName.class),
@XmlJavaTypeAdapter(GO_Real.class),
@XmlJavaTypeAdapter(MD_DigitalTransferOptions.class),
@XmlJavaTypeAdapter(MD_Distributor.class),
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -27,7 +27,7 @@ import org.opengis.metadata.citation.Onl
import org.opengis.metadata.constraint.Constraints;
import org.opengis.metadata.identification.BrowseGraphic;
import org.apache.sis.metadata.iso.ISOMetadata;
-import org.apache.sis.internal.jaxb.gmx.MimeFileTypeAdapter;
+import org.apache.sis.internal.jaxb.gcx.MimeFileTypeAdapter;
import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.xml.Namespaces;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -29,7 +29,7 @@ import org.opengis.metadata.identificati
import org.opengis.metadata.identification.TopicCategory;
import org.opengis.metadata.identification.DataIdentification;
import org.apache.sis.internal.metadata.OtherLocales;
-import org.apache.sis.internal.jaxb.gmd.LocaleAdapter;
+import org.apache.sis.internal.jaxb.lan.LocaleAdapter;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.internal.util.CollectionsExt;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -160,6 +160,7 @@ import javax.xml.bind.annotation.adapter
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import org.apache.sis.xml.Namespaces;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.lan.PT_Locale;
import org.apache.sis.internal.jaxb.gco.*;
import org.apache.sis.internal.jaxb.gts.*;
import org.apache.sis.internal.jaxb.code.*;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -142,6 +142,7 @@ import javax.xml.bind.annotation.adapter
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import org.apache.sis.xml.Namespaces;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.lan.PT_Locale;
import org.apache.sis.internal.jaxb.gco.*;
import org.apache.sis.internal.jaxb.code.*;
import org.apache.sis.internal.jaxb.metadata.*;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -225,7 +225,6 @@ public class DefaultNameFactory extends
*
* @see Names#createMemberName(CharSequence, String, CharSequence, Class)
*/
- @Override
public MemberName createMemberName(final NameSpace scope, final CharSequence name, final TypeName attributeType) {
return pool.unique(new DefaultMemberName(scope, name, attributeType));
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordSchema.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -29,7 +29,6 @@ import org.opengis.util.NameFactory;
import org.opengis.util.NameSpace;
import org.opengis.util.RecordSchema;
import org.opengis.util.RecordType;
-import org.opengis.feature.AttributeType;
import org.apache.sis.util.Debug;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.ObjectConverter;
@@ -83,14 +82,13 @@ public class DefaultRecordSchema impleme
/**
* The factory to use for creating names.
* This is the factory given at construction time.
+ *
+ * <div class="warning"><b>Upcoming API change</b> — generalization<br>
+ * This field type will be changed to the {@link NameFactory} interface when that interface
+ * will provide a {@code createMemberName(…)} method (tentatively in GeoAPI 3.1).
+ * </div>
*/
- protected final NameFactory nameFactory;
-
- /**
- * The helper class to use for mapping Java classes to {@code TypeName} instances, or {@code null} if not needed.
- * This helper class is needed only if {@link #nameFactory} is not an instance of {@link DefaultNameFactory}.
- */
- private final TypeNames typeFactory;
+ protected final DefaultNameFactory nameFactory;
/**
* The namespace of {@link RecordType} to be created by this class.
@@ -122,17 +120,21 @@ public class DefaultRecordSchema impleme
/**
* Creates a new schema of the given name.
*
+ * <div class="warning"><b>Upcoming API change</b> — generalization<br>
+ * This type of the first argument will be changed to the {@link NameFactory} interface when
+ * that interface will provide a {@code createMemberName(…)} method (tentatively in GeoAPI 3.1).
+ * </div>
+ *
* @param nameFactory the factory to use for creating names, or {@code null} for the default factory.
* @param parent the parent namespace, or {@code null} if none.
* @param schemaName the name of the new schema.
*/
- public DefaultRecordSchema(NameFactory nameFactory, final NameSpace parent, final CharSequence schemaName) {
+ public DefaultRecordSchema(DefaultNameFactory nameFactory, final NameSpace parent, final CharSequence schemaName) {
ArgumentChecks.ensureNonNull("schemaName", schemaName);
if (nameFactory == null) {
- nameFactory = DefaultFactories.forBuildin(NameFactory.class);
+ nameFactory = DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class);
}
this.nameFactory = nameFactory;
- this.typeFactory = (nameFactory instanceof DefaultNameFactory) ? null : new TypeNames(nameFactory);
this.namespace = nameFactory.createNameSpace(nameFactory.createLocalName(parent, schemaName), null);
this.description = new WeakValueHashMap<>(TypeName.class);
this.attributeTypes = new ConcurrentHashMap<>();
@@ -188,7 +190,7 @@ public class DefaultRecordSchema impleme
if (!e2.getKey().tip().toString().equals(e1.toString())) {
break; // Member names differ.
}
- if (!((AttributeType) e2.getValue()).getValueClass().equals(e1.getValue())) {
+ if (!((SimpleAttributeType) e2.getValue()).getValueClass().equals(e1.getValue())) {
break; // Value classes differ.
}
}
@@ -212,12 +214,7 @@ public class DefaultRecordSchema impleme
if (valueClass == Void.TYPE) {
throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2, "valueClass", "void"));
}
- final TypeName name;
- if (nameFactory instanceof DefaultNameFactory) {
- name = ((DefaultNameFactory) nameFactory).toTypeName(valueClass);
- } else {
- name = typeFactory.toTypeName(nameFactory, valueClass);
- }
+ final TypeName name = nameFactory.toTypeName(valueClass);
type = new SimpleAttributeType<>(name, valueClass);
final Type old = attributeTypes.putIfAbsent(valueClass, type);
if (old != null) { // May happen if the type has been computed concurrently.
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -33,7 +33,6 @@ import org.opengis.util.LocalName;
import org.opengis.util.MemberName;
import org.opengis.util.GenericName;
import org.opengis.util.NameSpace;
-import org.opengis.util.NameFactory;
import org.opengis.util.Record;
import org.opengis.util.RecordType;
import org.opengis.util.RecordSchema;
@@ -192,7 +191,7 @@ public class DefaultRecordType extends R
* @param nameFactory the factory to use for instantiating {@link MemberName}.
*/
DefaultRecordType(final TypeName typeName, final RecordSchema container,
- final Map<? extends CharSequence, ? extends Type> members, final NameFactory nameFactory)
+ final Map<? extends CharSequence, ? extends Type> members, final DefaultNameFactory nameFactory)
{
this.typeName = typeName;
this.container = container;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/RecordDefinition.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -26,13 +26,13 @@ import javax.xml.bind.annotation.XmlTran
import org.opengis.util.Type;
import org.opengis.util.RecordType;
import org.opengis.util.MemberName;
-import org.opengis.feature.AttributeType;
import org.apache.sis.util.Debug;
import org.apache.sis.util.Classes;
import org.apache.sis.util.Numbers;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.collection.Containers;
import org.apache.sis.internal.util.CollectionsExt;
+import org.apache.sis.internal.simple.SimpleAttributeType;
/**
@@ -153,8 +153,8 @@ abstract class RecordDefinition {
int i = 0;
for (final Map.Entry<? extends MemberName, ? extends Type> entry : memberTypes.entrySet()) {
final Type type = entry.getValue();
- if (type instanceof AttributeType) {
- final Class<?> c = ((AttributeType) type).getValueClass();
+ if (type instanceof SimpleAttributeType) {
+ final Class<?> c = ((SimpleAttributeType) type).getValueClass();
if (c != Object.class) {
if (valueClasses == null) {
valueClasses = new Class<?>[size];
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -29,7 +29,6 @@ import java.io.InputStream;
import org.opengis.annotation.UML;
import org.opengis.util.CodeList;
import org.opengis.util.InternationalString;
-import org.opengis.util.ControlledVocabulary;
import org.apache.sis.util.Static;
import org.apache.sis.util.Locales;
import org.apache.sis.util.CharSequences;
@@ -47,14 +46,14 @@ import org.apache.sis.internal.system.Lo
*
* <ul>
* <li>Methods for fetching the ISO name or description of a code list:<ul>
- * <li>{@link #getStandardName(Class)} for ISO name</li>
- * <li>{@link #getListName(ControlledVocabulary)} for ISO name</li>
- * <li>{@link #getDescription(Class)} for a description</li>
+ * <li>{@link #getStandardName(Class)} for ISO name</li>
+ * <li>{@link #getListName(CodeList)} for ISO name</li>
+ * <li>{@link #getDescription(Class)} for a description</li>
* </ul></li>
* <li>Methods for fetching the ISO name or description of a code value:<ul>
- * <li>{@link #getCodeName(ControlledVocabulary)} for ISO name,</li>
- * <li>{@link #getCodeTitle(ControlledVocabulary)} for a label or title</li>
- * <li>{@link #getDescription(ControlledVocabulary)} for a more verbose description</li>
+ * <li>{@link #getCodeName(CodeList)} for ISO name,</li>
+ * <li>{@link #getCodeTitle(CodeList)} for a label or title</li>
+ * <li>{@link #getDescription(CodeList)} for a more verbose description</li>
* </ul></li>
* <li>Methods for fetching an instance from a name (converse of above {@code get} methods):<ul>
* <li>{@link #forCodeName(Class, String, boolean)}</li>
@@ -84,7 +83,7 @@ import org.apache.sis.internal.system.Lo
* Such substitution can be done with:
*
* <ul>
- * <li>{@link #getCodeTitle(ControlledVocabulary)} for getting the {@link InternationalString} instance
+ * <li>{@link #getCodeTitle(CodeList)} for getting the {@link InternationalString} instance
* to store in a metadata property.</li>
* <li>{@link #forCodeTitle(CharSequence)} for retrieving the {@link CodeList} previously stored as an
* {@code InternationalString}.</li>
@@ -175,11 +174,11 @@ public final class Types extends Static
* @param code the code for which to get the class name, or {@code null}.
* @return the ISO (preferred) or Java (fallback) class name, or {@code null} if the given code is null.
*/
- public static String getListName(final ControlledVocabulary code) {
+ public static String getListName(final CodeList<?> code) {
if (code == null) {
return null;
}
- final Class<?> type = (code instanceof Enum<?>) ? ((Enum<?>) code).getDeclaringClass() : code.getClass();
+ final Class<?> type = code.getClass();
final String id = getStandardName(type);
return (id != null) ? id : type.getSimpleName();
}
@@ -200,12 +199,12 @@ public final class Types extends Static
* @param code the code for which to get the name, or {@code null}.
* @return the UML identifiers or programmatic name for the given code, or {@code null} if the given code is null.
*
- * @see #getCodeLabel(ControlledVocabulary)
- * @see #getCodeTitle(ControlledVocabulary)
- * @see #getDescription(ControlledVocabulary)
+ * @see #getCodeLabel(CodeList)
+ * @see #getCodeTitle(CodeList)
+ * @see #getDescription(CodeList)
* @see #forCodeName(Class, String, boolean)
*/
- public static String getCodeName(final ControlledVocabulary code) {
+ public static String getCodeName(final CodeList<?> code) {
if (code == null) {
return null;
}
@@ -217,7 +216,7 @@ public final class Types extends Static
* Returns a unlocalized title for the given enumeration or code list value.
* This method builds a title using heuristics rules, which should give reasonable
* results without the need of resource bundles. For better results, consider using
- * {@link #getCodeTitle(ControlledVocabulary)} instead.
+ * {@link #getCodeTitle(CodeList)} instead.
*
* <p>The current heuristic implementation iterates over {@linkplain CodeList#names() all code names},
* selects the longest one excluding the {@linkplain CodeList#name() field name} if possible, then
@@ -234,11 +233,11 @@ public final class Types extends Static
* @param code the code from which to get a title, or {@code null}.
* @return a unlocalized title for the given code, or {@code null} if the given code is null.
*
- * @see #getCodeName(ControlledVocabulary)
- * @see #getCodeTitle(ControlledVocabulary)
- * @see #getDescription(ControlledVocabulary)
+ * @see #getCodeName(CodeList)
+ * @see #getCodeTitle(CodeList)
+ * @see #getDescription(CodeList)
*/
- public static String getCodeLabel(final ControlledVocabulary code) {
+ public static String getCodeLabel(final CodeList<?> code) {
if (code == null) {
return null;
}
@@ -257,7 +256,7 @@ public final class Types extends Static
/**
* Returns the title of the given enumeration or code list value. Title are usually much shorter than descriptions.
- * English titles are often the same than the {@linkplain #getCodeLabel(ControlledVocabulary) code labels}.
+ * English titles are often the same than the {@linkplain #getCodeLabel(CodeList) code labels}.
*
* <p>The code or enumeration value given in argument to this method can be retrieved from the returned title
* with the {@link #forCodeTitle(CharSequence)} method. See <cite>Substituting a free text by a code list</cite>
@@ -266,10 +265,10 @@ public final class Types extends Static
* @param code the code for which to get the title, or {@code null}.
* @return the title, or {@code null} if the given code is null.
*
- * @see #getDescription(ControlledVocabulary)
+ * @see #getDescription(CodeList)
* @see #forCodeTitle(CharSequence)
*/
- public static InternationalString getCodeTitle(final ControlledVocabulary code) {
+ public static InternationalString getCodeTitle(final CodeList<?> code) {
return (code != null) ? new CodeTitle(code) : null;
}
@@ -281,10 +280,10 @@ public final class Types extends Static
* @param code the code for which to get the localized description, or {@code null}.
* @return the description, or {@code null} if none or if the given code is null.
*
- * @see #getCodeTitle(ControlledVocabulary)
+ * @see #getCodeTitle(CodeList)
* @see #getDescription(Class)
*/
- public static InternationalString getDescription(final ControlledVocabulary code) {
+ public static InternationalString getDescription(final CodeList<?> code) {
if (code != null) {
final String resources = getResources(code.getClass().getName());
if (resources != null) {
@@ -301,7 +300,7 @@ public final class Types extends Static
* @param type the GeoAPI interface or code list from which to get the description, or {@code null}.
* @return the description, or {@code null} if none or if the given type is {@code null}.
*
- * @see #getDescription(ControlledVocabulary)
+ * @see #getDescription(CodeList)
*/
public static InternationalString getDescription(final Class<?> type) {
final String name = getStandardName(type);
@@ -400,7 +399,7 @@ public final class Types extends Static
/**
* Returns the resource key for the given code list.
*/
- static String resourceKey(final ControlledVocabulary code) {
+ static String resourceKey(final CodeList<?> code) {
String key = getCodeName(code);
if (key.indexOf(SEPARATOR) < 0) {
key = getListName(code) + SEPARATOR + key;
@@ -430,14 +429,14 @@ public final class Types extends Static
/**
* The code list for which to create a title.
*/
- final ControlledVocabulary code;
+ final CodeList<?> code;
/**
* Creates a new international string for the given code list element.
*
* @param code the code list for which to create a title.
*/
- CodeTitle(final ControlledVocabulary code) {
+ CodeTitle(final CodeList<?> code) {
super(CodeLists.RESOURCES, resourceKey(code));
this.code = code;
}
@@ -467,21 +466,17 @@ public final class Types extends Static
}
/**
- * Returns all known values for the given type of code list or enumeration.
+ * Returns all known values for the given type of code list.
* Note that the size of the returned array may growth between different invocations of this method,
* since users can add their own codes to an existing list.
*
- * <div class="note"><b>Note:</b>
- * This method works with both {@link Enum} and {@link CodeList}. However if the type is known to be an
- * {@code Enum}, then the standard {@link Class#getEnumConstants()} method is more efficient.</div>
- *
* @param <T> the compile-time type given as the {@code codeType} parameter.
- * @param codeType the type of code list or enumeration.
- * @return the list of values for the given code list or enumeration, or an empty array if none.
+ * @param codeType the type of code list.
+ * @return the list of values for the given code list, or an empty array if none.
*
* @see Class#getEnumConstants()
*/
- public static <T extends ControlledVocabulary> T[] getCodeValues(final Class<T> codeType) {
+ public static <T extends CodeList<?>> T[] getCodeValues(final Class<T> codeType) {
return CodeLists.values(codeType);
}
@@ -516,7 +511,7 @@ public final class Types extends Static
return null;
}
if (typeForNames == null) {
- final Class<UML> c = UML.class;
+ final Class<Types> c = Types.class;
final InputStream in = c.getResourceAsStream("class-index.properties");
if (in == null) {
throw new MissingResourceException("class-index.properties", c.getName(), identifier);
@@ -594,7 +589,7 @@ public final class Types extends Static
* @return a code matching the given name, or {@code null} if the name is null
* or if no matching code is found and {@code canCreate} is {@code false}.
*
- * @see #getCodeName(ControlledVocabulary)
+ * @see #getCodeName(CodeList)
* @see CodeList#valueOf(Class, String)
*/
public static <T extends CodeList<T>> T forCodeName(final Class<T> codeType, String name, final boolean canCreate) {
@@ -606,7 +601,7 @@ public final class Types extends Static
* The current implementation performs the following choice:
*
* <ul>
- * <li>If the given title is a value returned by a previous call to {@link #getCodeTitle(ControlledVocabulary)},
+ * <li>If the given title is a value returned by a previous call to {@link #getCodeTitle(CodeList)},
* returns the code or enumeration value used for creating that title.</li>
* <li>Otherwise returns {@code null}.</li>
* </ul>
@@ -614,11 +609,11 @@ public final class Types extends Static
* @param title the title for which to get a code or enumeration value, or {@code null}.
* @return the code or enumeration value associated with the given title, or {@code null}.
*
- * @see #getCodeTitle(ControlledVocabulary)
+ * @see #getCodeTitle(CodeList)
*
* @since 0.7
*/
- public static ControlledVocabulary forCodeTitle(final CharSequence title) {
+ public static CodeList<?> forCodeTitle(final CharSequence title) {
return (title instanceof CodeTitle) ? ((CodeTitle) title).code : null;
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/package-info.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/util/iso/package-info.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -26,7 +26,7 @@
* <li>{@link org.apache.sis.util.iso.SimpleInternationalString} for wrapping a single {@link java.lang.String};</li>
* <li>{@link org.apache.sis.util.iso.DefaultInternationalString} for providing many localizations in a {@link java.util.Map};</li>
* <li>{@link org.apache.sis.util.iso.ResourceInternationalString} for providing localizations from a {@link java.util.ResourceBundle}.</li>
- * <li>{@link org.apache.sis.util.iso.Types#getCodeTitle Types.getCodeTitle(ControlledVocabulary)} for wrapping a {@link org.opengis.util.CodeList} value.</li>
+ * <li>{@link org.apache.sis.util.iso.Types#getCodeTitle Types.getCodeTitle(CodeList)} for wrapping a {@link org.opengis.util.CodeList} value.</li>
* </ul>
* </li>
* <li>Implementations of {@link org.opengis.util.GenericName} (derived from ISO 19103):
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/LegacyCodes.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/LegacyCodes.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -19,13 +19,8 @@ package org.apache.sis.xml;
import java.util.Map;
import java.util.HashMap;
import java.util.Locale;
-import java.util.Properties;
-import java.io.InputStream;
-import java.io.IOException;
-import org.opengis.metadata.Metadata;
-import org.apache.sis.internal.system.Loggers;
+import org.opengis.metadata.identification.CharacterSet;
import org.apache.sis.util.collection.Containers;
-import org.apache.sis.util.logging.Logging;
/**
@@ -50,18 +45,15 @@ final class LegacyCodes {
*/
static final Map<String,String> IANA_TO_LEGACY, LEGACY_TO_IANA;
static {
- final Properties codes = new Properties();
- try (InputStream in = Metadata.class.getResourceAsStream("2003/charset-codes.properties")) {
- codes.load(in);
- } catch (IOException e) {
- Logging.unexpectedException(Logging.getLogger(Loggers.XML), ValueConverter.class, "toCharset[Code]", e);
- }
- final int capacity = Containers.hashMapCapacity(codes.size());
+ final CharacterSet[] codes = CharacterSet.values();
+ final int capacity = Containers.hashMapCapacity(codes.length);
IANA_TO_LEGACY = new HashMap<>(capacity);
LEGACY_TO_IANA = new HashMap<>(capacity);
- for (final Map.Entry<Object,Object> entry : codes.entrySet()) {
- final String legacy = ((String) entry.getKey()).intern();
- final String name = ((String) entry.getValue()).intern();
+ for (final CharacterSet code : codes) {
+ final String legacy = code.identifier().intern();
+ final String[] names = code.names();
+ String name = names[names.length - 1];
+ if (name.equals("ebcdic")) name = "EBCDIC"; // Missing IANA name in GeoAPI CharacterSet.
IANA_TO_LEGACY.put(name .toUpperCase(Locale.US), legacy); // IANA names are restricted to US-ASCII.
LEGACY_TO_IANA.put(legacy.toLowerCase(Locale.US), name);
IANA_TO_LEGACY.put(name, legacy);
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -24,7 +24,7 @@ import javax.xml.bind.JAXBException;
import org.opengis.metadata.citation.Role;
import org.opengis.metadata.citation.DateType;
import org.opengis.metadata.citation.CitationDate;
-import org.opengis.metadata.citation.Responsibility;
+import org.opengis.metadata.citation.ResponsibleParty;
import org.opengis.metadata.citation.PresentationForm;
import org.apache.sis.metadata.iso.citation.DefaultCitation;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
@@ -105,7 +105,7 @@ public final strictfp class CodeListMars
@Test
public void testDefaultURL() throws JAXBException {
final String expected = getResponsiblePartyXML(Schemas.METADATA_ROOT_LEGACY);
- final Responsibility rp = (Responsibility) XML.unmarshal(expected);
+ final ResponsibleParty rp = (ResponsibleParty) XML.unmarshal(expected);
assertEquals(Role.PRINCIPAL_INVESTIGATOR, rp.getRole());
/*
* Use the convenience method in order to avoid the effort of creating
@@ -123,7 +123,7 @@ public final strictfp class CodeListMars
@Test
public void testISO_URL() throws JAXBException {
final String expected = getResponsiblePartyXML("http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/");
- final Responsibility rp = (Responsibility) XML.unmarshal(expected);
+ final ResponsibleParty rp = (ResponsibleParty) XML.unmarshal(expected);
assertEquals(Role.PRINCIPAL_INVESTIGATOR, rp.getRole());
final MarshallerPool pool = getMarshallerPool();
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/EnumMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/EnumMarshallingTest.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/EnumMarshallingTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/EnumMarshallingTest.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -17,7 +17,6 @@
package org.apache.sis.internal.jaxb.cat;
import java.util.Arrays;
-import java.util.EnumSet;
import java.util.Collection;
import javax.xml.bind.JAXBException;
import org.opengis.metadata.identification.TopicCategory;
@@ -72,7 +71,6 @@ public final strictfp class EnumMarshall
* Unmarshall the above XML and verify that we find all the topic categories.
*/
final Collection<TopicCategory> unmarshalled = unmarshal(DefaultDataIdentification.class, expected).getTopicCategories();
- assertInstanceOf("topicCategory", EnumSet.class, unmarshalled);
assertSetEquals(topics, unmarshalled);
}
}
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/gml/DummyInstant.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -17,12 +17,7 @@
package org.apache.sis.internal.jaxb.gml;
import java.util.Date;
-import org.opengis.temporal.Instant;
-import org.opengis.temporal.Duration;
-import org.opengis.temporal.RelativePosition;
-import org.opengis.temporal.TemporalPosition;
-import org.opengis.temporal.TemporalPrimitive;
-import org.opengis.temporal.TemporalGeometricPrimitive;
+import org.apache.sis.internal.geoapi.temporal.Instant;
import org.apache.sis.internal.simple.SimpleIdentifiedObject;
@@ -56,12 +51,4 @@ final class DummyInstant extends SimpleI
public Date getDate() {
return new Date(time);
}
-
- /**
- * Unsupported operations.
- */
- @Override public Duration length() {throw new UnsupportedOperationException();}
- @Override public RelativePosition relativePosition(TemporalPrimitive other) {throw new UnsupportedOperationException();}
- @Override public Duration distance(TemporalGeometricPrimitive other) {throw new UnsupportedOperationException();}
- @Override public TemporalPosition getTemporalPosition() {throw new UnsupportedOperationException();}
}
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java?rev=1826246&r1=1825489&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -36,7 +36,6 @@ import org.junit.AfterClass;
import org.junit.Test;
import static org.apache.sis.test.MetadataAssert.*;
-import static org.apache.sis.test.TestUtilities.getSingleton;
import static org.apache.sis.internal.util.StandardDateFormat.UTC;
@@ -166,7 +165,7 @@ public final strictfp class LanguageCode
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
final String xml = getMetadataXML(LANGUAGE_CODE);
final Metadata metadata = (Metadata) unmarshal(unmarshaller, xml);
- assertEquals(Locale.JAPANESE, getSingleton(metadata.getLanguages()));
+ assertEquals(Locale.JAPANESE, metadata.getLanguage());
}
/**
@@ -189,7 +188,7 @@ public final strictfp class LanguageCode
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
final String xml = getMetadataXML(LANGUAGE_CODE_WITHOUT_ATTRIBUTE);
final Metadata metadata = (Metadata) unmarshal(unmarshaller, xml);
- assertEquals(Locale.JAPANESE, getSingleton(metadata.getLanguages()));
+ assertEquals(Locale.JAPANESE, metadata.getLanguage());
pool.recycle(unmarshaller);
}
@@ -231,7 +230,7 @@ public final strictfp class LanguageCode
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
final String xml = getMetadataXML(CHARACTER_STRING);
final Metadata metadata = (Metadata) unmarshal(unmarshaller, xml);
- assertEquals(Locale.JAPANESE, getSingleton(metadata.getLanguages()));
+ assertEquals(Locale.JAPANESE, metadata.getLanguage());
pool.recycle(unmarshaller);
}
}
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java?rev=1826246&r1=1826245&r2=1826246&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java [UTF-8] Thu Mar 8 15:30:28 2018
@@ -23,7 +23,7 @@ import org.apache.sis.util.iso.Names;
import org.apache.sis.test.XMLTestCase;
import org.junit.Test;
-import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
/**