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 2017/08/20 16:24:04 UTC
svn commit: r1805571 [2/2] - in /sis/branches/Android: ./
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ co...
Modified: sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -44,17 +44,17 @@ import org.apache.sis.internal.referenci
import org.apache.sis.internal.util.UnmodifiableArrayList;
import org.apache.sis.internal.storage.MetadataBuilder;
import org.apache.sis.internal.storage.io.IOUtilities;
-import org.apache.sis.internal.storage.FeatureStore;
import org.apache.sis.internal.feature.Geometries;
import org.apache.sis.internal.feature.MovingFeature;
import org.apache.sis.internal.storage.Resources;
import org.apache.sis.geometry.GeneralEnvelope;
import org.apache.sis.metadata.iso.DefaultMetadata;
import org.apache.sis.metadata.sql.MetadataStoreException;
+import org.apache.sis.storage.Resource;
+import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreContentException;
import org.apache.sis.storage.DataStoreReferencingException;
-import org.apache.sis.storage.IllegalNameException;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.setup.OptionKey;
import org.apache.sis.util.ArraysExt;
@@ -80,7 +80,7 @@ import org.apache.sis.feature.AbstractId
* @since 0.7
* @module
*/
-public final class Store extends FeatureStore {
+public final class Store extends DataStore {
/**
* The character at the beginning of lines to ignore in the header.
* Note that this is not part of OGC Moving Feature Specification.
@@ -108,12 +108,24 @@ public final class Store extends Feature
static final char ORDINATE_SEPARATOR = ' ';
/**
- * The prefix for elements in the {@code @columns} line that specify the data type.
+ * The prefix for elements in the {@code @columns} line that specify the data type,
+ * as required by the OGC CSV encoding specification.
* Examples: {@code xsd:boolean}, {@code xsd:decimal}, {@code xsd:integer}, <i>etc</i>.
+ *
+ * <p>Note that this prefix is slightly different than the {@code "xs:"} prefix used
+ * in {@code https://www.w3.org/2009/XMLSchema/XMLSchema.xsd} file. This data store
+ * implementation accepts both.</p>
*/
private static final String TYPE_PREFIX = "xsd:";
/**
+ * The prefix used in {@code https://www.w3.org/2009/XMLSchema/XMLSchema.xsd} file.
+ * This is not the same prefix than the one specified by OGC CSV encoding, but this
+ * implementation accepts both.
+ */
+ private static final String XS_PREFIX = "xs:";
+
+ /**
* The reader, set by the constructor and cleared when no longer needed.
*
* @see #readLine()
@@ -470,8 +482,11 @@ public final class Store extends Feature
Class<?> type = null;
if (++i < size) {
String tn = elements.get(i);
- if (!tn.isEmpty() && tn.regionMatches(true, 0, TYPE_PREFIX, 0, TYPE_PREFIX.length())) {
- String st = tn.substring(TYPE_PREFIX.length()).toLowerCase(Locale.US);
+ int length;
+ if (tn.regionMatches(true, 0, TYPE_PREFIX, 0, length = TYPE_PREFIX.length()) ||
+ tn.regionMatches(true, 0, XS_PREFIX, 0, length = XS_PREFIX.length()))
+ {
+ String st = tn.substring(length).toLowerCase(Locale.US);
switch (st) {
case "boolean": type = Boolean.class; break;
case "decimal": type = Double .class; break;
@@ -601,28 +616,13 @@ public final class Store extends Feature
}
/**
- * Returns the feature type for the given name. The {@code name} argument should be the
- * value specified at the following path (only one such value exists for a CSV data store):
+ * Returns the {@code FeatureSet} from which all features in this data store can be accessed.
*
- * <blockquote>
- * {@link #getMetadata()} /
- * {@link org.apache.sis.metadata.iso.DefaultMetadata#getContentInfo() contentInfo} /
- * {@link org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription#getFeatureTypeInfo() featureTypes} /
- * {@link org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo#getFeatureTypeName() featureTypeName}
- * </blockquote>
- *
- * @param name the name of the feature type to get.
- * @return the feature type of the given name (never {@code null}).
- * @throws IllegalNameException if the given name was not found.
- *
- * @since 0.8
+ * @return the starting point of all features in this data store.
*/
@Override
- public DefaultFeatureType getFeatureType(String name) throws IllegalNameException {
- if (featureType.getName().toString().equals(name)) {
- return featureType;
- }
- throw new IllegalNameException(getLocale(), getDisplayName(), name);
+ public Resource getRootResource() {
+ return new FeatureAccess(this, listeners);
}
/**
@@ -635,8 +635,7 @@ public final class Store extends Feature
* @todo Needs to reset the position when doing another pass on the features.
* @todo If sequential order, publish Feature as soon as identifier changed.
*/
- @Override
- public synchronized Stream<AbstractFeature> features(final boolean parallel) throws DataStoreException {
+ final synchronized Stream<AbstractFeature> features(final boolean parallel) throws DataStoreException {
/*
* If the user asks for one feature instance per line, then we can return a FeatureIter instance directly.
* Since each feature is fully constructed from a single line and each line are read atomically, we can
Modified: sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -17,8 +17,8 @@
package org.apache.sis.internal.storage.wkt;
import java.util.List;
-import java.util.ArrayList;
import java.util.Arrays;
+import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.io.Reader;
@@ -33,12 +33,13 @@ import org.apache.sis.internal.storage.R
import org.apache.sis.internal.system.Loggers;
import org.apache.sis.io.wkt.WKTFormat;
import org.apache.sis.io.wkt.Warnings;
+import org.apache.sis.storage.Resource;
import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreContentException;
import org.apache.sis.internal.referencing.DefinitionVerifier;
-import org.apache.sis.metadata.iso.DefaultMetadata;
+import org.apache.sis.internal.storage.MetadataBuilder;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.CharSequences;
@@ -171,7 +172,7 @@ final class Store extends DataStore {
/**
* Returns the metadata associated to the parsed objects, or {@code null} if none.
* The current implementation retains only instances of {@link ReferenceSystem}
- * and ignore other cases.
+ * and ignore other objects.
*
* @return the metadata associated to the parsed object, or {@code null} if none.
* @throws DataStoreException if an error occurred during the parsing process.
@@ -180,19 +181,28 @@ final class Store extends DataStore {
public synchronized Metadata getMetadata() throws DataStoreException {
if (metadata == null) {
parse();
- DefaultMetadata md = null;
+ final MetadataBuilder builder = new MetadataBuilder();
+ builder.addTitle(getDisplayName());
for (final Object object : objects) {
if (object instanceof ReferenceSystem) {
- if (md == null) md = new DefaultMetadata();
- md.getReferenceSystemInfo().add((ReferenceSystem) object);
+ builder.addReferenceSystem((ReferenceSystem) object);
}
}
- metadata = md;
+ metadata = builder.build(true);
}
return metadata;
}
/**
+ * There is currently no resource associated to Well Known Text format since we parse only CRS.
+ * Future versions may return resources if we parse also geometries.
+ */
+ @Override
+ public Resource getRootResource() throws DataStoreException {
+ return null;
+ }
+
+ /**
* Closes this data store and releases any underlying resources.
*
* @throws DataStoreException if an error occurred while closing this data store.
Modified: sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -30,6 +30,7 @@ import org.opengis.util.FactoryException
import org.opengis.referencing.ReferenceSystem;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.apache.sis.xml.XML;
+import org.apache.sis.storage.Resource;
import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.storage.DataStoreException;
@@ -37,10 +38,9 @@ import org.apache.sis.metadata.iso.Defau
import org.apache.sis.util.logging.WarningListener;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.storage.MetadataBuilder;
import org.apache.sis.internal.referencing.DefinitionVerifier;
-import static java.util.Collections.singleton;
-
/**
* A data store which creates data objects from a XML file.
@@ -199,15 +199,25 @@ final class Store extends DataStore {
if (object instanceof Metadata) {
metadata = (Metadata) object;
} else if (object instanceof ReferenceSystem) {
- final DefaultMetadata md = new DefaultMetadata();
- md.setReferenceSystemInfo(singleton((ReferenceSystem) object));
- metadata = md;
+ final MetadataBuilder builder = new MetadataBuilder();
+ builder.addReferenceSystem((ReferenceSystem) object);
+ builder.addTitle(getDisplayName());
+ metadata = builder.build(true);
}
}
return metadata;
}
/**
+ * Current implementation does not provide any resource since it is only about metadata.
+ * Futures versions may return resources if Apache SIS provides a wider GML support.
+ */
+ @Override
+ public Resource getRootResource() throws DataStoreException {
+ return null;
+ }
+
+ /**
* Closes this data store and releases any underlying resources.
*
* @throws DataStoreException if an error occurred while closing this data store.
Modified: sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -17,12 +17,17 @@
package org.apache.sis.storage;
import java.util.Locale;
+import java.util.Map;
+import java.util.IdentityHashMap;
import java.util.NoSuchElementException;
import org.opengis.metadata.Metadata;
+import org.opengis.metadata.identification.Identification;
import org.apache.sis.util.Localized;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.logging.WarningListener;
import org.apache.sis.util.logging.WarningListeners;
+import org.apache.sis.internal.storage.Resources;
+import org.apache.sis.internal.util.Citations;
/**
@@ -164,16 +169,107 @@ public abstract class DataStore implemen
}
/**
- * Returns information about the dataset as a whole. The returned metadata object, if any, can contain
- * information such as the spatiotemporal extent of the dataset, contact information about the creator
- * or distributor, data quality, update frequency, usage constraints and more.
+ * Returns information about the data store as a whole. The returned metadata object can contain
+ * information such as the spatiotemporal extent of all contained {@linkplain Resource resources},
+ * contact information about the creator or distributor, data quality, update frequency, usage constraints,
+ * file format and more.
*
- * @return information about the dataset, or {@code null} if none.
+ * @return information about resources in the data store, or {@code null} if none.
* @throws DataStoreException if an error occurred while reading the data.
+ *
+ * @see Resource#getMetadata()
*/
public abstract Metadata getMetadata() throws DataStoreException;
/**
+ * Returns the starting point from which all resources in this data store can be accessed.
+ * A resource can be for example a air temperature map or the set of all bridges in a city.
+ * If this data store contains only one resource, then that resource is returned directly.
+ * Otherwise if this data store contains more than one resource, then this method returns
+ * an {@link Aggregate} from which other resources can be accessed.
+ *
+ * @return the starting point of all resources in this data store,
+ * or {@code null} if this data store does not contain any resources.
+ * @throws DataStoreException if an error occurred while reading the data.
+ */
+ public abstract Resource getRootResource() throws DataStoreException;
+
+ /**
+ * Searches for a resource identified by the given identifier.
+ * The given identifier should match the following metadata element of a resource:
+ *
+ * <blockquote>{@link Resource#getMetadata() metadata} /
+ * {@link org.apache.sis.metadata.iso.DefaultMetadata#getIdentificationInfo() identificationInfo} /
+ * {@link org.apache.sis.metadata.iso.identification.AbstractIdentification#getCitation() citation} /
+ * {@link org.apache.sis.metadata.iso.citation.DefaultCitation#getIdentifiers() identifier}</blockquote>
+ *
+ * Implementation may also accept aliases for convenience. For example if the full name of a resource
+ * is {@code "foo:bar"}, then this method may accept {@code "bar"} as a synonymous of {@code "foo:bar"}
+ * provided that it does not introduce ambiguity.
+ *
+ * <p>The default implementation verifies the {@linkplain #getRootResource() root resource}, then iterates over
+ * components of {@link Aggregate}s. If a match is found without ambiguity, the associated resource is returned.
+ * Otherwise an exception is thrown. Subclasses are encouraged to override this method with a more efficient
+ * implementation.</p>
+ *
+ * @param identifier identifier of the resource to fetch. Must be non-null.
+ * @return resource associated to the given identifier (never {@code null}).
+ * @throws IllegalNameException if no resource is found for the given identifier, or if more than one resource is found.
+ * @throws DataStoreException if another kind of error occurred while searching resources.
+ */
+ public Resource findResource(final String identifier) throws DataStoreException {
+ ArgumentChecks.ensureNonEmpty("identifier", identifier);
+ final Resource resource = findResource(identifier, getRootResource(), new IdentityHashMap<Resource,Boolean>());
+ if (resource != null) {
+ return resource;
+ }
+ throw new IllegalNameException(Resources.forLocale(getLocale())
+ .getString(Resources.Keys.ResourceNotFound_2, getDisplayName(), identifier));
+ }
+
+ /**
+ * Recursively searches for a resource identified by the given identifier.
+ * This is the implementation of {@link #findResource(String)}.
+ *
+ * @param identifier identifier of the resource to fetch.
+ * @param candidate a resource to compare against the identifier.
+ * @param visited resources visited so-far, for avoiding never-ending loops if cycles exist.
+ * @return resource associated to the given identifier, or {@code null} if not found.
+ */
+ private Resource findResource(final String identifier, final Resource candidate,
+ final Map<Resource,Boolean> visited) throws DataStoreException
+ {
+ if (candidate != null && visited.put(candidate, Boolean.TRUE) == null) {
+ final Metadata metadata = candidate.getMetadata();
+ if (metadata != null) {
+ for (final Identification identification : metadata.getIdentificationInfo()) {
+ if (identification != null) { // Paranoiac check.
+ if (Citations.identifierMatches(identification.getCitation(), null, identifier)) {
+ return candidate;
+ }
+ }
+ }
+ }
+ if (candidate instanceof Aggregate) {
+ Resource result = null;
+ for (final Resource child : ((Aggregate) candidate).components()) {
+ final Resource match = findResource(identifier, child, visited);
+ if (match != null) {
+ if (result == null) {
+ result = match;
+ } else {
+ throw new IllegalNameException(Resources.forLocale(getLocale())
+ .getString(Resources.Keys.ResourceIdentifierCollision_2, getDisplayName(), identifier));
+ }
+ }
+ }
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
* Adds a listener to be notified when a warning occurred while reading from or writing to the storage.
* When a warning occurs, there is a choice:
*
Modified: sis/branches/Android/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -54,6 +54,11 @@ final strictfp class DataStoreMock exten
}
@Override
+ public Resource getRootResource() throws DataStoreException {
+ return null;
+ }
+
+ @Override
public void close() {
}
}
Modified: sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -21,6 +21,7 @@ import org.opengis.util.NameFactory;
import org.opengis.util.FactoryException;
import org.opengis.metadata.Metadata;
import org.opengis.metadata.distribution.Format;
+import org.apache.sis.storage.Resource;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreContentException;
@@ -167,14 +168,27 @@ public final class Store extends StaxDat
}
/**
+ * Returns the {@code FeatureSet} from which all features in this data store can be accessed.
+ *
+ * @return the starting point of all features in this data store.
+ */
+ @Override
+ public Resource getRootResource() {
+ return new FeatureAccess(this, listeners);
+ }
+
+ /**
* Returns the feature type for the given name. The {@code name} argument should be the result of calling
* {@link org.opengis.util.GenericName#toString()} on the name of one of the feature types in this data store.
*
* @param name the name or alias of the feature type to get.
* @return the feature type of the given name or alias (never {@code null}).
* @throws IllegalNameException if the given name was not found or is ambiguous.
+ *
+ * @deprecated We are not sure yet if we will keep this method. Decision is pending acquisition of
+ * more experience with the API proposed by {@link org.apache.sis.storage.FeatureSet}.
*/
- @Override
+ @Deprecated
public DefaultFeatureType getFeatureType(final String name) throws IllegalNameException {
return types.names.get(this, name);
}
@@ -182,12 +196,10 @@ public final class Store extends StaxDat
/**
* Returns the stream of features.
*
- * @param parallel ignored in current implementation.
* @return a stream over all features in the XML file.
* @throws DataStoreException if an error occurred while creating the feature stream.
*/
- @Override
- public synchronized Stream<AbstractFeature> features(final boolean parallel) throws DataStoreException {
+ final synchronized Stream<AbstractFeature> features() throws DataStoreException {
Reader r = reader;
reader = null;
if (r == null) try {
Modified: sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -64,6 +64,11 @@ import org.apache.sis.feature.DefaultAtt
*/
final class Types {
/**
+ * The parent of all other feature types.
+ */
+ final DefaultFeatureType parent;
+
+ /**
* Way point GPX feature type.
*/
final DefaultFeatureType wayPoint;
@@ -91,7 +96,11 @@ final class Types {
/**
* Binding from names to feature type instances.
* Shall not be modified after construction.
+ *
+ * @deprecated We are not sure yet if we will keep this field. Decision is pending acquisition of
+ * more experience with the API proposed by {@link org.apache.sis.storage.FeatureSet}.
*/
+ @Deprecated
final FeatureNaming<DefaultFeatureType> names;
/**
@@ -143,34 +152,34 @@ final class Types {
final FeatureTypeBuilder builder = new FeatureTypeBuilder(factory, library, locale);
builder.setNameSpace(Tags.PREFIX).setName("GPXEntity").setAbstract(true);
builder.addAttribute(Integer.class).setName(AttributeConvention.IDENTIFIER_PROPERTY);
- final DefaultFeatureType parent = builder.build();
+ parent = builder.build();
/*
* WayPoint ⇾ GPXEntity
- * ┌──────────────────┬────────────────┬────────────────────────┬─────────────┐
- * │ Name │ Type │ XML type │ Cardinality │
- * ├──────────────────┼────────────────┼────────────────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1 … 1] │
- * │ sis:envelope │ Envelope │ │ [1 … 1] │
- * │ sis:geometry │ Point │ (lat,lon) attributes │ [1 … 1] │
- * │ ele │ Double │ xsd:decimal │ [0 … 1] │
- * │ time │ Temporal │ xsd:dateTime │ [0 … 1] │
- * │ magvar │ Double │ gpx:degreesType │ [0 … 1] │
- * │ geoidheight │ Double │ xsd:decimal │ [0 … 1] │
- * │ name │ String │ xsd:string │ [0 … 1] │
- * │ cmt │ String │ xsd:string │ [0 … 1] │
- * │ desc │ String │ xsd:string │ [0 … 1] │
- * │ src │ String │ xsd:string │ [0 … 1] │
- * │ link │ OnlineResource │ gpx:linkType │ [0 … ∞] │
- * │ sym │ String │ xsd:string │ [0 … 1] │
- * │ type │ String │ xsd:string │ [0 … 1] │
- * │ fix │ Fix │ gpx:fixType │ [0 … 1] │
- * │ sat │ Integer │ xsd:nonNegativeInteger │ [0 … 1] │
- * │ hdop │ Double │ xsd:decimal │ [0 … 1] │
- * │ vdop │ Double │ xsd:decimal │ [0 … 1] │
- * │ pdop │ Double │ xsd:decimal │ [0 … 1] │
- * │ ageofdgpsdata │ Double │ xsd:decimal │ [0 … 1] │
- * │ dgpsid │ Integer │ gpx:dgpsStationType │ [0 … 1] │
- * └──────────────────┴────────────────┴────────────────────────┴─────────────┘
+ * ┌──────────────────┬────────────────┬───────────────────────┬─────────────┐
+ * │ Name │ Type │ XML type │ Cardinality │
+ * ├──────────────────┼────────────────┼───────────────────────┼─────────────┤
+ * │ sis:identifier │ Integer │ │ [1 … 1] │
+ * │ sis:envelope │ Envelope │ │ [1 … 1] │
+ * │ sis:geometry │ Point │ (lat,lon) attributes │ [1 … 1] │
+ * │ ele │ Double │ xs:decimal │ [0 … 1] │
+ * │ time │ Temporal │ xs:dateTime │ [0 … 1] │
+ * │ magvar │ Double │ gpx:degreesType │ [0 … 1] │
+ * │ geoidheight │ Double │ xs:decimal │ [0 … 1] │
+ * │ name │ String │ xs:string │ [0 … 1] │
+ * │ cmt │ String │ xs:string │ [0 … 1] │
+ * │ desc │ String │ xs:string │ [0 … 1] │
+ * │ src │ String │ xs:string │ [0 … 1] │
+ * │ link │ OnlineResource │ gpx:linkType │ [0 … ∞] │
+ * │ sym │ String │ xs:string │ [0 … 1] │
+ * │ type │ String │ xs:string │ [0 … 1] │
+ * │ fix │ Fix │ gpx:fixType │ [0 … 1] │
+ * │ sat │ Integer │ xs:nonNegativeInteger │ [0 … 1] │
+ * │ hdop │ Double │ xs:decimal │ [0 … 1] │
+ * │ vdop │ Double │ xs:decimal │ [0 … 1] │
+ * │ pdop │ Double │ xs:decimal │ [0 … 1] │
+ * │ ageofdgpsdata │ Double │ xs:decimal │ [0 … 1] │
+ * │ dgpsid │ Integer │ gpx:dgpsStationType │ [0 … 1] │
+ * └──────────────────┴────────────────┴───────────────────────┴─────────────┘
*/
builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("WayPoint");
builder.addAttribute(GeometryType.POINT).setName(geomName)
@@ -198,21 +207,21 @@ final class Types {
wayPoint = create(builder, resources);
/*
* Route ⇾ GPXEntity
- * ┌────────────────┬────────────────┬────────────────────────┬─────────────┐
- * │ Name │ Type │ XML type │ Cardinality │
- * ├────────────────┼────────────────┼────────────────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1 … 1] │
- * │ sis:envelope │ Envelope │ │ [1 … 1] │
- * │ sis:geometry │ Polyline │ │ [1 … 1] │
- * │ name │ String │ xsd:string │ [0 … 1] │
- * │ cmt │ String │ xsd:string │ [0 … 1] │
- * │ desc │ String │ xsd:string │ [0 … 1] │
- * │ src │ String │ xsd:string │ [0 … 1] │
- * │ link │ OnlineResource │ gpx:linkType │ [0 … ∞] │
- * │ number │ Integer │ xsd:nonNegativeInteger │ [0 … 1] │
- * │ type │ String │ xsd:string │ [0 … 1] │
- * │ rtept │ WayPoint │ gpx:wptType │ [0 … ∞] │
- * └────────────────┴────────────────┴────────────────────────┴─────────────┘
+ * ┌────────────────┬────────────────┬───────────────────────┬─────────────┐
+ * │ Name │ Type │ XML type │ Cardinality │
+ * ├────────────────┼────────────────┼───────────────────────┼─────────────┤
+ * │ sis:identifier │ Integer │ │ [1 … 1] │
+ * │ sis:envelope │ Envelope │ │ [1 … 1] │
+ * │ sis:geometry │ Polyline │ │ [1 … 1] │
+ * │ name │ String │ xs:string │ [0 … 1] │
+ * │ cmt │ String │ xs:string │ [0 … 1] │
+ * │ desc │ String │ xs:string │ [0 … 1] │
+ * │ src │ String │ xs:string │ [0 … 1] │
+ * │ link │ OnlineResource │ gpx:linkType │ [0 … ∞] │
+ * │ number │ Integer │ xs:nonNegativeInteger │ [0 … 1] │
+ * │ type │ String │ xs:string │ [0 … 1] │
+ * │ rtept │ WayPoint │ gpx:wptType │ [0 … ∞] │
+ * └────────────────┴────────────────┴───────────────────────┴─────────────┘
*/
final DefaultAttributeType<?> groupResult = GroupAsPolylineOperation.getResult(geometries);
GroupAsPolylineOperation groupOp = new GroupAsPolylineOperation(geomInfo, Tags.ROUTE_POINTS, groupResult);
@@ -249,21 +258,21 @@ final class Types {
trackSegment = create(builder, resources);
/*
* Track ⇾ GPXEntity
- * ┌────────────────┬────────────────┬────────────────────────┬─────────────┐
- * │ Name │ Type │ XML type │ Cardinality │
- * ├────────────────┼────────────────┼────────────────────────┼─────────────┤
- * │ sis:identifier │ Integer │ │ [1 … 1] │
- * │ sis:envelope │ Envelope │ │ [1 … 1] │
- * │ sis:geometry │ Polyline │ │ [1 … 1] │
- * │ name │ String │ xsd:string │ [0 … 1] │
- * │ cmt │ String │ xsd:string │ [0 … 1] │
- * │ desc │ String │ xsd:string │ [0 … 1] │
- * │ src │ String │ xsd:string │ [0 … 1] │
- * │ link │ OnlineResource │ gpx:linkType │ [0 … ∞] │
- * │ number │ Integer │ xsd:nonNegativeInteger │ [0 … 1] │
- * │ type │ String │ xsd:string │ [0 … 1] │
- * │ trkseg │ TrackSegment │ gpx:trksegType │ [0 … ∞] │
- * └────────────────┴────────────────┴────────────────────────┴─────────────┘
+ * ┌────────────────┬────────────────┬───────────────────────┬─────────────┐
+ * │ Name │ Type │ XML type │ Cardinality │
+ * ├────────────────┼────────────────┼───────────────────────┼─────────────┤
+ * │ sis:identifier │ Integer │ │ [1 … 1] │
+ * │ sis:envelope │ Envelope │ │ [1 … 1] │
+ * │ sis:geometry │ Polyline │ │ [1 … 1] │
+ * │ name │ String │ xs:string │ [0 … 1] │
+ * │ cmt │ String │ xs:string │ [0 … 1] │
+ * │ desc │ String │ xs:string │ [0 … 1] │
+ * │ src │ String │ xs:string │ [0 … 1] │
+ * │ link │ OnlineResource │ gpx:linkType │ [0 … ∞] │
+ * │ number │ Integer │ xs:nonNegativeInteger │ [0 … 1] │
+ * │ type │ String │ xs:string │ [0 … 1] │
+ * │ trkseg │ TrackSegment │ gpx:trksegType │ [0 … ∞] │
+ * └────────────────┴────────────────┴───────────────────────┴─────────────┘
*/
groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_SEGMENTS, groupResult);
builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("Track");
Modified: sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -38,7 +38,6 @@ import org.apache.sis.setup.OptionKey;
import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.internal.storage.FeatureStore;
import org.apache.sis.internal.storage.io.ChannelFactory;
import org.apache.sis.internal.storage.io.IOUtilities;
import org.apache.sis.internal.storage.io.Markable;
@@ -65,7 +64,7 @@ import org.apache.sis.util.Debug;
* @since 0.8
* @module
*/
-public abstract class StaxDataStore extends FeatureStore {
+public abstract class StaxDataStore extends DataStore {
/**
* The locale to use for locale-sensitive data (<strong>not</strong> for logging or warning messages),
* or {@code null} if unspecified.
Modified: sis/branches/Android/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java?rev=1805571&r1=1805570&r2=1805571&view=diff
==============================================================================
--- sis/branches/Android/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java [UTF-8] (original)
+++ sis/branches/Android/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java [UTF-8] Sun Aug 20 16:24:04 2017
@@ -224,7 +224,7 @@ public final strictfp class ReaderTest e
try (Store reader = create("1.0/waypoint.xml")) {
verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
assertEquals("version", StoreProvider.V1_0, reader.getVersion());
- try (Stream<AbstractFeature> features = reader.features(false)) {
+ try (Stream<AbstractFeature> features = reader.features()) {
final Iterator<AbstractFeature> it = features.iterator();
verifyPoint(it.next(), 0, false);
verifyPoint(it.next(), 1, false);
@@ -245,7 +245,7 @@ public final strictfp class ReaderTest e
try (Store reader = create("1.1/waypoint.xml")) {
verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
assertEquals("version", StoreProvider.V1_1, reader.getVersion());
- try (Stream<AbstractFeature> features = reader.features(false)) {
+ try (Stream<AbstractFeature> features = reader.features()) {
final Iterator<AbstractFeature> it = features.iterator();
verifyPoint(it.next(), 0, true);
verifyPoint(it.next(), 1, true);
@@ -266,7 +266,7 @@ public final strictfp class ReaderTest e
try (Store reader = create("1.0/route.xml")) {
verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
assertEquals("version", StoreProvider.V1_0, reader.getVersion());
- try (Stream<AbstractFeature> features = reader.features(false)) {
+ try (Stream<AbstractFeature> features = reader.features()) {
final Iterator<AbstractFeature> it = features.iterator();
verifyRoute(it.next(), false, 1);
verifyEmpty(it.next(), "rtept");
@@ -295,7 +295,7 @@ public final strictfp class ReaderTest e
* This verification is shared by {@link #testRoute110()} and {@link #testSequentialReads()}.
*/
static void verifyRoute110(final Store reader) throws DataStoreException {
- try (Stream<AbstractFeature> features = reader.features(false)) {
+ try (Stream<AbstractFeature> features = reader.features()) {
final Iterator<AbstractFeature> it = features.iterator();
verifyRoute(it.next(), true, 3);
verifyEmpty(it.next(), "rtept");
@@ -373,7 +373,7 @@ public final strictfp class ReaderTest e
try (Store reader = create("1.0/track.xml")) {
verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
assertEquals("version", StoreProvider.V1_0, reader.getVersion());
- try (Stream<AbstractFeature> features = reader.features(false)) {
+ try (Stream<AbstractFeature> features = reader.features()) {
final Iterator<AbstractFeature> it = features.iterator();
verifyTrack(it.next(), false, 1);
verifyEmpty(it.next(), "trkseg");
@@ -393,7 +393,7 @@ public final strictfp class ReaderTest e
try (Store reader = create("1.1/track.xml")) {
verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
assertEquals("version", StoreProvider.V1_1, reader.getVersion());
- try (Stream<AbstractFeature> features = reader.features(false)) {
+ try (Stream<AbstractFeature> features = reader.features()) {
final Iterator<AbstractFeature> it = features.iterator();
verifyTrack(it.next(), true, 3);
verifyEmpty(it.next(), "trkseg");
@@ -610,13 +610,13 @@ public final strictfp class ReaderTest e
@DependsOnMethod("testSequentialReads")
public void testConcurrentReads() throws DataStoreException {
try (Store reader = createFromURL()) {
- final Stream<AbstractFeature> f1 = reader.features(false);
+ final Stream<AbstractFeature> f1 = reader.features();
final Iterator<AbstractFeature> i1 = f1.iterator();
verifyRoute(i1.next(), true, 3);
- final Stream<AbstractFeature> f2 = reader.features(false);
+ final Stream<AbstractFeature> f2 = reader.features();
final Iterator<AbstractFeature> i2 = f2.iterator();
verifyEmpty(i1.next(), "rtept");
- final Stream<AbstractFeature> f3 = reader.features(false);
+ final Stream<AbstractFeature> f3 = reader.features();
final Iterator<AbstractFeature> i3 = f3.iterator();
verifyRoute(i2.next(), true, 3);
verifyRoute(i3.next(), true, 3);