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/02/26 11:28:20 UTC
svn commit: r1825355 [5/15] - in /sis/trunk: ./
application/sis-console/src/test/java/org/apache/sis/console/
core/sis-build-helper/src/main/resources/org/apache/sis/internal/book/
core/sis-metadata/ core/sis-metadata/src/main/java/org/apache/sis/inter...
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -22,17 +22,19 @@ import javax.xml.bind.annotation.XmlElem
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.metadata.content.Band;
import org.opengis.metadata.content.BandDefinition;
import org.opengis.metadata.content.PolarizationOrientation;
import org.opengis.metadata.content.TransferFunctionType;
-import org.apache.sis.xml.Namespaces;
import org.apache.sis.measure.ValueRange;
+import org.apache.sis.internal.jaxb.gco.GO_Real;
+import org.apache.sis.internal.jaxb.gco.UnitAdapter;
import static org.apache.sis.internal.metadata.MetadataUtilities.ensurePositive;
// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -58,17 +60,18 @@ import static org.opengis.annotation.Spe
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @author Rémi Maréchal (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@XmlType(name = "MD_Band_Type", propOrder = {
+ "boundMax",
+ "boundMin",
+ "boundUnits",
"peakResponse",
- "bitsPerValue",
"toneGradation",
- "scaleFactor",
- "offset",
"bandBoundaryDefinition",
"nominalSpatialResolution",
"transferFunctionType",
@@ -197,7 +200,8 @@ public class DefaultBand extends Default
* @since 0.5
*/
@ValueRange(minimum = 0)
-/// @XmlElement(name = "boundMin")
+ @XmlElement(name = "boundMin")
+ @XmlJavaTypeAdapter(GO_Real.Since2014.class)
@UML(identifier="boundMin", obligation=OPTIONAL, specification=ISO_19115)
public Double getBoundMin() {
return boundMin;
@@ -228,7 +232,8 @@ public class DefaultBand extends Default
* @since 0.5
*/
@ValueRange(minimum = 0)
-/// @XmlElement(name = "boundMax")
+ @XmlElement(name = "boundMax")
+ @XmlJavaTypeAdapter(GO_Real.Since2014.class)
@UML(identifier="boundMax", obligation=OPTIONAL, specification=ISO_19115)
public Double getBoundMax() {
return boundMax;
@@ -258,7 +263,8 @@ public class DefaultBand extends Default
*
* @see org.apache.sis.measure.Units#NANOMETRE
*/
-/// @XmlElement(name = "boundUnits")
+ @XmlElement(name = "boundUnits")
+ @XmlJavaTypeAdapter(UnitAdapter.Since2014.class)
@UML(identifier="boundUnits", obligation=OPTIONAL, specification=ISO_19115)
public Unit<Length> getBoundUnits() {
return boundUnits;
@@ -282,7 +288,7 @@ public class DefaultBand extends Default
* @return criterion for defining maximum and minimum wavelengths, or {@code null}.
*/
@Override
- @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
+ @XmlElement(name = "bandBoundaryDefinition")
public BandDefinition getBandBoundaryDefinition() {
return bandBoundaryDefinition;
}
@@ -357,24 +363,6 @@ public class DefaultBand extends Default
}
/**
- * {@inheritDoc}
- */
- @Override
- @ValueRange(minimum = 1)
- @XmlElement(name = "bitsPerValue")
- public Integer getBitsPerValue() {
- return super.getBitsPerValue();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setBitsPerValue(final Integer newValue) {
- super.setBitsPerValue(newValue);
- }
-
- /**
* Returns the number of discrete numerical values in the grid data.
*
* @return number of discrete numerical values in the grid data, or {@code null} if none.
@@ -399,45 +387,14 @@ public class DefaultBand extends Default
}
/**
- * {@inheritDoc}
- */
- @Override
- @XmlElement(name = "scaleFactor")
- public Double getScaleFactor() {
- return super.getScaleFactor();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setScaleFactor(final Double newValue) {
- super.setScaleFactor(newValue);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- @XmlElement(name = "offset")
- public Double getOffset() {
- return super.getOffset();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setOffset(final Double newValue) {
- super.setOffset(newValue);
- }
-
- /**
- * {@inheritDoc}
+ * Returns the smallest distance between which separate points can be distinguished,
+ * as specified in instrument design.
+ *
+ * @return {@inheritDoc}
*/
@Override
@ValueRange(minimum = 0, isMinIncluded = false)
- @XmlElement(name = "nominalSpatialResolution", namespace = Namespaces.GMI)
+ @XmlElement(name = "nominalSpatialResolution")
public Double getNominalSpatialResolution() {
return super.getNominalSpatialResolution();
}
@@ -451,10 +408,12 @@ public class DefaultBand extends Default
}
/**
- * {@inheritDoc}
+ * Returns type of transfer function to be used when scaling a physical value for a given element.
+ *
+ * @return {@inheritDoc}
*/
@Override
- @XmlElement(name = "transferFunctionType", namespace = Namespaces.GMI)
+ @XmlElement(name = "transferFunctionType")
public TransferFunctionType getTransferFunctionType() {
return super.getTransferFunctionType();
}
@@ -473,7 +432,7 @@ public class DefaultBand extends Default
* @return polarization of the radiation transmitted, or {@code null}.
*/
@Override
- @XmlElement(name = "transmittedPolarization", namespace = Namespaces.GMI)
+ @XmlElement(name = "transmittedPolarisation")
public PolarizationOrientation getTransmittedPolarization() {
return transmittedPolarization;
}
@@ -494,7 +453,7 @@ public class DefaultBand extends Default
* @return polarization of the radiation detected, or {@code null}.
*/
@Override
- @XmlElement(name = "detectedPolarization", namespace = Namespaces.GMI)
+ @XmlElement(name = "detectedPolarisation")
public PolarizationOrientation getDetectedPolarization() {
return detectedPolarization;
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.content.CoverageContentType;
import org.opengis.metadata.content.CoverageDescription;
@@ -30,9 +30,14 @@ import org.opengis.metadata.content.Imag
import org.opengis.metadata.content.RangeDimension;
import org.opengis.metadata.content.RangeElementDescription;
import org.opengis.util.RecordType;
-import org.apache.sis.xml.Namespaces;
import org.apache.sis.internal.metadata.Dependencies;
import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.metadata.MD_Identifier;
+
+// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -56,15 +61,18 @@ import static org.opengis.annotation.Spe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@XmlType(name = "MD_CoverageDescription_Type", propOrder = {
"attributeDescription",
- "contentType",
- "dimensions",
+ "processingLevelCode", // New in ISO 19115:2014
+ "attributeGroup", // Ibid.
+ "contentType", // Legacy ISO 19115:2003
+ "dimensions", // Ibid.
"rangeElementDescriptions"
})
@XmlRootElement(name = "MD_CoverageDescription")
@@ -179,12 +187,15 @@ public class DefaultCoverageDescription
/**
* Returns an identifier for the level of processing that has been applied to the resource, or {@code null} if none.
+ * For {@linkplain DefaultImageDescription image descriptions}, this is the image distributor's code that identifies
+ * the level of radiometric and geometric processing that has been applied.
*
* @return identifier for the level of processing that has been applied to the resource, or {@code null} if none.
*
* @since 0.5
*/
-/// @XmlElement(name = "processingLevelCode")
+ @XmlElement(name = "processingLevelCode")
+ @XmlJavaTypeAdapter(MD_Identifier.Since2014.class)
@UML(identifier="processingLevelCode", obligation=OPTIONAL, specification=ISO_19115)
public Identifier getProcessingLevelCode() {
return processingLevelCode;
@@ -214,7 +225,7 @@ public class DefaultCoverageDescription
*
* @since 0.5
*/
-/// @XmlElement(name = "attributeGroup")
+ // @XmlElement at the end of this class.
@UML(identifier="attributeGroup", obligation=OPTIONAL, specification=ISO_19115)
public Collection<DefaultAttributeGroup> getAttributeGroups() {
return attributeGroups = nonNullCollection(attributeGroups, DefaultAttributeGroup.class);
@@ -246,22 +257,24 @@ public class DefaultCoverageDescription
*/
@Override
@Deprecated
- @XmlElement(name = "contentType", required = true)
@Dependencies("getAttributeGroups")
+ @XmlElement(name = "contentType", namespace = LegacyNamespaces.GMD)
public CoverageContentType getContentType() {
CoverageContentType type = null;
- final Collection<DefaultAttributeGroup> groups = getAttributeGroups();
- if (groups != null) { // May be null on marshalling.
- for (final DefaultAttributeGroup g : groups) {
- final Collection<? extends CoverageContentType> contentTypes = g.getContentTypes();
- if (contentTypes != null) { // May be null on marshalling.
- for (final CoverageContentType t : contentTypes) {
- if (type == null) {
- type = t;
- } else {
- LegacyPropertyAdapter.warnIgnoredExtraneous(CoverageContentType.class,
- DefaultCoverageDescription.class, "getContentType");
- break;
+ if (FilterByVersion.LEGACY_METADATA.accept()) {
+ final Collection<DefaultAttributeGroup> groups = getAttributeGroups();
+ if (groups != null) { // May be null on marshalling.
+ for (final DefaultAttributeGroup g : groups) {
+ final Collection<? extends CoverageContentType> contentTypes = g.getContentTypes();
+ if (contentTypes != null) { // May be null on marshalling.
+ for (final CoverageContentType t : contentTypes) {
+ if (type == null) {
+ type = t;
+ } else {
+ LegacyPropertyAdapter.warnIgnoredExtraneous(CoverageContentType.class,
+ DefaultCoverageDescription.class, "getContentType");
+ break;
+ }
}
}
}
@@ -309,9 +322,10 @@ public class DefaultCoverageDescription
*/
@Override
@Deprecated
- @XmlElement(name = "dimension")
@Dependencies("getAttributeGroups")
+ @XmlElement(name = "dimension", namespace = LegacyNamespaces.GMD)
public final Collection<RangeDimension> getDimensions() {
+ if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
return new LegacyPropertyAdapter<RangeDimension,DefaultAttributeGroup>(getAttributeGroups()) {
/** Stores a legacy value into the new kind of value. */
@Override protected DefaultAttributeGroup wrap(final RangeDimension value) {
@@ -357,7 +371,7 @@ public class DefaultCoverageDescription
* @return description of the specific range elements of a coverage.
*/
@Override
- @XmlElement(name = "rangeElementDescription", namespace = Namespaces.GMI)
+ @XmlElement(name = "rangeElementDescription")
public Collection<RangeElementDescription> getRangeElementDescriptions() {
return rangeElementDescriptions = nonNullCollection(rangeElementDescriptions, RangeElementDescription.class);
}
@@ -370,4 +384,28 @@ public class DefaultCoverageDescription
public void setRangeElementDescriptions(final Collection<? extends RangeElementDescription> newValues) {
rangeElementDescriptions = writeCollection(newValues, rangeElementDescriptions, RangeElementDescription.class);
}
+
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+ //////// ////////
+ //////// XML support with JAXB ////////
+ //////// ////////
+ //////// The following methods are invoked by JAXB using reflection (even if ////////
+ //////// they are private) or are helpers for other methods invoked by JAXB. ////////
+ //////// Those methods can be safely removed if Geographic Markup Language ////////
+ //////// (GML) support is not needed. ////////
+ //////// ////////
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Invoked by JAXB at both marshalling and unmarshalling time.
+ * This attribute has been added by ISO 19115:2014 standard.
+ * If (and only if) marshalling an older standard version, we omit this attribute.
+ */
+ @XmlElement(name = "attributeGroup")
+ private Collection<DefaultAttributeGroup> getAttributeGroup() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? getAttributeGroups() : null;
+ }
}
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=1825355&r1=1825354&r2=1825355&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] Mon Feb 26 11:28:17 2018
@@ -21,13 +21,18 @@ import java.util.Collection;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.GenericName;
import org.opengis.metadata.citation.Citation;
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.metadata.Dependencies;
import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
+// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -54,16 +59,19 @@ import static org.opengis.annotation.Spe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@XmlType(name = "MD_FeatureCatalogueDescription_Type", propOrder = {
"compliant",
- "languages",
+ "locale", // New in ISO 19115:2014
+ "language", // Legacy ISO 19115:2003
"includedWithDataset",
- "featureTypes",
+ "featureTypesInfo", // New in ISO 19115:2014. Actual name is "featureTypeInfo"
+ "featureTypes", // Legacy ISO 19115:2003
"featureCatalogueCitations"
})
@XmlRootElement(name = "MD_FeatureCatalogueDescription")
@@ -186,7 +194,7 @@ public class DefaultFeatureCatalogueDesc
* @return language(s) used within the catalogue.
*/
@Override
- @XmlElement(name = "language")
+ // @XmlElement at the end of this class.
public Collection<Locale> getLanguages() {
return languages = nonNullCollection(languages, Locale.class);
}
@@ -206,7 +214,7 @@ public class DefaultFeatureCatalogueDesc
* @return whether or not the feature catalogue is included with the resource.
*/
@Override
- @XmlElement(name = "includedWithDataset", required = true)
+ @XmlElement(name = "includedWithDataset")
public boolean isIncludedWithDataset() {
return includedWithDataset;
}
@@ -233,6 +241,7 @@ public class DefaultFeatureCatalogueDesc
*
* @since 0.5
*/
+ // @XmlElement at the end of this class.
@UML(identifier="featureTypes", obligation=OPTIONAL, specification=ISO_19115)
public Collection<DefaultFeatureTypeInfo> getFeatureTypeInfo() {
return featureTypes = nonNullCollection(featureTypes, DefaultFeatureTypeInfo.class);
@@ -263,9 +272,10 @@ public class DefaultFeatureCatalogueDesc
*/
@Override
@Deprecated
- @XmlElement(name = "featureTypes")
@Dependencies("getFeatureTypeInfo")
+ @XmlElement(name = "featureTypes", namespace = LegacyNamespaces.GMD)
public final Collection<GenericName> getFeatureTypes() {
+ if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
return new LegacyPropertyAdapter<GenericName,DefaultFeatureTypeInfo>(getFeatureTypeInfo()) {
/** Stores a legacy value into the new kind of value. */
@Override protected DefaultFeatureTypeInfo wrap(final GenericName value) {
@@ -307,7 +317,7 @@ public class DefaultFeatureCatalogueDesc
* @return bibliographic reference to one or more external feature catalogues.
*/
@Override
- @XmlElement(name = "featureCatalogueCitation", required = true)
+ @XmlElement(name = "featureCatalogueCitation")
public Collection<Citation> getFeatureCatalogueCitations() {
return featureCatalogueCitations = nonNullCollection(featureCatalogueCitations, Citation.class);
}
@@ -320,4 +330,47 @@ public class DefaultFeatureCatalogueDesc
public void setFeatureCatalogueCitations(final Collection<? extends Citation> newValues) {
featureCatalogueCitations = writeCollection(newValues, featureCatalogueCitations, Citation.class);
}
+
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+ //////// ////////
+ //////// XML support with JAXB ////////
+ //////// ////////
+ //////// The following methods are invoked by JAXB using reflection (even if ////////
+ //////// they are private) or are helpers for other methods invoked by JAXB. ////////
+ //////// Those methods can be safely removed if Geographic Markup Language ////////
+ //////// (GML) support is not needed. ////////
+ //////// ////////
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Invoked by JAXB at both marshalling and unmarshalling time.
+ * This attribute has been added by ISO 19115:2014 standard.
+ * If (and only if) marshalling an older standard version, we omit this attribute.
+ */
+ @XmlElement(name = "featureTypes")
+ private Collection<DefaultFeatureTypeInfo> getFeatureTypesInfo() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? getFeatureTypeInfo() : null;
+ }
+
+ /**
+ * Returns the locale to marshal if the XML document is to be written
+ * according the new ISO 19115:2014 model.
+ */
+ @XmlElement(name = "locale")
+ private Collection<Locale> getLocale() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? getLanguages() : null;
+ }
+
+ /**
+ * Returns the locale to marshal if the XML document is to be written
+ * according the legacy ISO 19115:2003 model.
+ */
+ @XmlElement(name = "language", namespace = LegacyNamespaces.GMD)
+ @XmlJavaTypeAdapter(LocaleAdapter.class)
+ private Collection<Locale> getLanguage() {
+ return FilterByVersion.LEGACY_METADATA.accept() ? getLanguages() : null;
+ }
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -55,7 +55,7 @@ import static org.opengis.annotation.Spe
*
* @author Rémi Maréchal (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @version 1.0
*
* @see org.apache.sis.storage.FeatureNaming
* @see org.apache.sis.feature.DefaultFeatureType
@@ -65,7 +65,7 @@ import static org.opengis.annotation.Spe
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@TitleProperty(name = "featureTypeName")
-@XmlType(name = "MD_FeatureTypeInfo", propOrder = {
+@XmlType(name = "MD_FeatureTypeInfo_Type", propOrder = {
"featureTypeName",
"featureInstanceCount"
})
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -23,6 +23,8 @@ import javax.xml.bind.annotation.XmlRoot
import org.opengis.metadata.Identifier;
import org.opengis.metadata.content.ImageDescription;
import org.opengis.metadata.content.ImagingCondition;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.measure.ValueRange;
import static org.apache.sis.internal.metadata.MetadataUtilities.ensureInRange;
@@ -48,7 +50,7 @@ import static org.apache.sis.internal.me
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @version 1.0
* @since 0.3
* @module
*/
@@ -59,7 +61,7 @@ import static org.apache.sis.internal.me
"imagingCondition",
"imageQualityCode",
"cloudCoverPercentage",
- "processingLevelCode",
+ "processingLevel",
"compressionGenerationQuantity",
"triangulationIndicator",
"radiometricCalibrationDataAvailable",
@@ -328,29 +330,6 @@ public class DefaultImageDescription ext
}
/**
- * Returns the image distributor's code that identifies the level of radiometric and geometric
- * processing that has been applied.
- *
- * @return the level of radiometric and geometric processing that has been applied, or {@code null} if unspecified.
- */
- @Override
- @XmlElement(name = "processingLevelCode")
- public Identifier getProcessingLevelCode() {
- return super.getProcessingLevelCode();
- }
-
- /**
- * Sets the image distributor's code that identifies the level of radiometric and geometric
- * processing that has been applied.
- *
- * @param newValue the new processing level code.
- */
- @Override
- public void setProcessingLevelCode(final Identifier newValue) {
- super.setProcessingLevelCode(newValue);
- }
-
- /**
* Returns the count of the number of lossy compression cycles performed on the image.
*
* @return the number of lossy compression cycles performed on the image, or {@code null} if unspecified.
@@ -481,4 +460,37 @@ public class DefaultImageDescription ext
checkWritePermission();
lensDistortionInformationAvailable = newValue;
}
+
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+ //////// ////////
+ //////// XML support with JAXB ////////
+ //////// ////////
+ //////// The following methods are invoked by JAXB using reflection (even if ////////
+ //////// they are private) or are helpers for other methods invoked by JAXB. ////////
+ //////// Those methods can be safely removed if Geographic Markup Language ////////
+ //////// (GML) support is not needed. ////////
+ //////// ////////
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * An attribute which was defined in {@code ImageDescription} by ISO 19115:2003,
+ * and which moved to the parent class in ISO 19115:2014 revision. We handle the
+ * two versions separately for proper attribute ordering, and for avoiding this
+ * attribute to be written for subtypes other than {@code ImageDescription}.
+ */
+ @XmlElement(name = "processingLevelCode", namespace = LegacyNamespaces.GMD)
+ private Identifier getProcessingLevel() {
+ return FilterByVersion.LEGACY_METADATA.accept() ? getProcessingLevelCode() : null;
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time.
+ */
+ @SuppressWarnings("unused")
+ private void setProcessingLevel(final Identifier newValue) {
+ setProcessingLevelCode(newValue);
+ }
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -21,7 +21,7 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.MemberName;
import org.opengis.util.InternationalString;
import org.opengis.metadata.Identifier;
@@ -30,7 +30,12 @@ import org.opengis.metadata.content.Band
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.metadata.TitleProperty;
import org.apache.sis.internal.metadata.Dependencies;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.gco.InternationalStringAdapter;
+// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -51,7 +56,8 @@ import static org.opengis.annotation.Spe
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @author Rémi Maréchal (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@@ -59,8 +65,9 @@ import static org.opengis.annotation.Spe
@TitleProperty(name = "sequenceIdentifier")
@XmlType(name = "MD_RangeDimension_Type", propOrder = {
"sequenceIdentifier",
- "descriptor",
-/// "names"
+ "description", // New in ISO 19115:2014
+ "descriptor", // Legacy ISO 19115:2003
+ "name" // New in ISO 19115:2014
})
@XmlRootElement(name = "MD_RangeDimension")
@XmlSeeAlso(DefaultBand.class)
@@ -171,7 +178,8 @@ public class DefaultRangeDimension exten
*
* @since 0.5
*/
-/// @XmlElement(name = "description")
+ @XmlElement(name = "description")
+ @XmlJavaTypeAdapter(InternationalStringAdapter.Since2014.class)
@UML(identifier="description", obligation=OPTIONAL, specification=ISO_19115)
public InternationalString getDescription() {
return description;
@@ -199,10 +207,10 @@ public class DefaultRangeDimension exten
*/
@Override
@Deprecated
- @XmlElement(name = "descriptor")
@Dependencies("getDescription")
+ @XmlElement(name = "descriptor", namespace = LegacyNamespaces.GMD)
public InternationalString getDescriptor() {
- return getDescription();
+ return FilterByVersion.LEGACY_METADATA.accept() ? getDescription() : null;
}
/**
@@ -226,7 +234,7 @@ public class DefaultRangeDimension exten
*
* @since 0.5
*/
-/// @XmlElement(name = "name")
+ // @XmlElement at the end of this class.
@UML(identifier="name", obligation=OPTIONAL, specification=ISO_19115)
public Collection<Identifier> getNames() {
return names = nonNullCollection(names, Identifier.class);
@@ -242,4 +250,28 @@ public class DefaultRangeDimension exten
public void setNames(final Collection<? extends Identifier> newValues) {
names = writeCollection(newValues, names, Identifier.class);
}
+
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+ //////// ////////
+ //////// XML support with JAXB ////////
+ //////// ////////
+ //////// The following methods are invoked by JAXB using reflection (even if ////////
+ //////// they are private) or are helpers for other methods invoked by JAXB. ////////
+ //////// Those methods can be safely removed if Geographic Markup Language ////////
+ //////// (GML) support is not needed. ////////
+ //////// ////////
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Invoked by JAXB at both marshalling and unmarshalling time.
+ * This attribute has been added by ISO 19115:2014 standard.
+ * If (and only if) marshalling an older standard version, we omit this attribute.
+ */
+ @XmlElement(name = "name")
+ private Collection<Identifier> getName() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? getNames() : null;
+ }
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -25,7 +25,6 @@ import org.opengis.util.InternationalStr
import org.opengis.metadata.content.RangeElementDescription;
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.metadata.TitleProperty;
-import org.apache.sis.xml.Namespaces;
/**
@@ -48,7 +47,7 @@ import org.apache.sis.xml.Namespaces;
*
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
* @since 0.3
* @module
*/
@@ -56,10 +55,10 @@ import org.apache.sis.xml.Namespaces;
@TitleProperty(name = "name")
@XmlType(name = "MI_RangeElementDescription_Type", propOrder = {
"name",
- "definition"/*,
- "rangeElements"*/ // TODO: not yet supported.
+ "definition",
+ "rangeElements"
})
-@XmlRootElement(name = "MI_RangeElementDescription", namespace = Namespaces.GMI)
+@XmlRootElement(name = "MI_RangeElementDescription")
public class DefaultRangeElementDescription extends ISOMetadata implements RangeElementDescription {
/**
* Serial number for inter-operability with different versions.
@@ -136,7 +135,7 @@ public class DefaultRangeElementDescript
* @return designation associated with a set of range elements, or {@code null}.
*/
@Override
- @XmlElement(name = "name", namespace = Namespaces.GMI, required = true)
+ @XmlElement(name = "name", required = true)
public InternationalString getName() {
return name;
}
@@ -157,7 +156,7 @@ public class DefaultRangeElementDescript
* @return description of a set of specific range elements, or {@code null}.
*/
@Override
- @XmlElement(name = "definition", namespace = Namespaces.GMI, required = true)
+ @XmlElement(name = "definition", required = true)
public InternationalString getDefinition() {
return definition;
}
@@ -181,7 +180,7 @@ public class DefaultRangeElementDescript
* @todo implements {@link Record} in order to use the annotation.
*/
@Override
- //@XmlElement(name = "rangeElement", namespace = Namespaces.GMI, required = true)
+ @XmlElement(name = "rangeElement", required = true)
public Collection<Record> getRangeElements() {
return rangeElements = nonNullCollection(rangeElements, Record.class);
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -21,12 +21,17 @@ import javax.xml.bind.annotation.XmlElem
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.opengis.metadata.content.Band;
import org.opengis.metadata.content.CoverageContentType;
import org.opengis.metadata.content.TransferFunctionType;
import org.opengis.util.Record;
import org.opengis.util.RecordType;
-import org.opengis.metadata.content.Band;
import org.apache.sis.measure.ValueRange;
+import org.apache.sis.internal.jaxb.gco.GO_Real;
+import org.apache.sis.internal.jaxb.gco.GO_Integer;
+import org.apache.sis.internal.jaxb.gco.GO_Record;
+import org.apache.sis.internal.jaxb.gco.GO_RecordType;
import static org.apache.sis.internal.metadata.MetadataUtilities.ensurePositive;
@@ -64,7 +69,8 @@ import static org.opengis.annotation.Spe
*
* @author Rémi Maréchal (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.5
* @module
*/
@@ -73,14 +79,16 @@ import static org.opengis.annotation.Spe
"maxValue",
"minValue",
"units",
-/// "scaleFactor",
-/// "offset",
-/// "meanValue",
-/// "numberOfValues",
-/// "standardDeviation",
-/// "otherPropertyType",
-/// "otherProperty",
-/// "bitsPerValue"
+
+ // New in ISO 19115-3
+ "scaleFactor",
+ "offset",
+ "meanValue",
+ "numberOfValues",
+ "standardDeviation",
+ "otherPropertyType",
+ "otherProperty",
+ "bitsPerValue"
})
@XmlRootElement(name = "MD_SampleDimension")
@XmlSeeAlso({DefaultBand.class, DefaultRangeDimension.class})
@@ -230,7 +238,8 @@ public class DefaultSampleDimension exte
* @return the number of values used in a thematic classification resource, or {@code null} if none.
*/
@ValueRange(minimum = 0)
-/// @XmlElement(name = "numberOfValues")
+ @XmlElement(name = "numberOfValues")
+ @XmlJavaTypeAdapter(GO_Integer.Since2014.class)
@UML(identifier="numberOfValues", obligation=OPTIONAL, specification=ISO_19115)
public Integer getNumberOfValues() {
return numberOfValues;
@@ -296,7 +305,8 @@ public class DefaultSampleDimension exte
*
* @return the mean value of data values in each dimension included in the resource, or {@code null} if none.
*/
-/// @XmlElement(name = "meanValue")
+ @XmlElement(name = "meanValue")
+ @XmlJavaTypeAdapter(GO_Real.Since2014.class)
@UML(identifier="meanValue", obligation=OPTIONAL, specification=ISO_19115)
public Double getMeanValue() {
return meanValue;
@@ -317,7 +327,8 @@ public class DefaultSampleDimension exte
*
* @return standard deviation of data values in each dimension included in the resource, or {@code null} if none.
*/
-/// @XmlElement(name = "standardDeviation")
+ @XmlElement(name = "standardDeviation")
+ @XmlJavaTypeAdapter(GO_Real.Since2014.class)
@UML(identifier="standardDeviation", obligation=OPTIONAL, specification=ISO_19115)
public Double getStandardDeviation() {
return standardDeviation;
@@ -359,7 +370,7 @@ public class DefaultSampleDimension exte
*
* @return scale factor which has been applied to the cell value, or {@code null} if none.
*/
-/// @XmlElement(name = "scaleFactor")
+ @XmlElement(name = "scaleFactor")
@UML(identifier="scaleFactor", obligation=OPTIONAL, specification=ISO_19115)
public Double getScaleFactor() {
return scaleFactor;
@@ -380,7 +391,7 @@ public class DefaultSampleDimension exte
*
* @return the physical value corresponding to a cell value of zero, or {@code null} if none.
*/
-/// @XmlElement(name = "offset")
+ @XmlElement(name = "offset")
@UML(identifier="offset", obligation=OPTIONAL, specification=ISO_19115)
public Double getOffset() {
return offset;
@@ -399,6 +410,12 @@ public class DefaultSampleDimension exte
/**
* Returns type of transfer function to be used when scaling a physical value for a given element.
*
+ * <div class="note"><b>Note on XML marshalling:</b>
+ * ISO 19115-2 defines this property in {@linkplain DefaultBand a subtype} for historical reasons.
+ * Apache SIS moves this property up in the hierarchy since this property can apply to any sample dimension,
+ * not only the measurements in the electromagnetic spectrum. However this property will not appear in XML
+ * documents unless this {@code SampleDimension} is actually a {@code Band}.</div>
+ *
* @return type of transfer function, or {@code null}.
*/
public TransferFunctionType getTransferFunctionType() {
@@ -423,7 +440,7 @@ public class DefaultSampleDimension exte
* for the value in each band of each pixel, or {@code null} if none.
*/
@ValueRange(minimum = 1)
-/// @XmlElement(name = "bitsPerValues")
+ @XmlElement(name = "bitsPerValue")
@UML(identifier="bitsPerValue", obligation=OPTIONAL, specification=ISO_19115)
public Integer getBitsPerValue() {
return bitsPerValue;
@@ -447,6 +464,12 @@ public class DefaultSampleDimension exte
* Returns the smallest distance between which separate points can be distinguished,
* as specified in instrument design.
*
+ * <div class="note"><b>Note on XML marshalling:</b>
+ * ISO 19115-2 defines this property in {@linkplain DefaultBand a subtype} for historical reasons.
+ * Apache SIS moves this property up in the hierarchy since this property can apply to any sample dimension,
+ * not only the measurements in the electromagnetic spectrum. However this property will not appear in XML
+ * documents unless this {@code SampleDimension} is actually a {@code Band}.</div>
+ *
* @return smallest distance between which separate points can be distinguished, or {@code null}.
*/
@ValueRange(minimum = 0, isMinIncluded = false)
@@ -473,7 +496,8 @@ public class DefaultSampleDimension exte
*
* @return type of other attribute description, or {@code null} if none.
*/
-/// @XmlElement(name = "otherPropertyType")
+ @XmlElement(name = "otherPropertyType")
+ @XmlJavaTypeAdapter(GO_RecordType.Since2014.class)
@UML(identifier="otherPropertyType", obligation=OPTIONAL, specification=ISO_19115)
public RecordType getOtherPropertyType() {
return otherPropertyType;
@@ -495,7 +519,8 @@ public class DefaultSampleDimension exte
*
* @return instance of other/attributeType that defines attributes, or {@code null} if none.
*/
-/// @XmlElement(name = "otherProperty")
+ @XmlElement(name = "otherProperty")
+ @XmlJavaTypeAdapter(GO_Record.Since2014.class)
@UML(identifier="otherProperty", obligation=OPTIONAL, specification=ISO_19115)
public Record getOtherProperty() {
return otherProperty;
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=1825355&r1=1825354&r2=1825355&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] Mon Feb 26 11:28:17 2018
@@ -80,20 +80,31 @@
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
-@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = {
- @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI),
- @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
- @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
- @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+@XmlSchema(location="http://standards.iso.org/iso/19115/-3/mrc/1.0/mrc.xsd",
+ elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MRC,
+ xmlns = {
+ @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC), // Metadata for Resource Content
+ @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN), // Language localization
+ @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes
+ @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
})
@XmlAccessorType(XmlAccessType.NONE)
@XmlJavaTypeAdapters({
@XmlJavaTypeAdapter(CI_Citation.class),
+ @XmlJavaTypeAdapter(GO_Boolean.class),
+ @XmlJavaTypeAdapter(GO_GenericName.class),
+ @XmlJavaTypeAdapter(GO_Integer.class),
+ @XmlJavaTypeAdapter(GO_Real.class),
+ @XmlJavaTypeAdapter(GO_Record.class),
+ @XmlJavaTypeAdapter(GO_RecordType.class),
+ @XmlJavaTypeAdapter(MD_AttributeGroup.class),
@XmlJavaTypeAdapter(MD_CoverageContentTypeCode.class),
+ @XmlJavaTypeAdapter(MD_FeatureTypeInfo.class),
@XmlJavaTypeAdapter(MD_Identifier.class),
@XmlJavaTypeAdapter(MD_ImagingConditionCode.class),
@XmlJavaTypeAdapter(MD_RangeDimension.class),
@@ -101,16 +112,12 @@
@XmlJavaTypeAdapter(MI_PolarizationOrientationCode.class),
@XmlJavaTypeAdapter(MI_RangeElementDescription.class),
@XmlJavaTypeAdapter(MI_TransferFunctionTypeCode.class),
+ @XmlJavaTypeAdapter(PT_Locale.class),
// Java types, primitive types and basic OGC types handling
@XmlJavaTypeAdapter(UnitAdapter.class),
- @XmlJavaTypeAdapter(LocaleAdapter.class),
@XmlJavaTypeAdapter(InternationalStringAdapter.class),
- @XmlJavaTypeAdapter(GO_GenericName.class),
- @XmlJavaTypeAdapter(GO_RecordType.class),
- @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class),
- @XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class, value=GO_Integer.class),
- @XmlJavaTypeAdapter(GO_Real.class), @XmlJavaTypeAdapter(type=double.class, value=GO_Real.class)
+ @XmlJavaTypeAdapter(value=GO_Boolean.class, type=boolean.class)
})
package org.apache.sis.metadata.iso.content;
@@ -122,8 +129,7 @@ import javax.xml.bind.annotation.XmlAcce
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import org.apache.sis.xml.Namespaces;
-import org.apache.sis.internal.jaxb.Schemas;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
import org.apache.sis.internal.jaxb.gco.*;
-import org.apache.sis.internal.jaxb.gmd.*;
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=1825355&r1=1825354&r2=1825355&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] Mon Feb 26 11:28:17 2018
@@ -16,15 +16,21 @@
*/
package org.apache.sis.metadata.iso.distribution;
+import java.net.URI;
import java.util.Collection;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.opengis.util.LocalName;
import org.opengis.metadata.distribution.Format;
import org.opengis.metadata.distribution.DataFile;
-import org.opengis.util.LocalName;
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.opengis.util.InternationalString;
/**
@@ -48,16 +54,20 @@ import org.apache.sis.metadata.iso.ISOMe
*
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
-@XmlType(name = "MX_DataFile_Type", propOrder = {
+@XmlType(name = "MX_DataFile_Type", namespace = Namespaces.MDT, propOrder = {
+ "fileName",
+ "fileDescription",
+ "fileType",
"featureTypes",
"fileFormat"
})
-@XmlRootElement(name = "MX_DataFile", namespace = Namespaces.GMX)
+@XmlRootElement(name = "MX_DataFile", namespace = Namespaces.MDT)
public class DefaultDataFile extends ISOMetadata implements DataFile {
/**
* Serial number for inter-operability with different versions.
@@ -65,6 +75,27 @@ public class DefaultDataFile extends ISO
private static final long serialVersionUID = -4556006719009557349L;
/**
+ * Name or path of the file.
+ *
+ * @since 1.0
+ */
+ private URI fileName;
+
+ /**
+ * Text description of the file.
+ *
+ * @since 1.0
+ */
+ private InternationalString fileDescription;
+
+ /**
+ * Format in which the file is encoded.
+ *
+ * @since 1.0
+ */
+ private String fileType;
+
+ /**
* Provides the list of feature types concerned by the transfer data file. Depending on
* the transfer choices, a data file may contain data related to one or many feature types.
* This attribute may be omitted when the dataset is composed of a single file and/or the
@@ -74,7 +105,10 @@ public class DefaultDataFile extends ISO
/**
* Defines the format of the transfer data file.
+ *
+ * @deprecated Removed in latest XSD schemas.
*/
+ @Deprecated
private Format fileFormat;
/**
@@ -97,6 +131,7 @@ public class DefaultDataFile extends ISO
if (object != null) {
featureTypes = copyCollection(object.getFeatureTypes(), LocalName.class);
fileFormat = object.getFileFormat();
+ // TODO: copy other properties.
}
}
@@ -126,6 +161,82 @@ public class DefaultDataFile extends ISO
}
/**
+ * Returns the name or path of the file.
+ *
+ * @return file name, or {@code null}.
+ *
+ * @see org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic#getFileName()
+ * @since 1.0
+ */
+ @XmlElement(name = "fileName", required = true)
+ public URI getFileName() {
+ return fileName;
+ }
+
+ /**
+ * Sets the name or path of the file.
+ *
+ * @param newValue the new filename or path.
+ *
+ * @since 1.0
+ */
+ public void setFileName(final URI newValue) {
+ checkWritePermission();
+ fileName = newValue;
+ }
+
+ /**
+ * Returns the text description of the file.
+ *
+ * @return text description of the file, or {@code null}.
+ *
+ * @see org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic#getFileDescription()
+ * @since 1.0
+ */
+ @XmlElement(name = "fileDescription", required = true)
+ public InternationalString getFileDescription() {
+ return fileDescription;
+ }
+
+ /**
+ * Sets the text description of the file.
+ *
+ * @param newValue the new file description.
+ *
+ * @since 1.0
+ */
+ public void setFileDescription(final InternationalString newValue) {
+ checkWritePermission();
+ fileDescription = newValue;
+ }
+
+ /**
+ * Format in which the file is encoded.
+ *
+ * @return format in which the file is encoded, or {@code null}.
+ *
+ * @see org.apache.sis.metadata.iso.identification.DefaultBrowseGraphic#getFileType()
+ * @since 1.0
+ */
+ @XmlElement(name = "fileType", required = true)
+ @XmlJavaTypeAdapter(MimeFileTypeAdapter.class)
+ public String getFileType() {
+ return fileType;
+ }
+
+ /**
+ * Sets the format in which the illustration is encoded.
+ * Raster formats are encouraged to use one of the names returned by
+ * {@link javax.imageio.ImageIO#getReaderFormatNames()}.
+ *
+ * @param newValue the new file type.
+ */
+ public void setFileType(final String newValue) {
+ checkWritePermission();
+ fileType = newValue;
+ }
+
+ /**
* Returns the list of feature types concerned by the transfer data file. Depending on
* the transfer choices, a data file may contain data related to one or many feature types.
* This attribute may be omitted when the dataset is composed of a single file and/or the
@@ -134,7 +245,7 @@ public class DefaultDataFile extends ISO
* @return list of features types concerned by the transfer data file.
*/
@Override
- @XmlElement(name = "featureType", namespace = Namespaces.GMX)
+ @XmlElement(name = "featureTypes")
public Collection<LocalName> getFeatureTypes() {
return featureTypes = nonNullCollection(featureTypes, LocalName.class);
}
@@ -152,18 +263,24 @@ public class DefaultDataFile extends ISO
* Returns the format of the transfer data file.
*
* @return format of the transfer data file, or {@code null}.
+ *
+ * @deprecated Removed in latest XSD schemas.
*/
@Override
- @XmlElement(name = "fileFormat", namespace = Namespaces.GMX, required = true)
+ @Deprecated
+ @XmlElement(name = "fileFormat", namespace = LegacyNamespaces.GMX)
public Format getFileFormat() {
- return fileFormat;
+ return FilterByVersion.LEGACY_METADATA.accept() ? fileFormat : null;
}
/**
* Sets the format of the transfer data file.
*
* @param newValue the new file format value.
+ *
+ * @deprecated Removed in latest XSD schemas.
*/
+ @Deprecated
public void setFileFormat(final Format newValue) {
checkWritePermission();
fileFormat = newValue;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -20,7 +20,7 @@ import java.util.Collection;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.InternationalString;
import org.opengis.temporal.PeriodDuration;
import org.opengis.metadata.citation.OnlineResource;
@@ -31,10 +31,14 @@ import org.apache.sis.internal.metadata.
import org.apache.sis.measure.ValueRange;
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.internal.metadata.Dependencies;
+import org.apache.sis.internal.jaxb.gts.TM_PeriodDuration;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.util.CollectionsExt;
import static org.apache.sis.internal.metadata.MetadataUtilities.ensurePositive;
// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -54,16 +58,19 @@ import static org.opengis.annotation.Spe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@XmlType(name = "MD_DigitalTransferOptions_Type", propOrder = {
"unitsOfDistribution",
+ "distributionFormat",
"transferSize",
+ "transferFrequency",
"onLines",
- "offLine"
+ "offLines"
})
@XmlRootElement(name = "MD_DigitalTransferOptions")
public class DefaultDigitalTransferOptions extends ISOMetadata implements DigitalTransferOptions {
@@ -242,9 +249,15 @@ public class DefaultDigitalTransferOptio
*
* @since 0.5
*/
+ @XmlElement(name = "offLine")
@UML(identifier="offLine", obligation=OPTIONAL, specification=ISO_19115)
public Collection<Medium> getOffLines() {
- return offLines = nonNullCollection(offLines, Medium.class);
+ Collection<Medium> c = offLines = nonNullCollection(offLines, Medium.class);
+ if (c != null && c.size() > 1 && FilterByVersion.LEGACY_METADATA.accept()) {
+ c = CollectionsExt.singletonOrEmpty(LegacyPropertyAdapter.getSingleton(c,
+ Medium.class, null, DefaultDigitalTransferOptions.class, "getOffLines"));
+ }
+ return c;
}
/**
@@ -267,7 +280,6 @@ public class DefaultDigitalTransferOptio
*/
@Override
@Deprecated
- @XmlElement(name = "offLine")
@Dependencies("getOffLines")
public Medium getOffLine() {
return LegacyPropertyAdapter.getSingleton(getOffLines(), Medium.class, null, DefaultDigitalTransferOptions.class, "getOffLine");
@@ -292,6 +304,8 @@ public class DefaultDigitalTransferOptio
*
* @since 0.5
*/
+ @XmlElement(name = "transferFrequency")
+ @XmlJavaTypeAdapter(TM_PeriodDuration.Since2014.class)
@UML(identifier="transferFrequency", obligation=OPTIONAL, specification=ISO_19115)
public PeriodDuration getTransferFrequency() {
return transferFrequency;
@@ -316,6 +330,7 @@ public class DefaultDigitalTransferOptio
*
* @since 0.5
*/
+ // @XmlElement at the end of this class.
@UML(identifier="distributionFormat", obligation=OPTIONAL, specification=ISO_19115)
public Collection<Format> getDistributionFormats() {
return distributionFormats = nonNullCollection(distributionFormats, Format.class);
@@ -331,4 +346,28 @@ public class DefaultDigitalTransferOptio
public void setDistributionFormats(final Collection<? extends Format> newValues) {
distributionFormats = writeCollection(newValues, distributionFormats, Format.class);
}
+
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+ //////// ////////
+ //////// XML support with JAXB ////////
+ //////// ////////
+ //////// The following methods are invoked by JAXB using reflection (even if ////////
+ //////// they are private) or are helpers for other methods invoked by JAXB. ////////
+ //////// Those methods can be safely removed if Geographic Markup Language ////////
+ //////// (GML) support is not needed. ////////
+ //////// ////////
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Invoked by JAXB at both marshalling and unmarshalling time.
+ * This attribute has been added by ISO 19115:2014 standard.
+ * If (and only if) marshalling an older standard version, we omit this attribute.
+ */
+ @XmlElement(name = "distributionFormat")
+ private Collection<Format> getDistributionFormat() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? getDistributionFormats() : null;
+ }
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -20,7 +20,7 @@ import java.util.Collection;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.InternationalString;
import org.opengis.metadata.distribution.DigitalTransferOptions;
import org.opengis.metadata.distribution.Distribution;
@@ -28,7 +28,10 @@ import org.opengis.metadata.distribution
import org.opengis.metadata.distribution.Format;
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.metadata.TitleProperty;
+import org.apache.sis.internal.jaxb.gco.InternationalStringAdapter;
+// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -56,13 +59,15 @@ import static org.opengis.annotation.Spe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@TitleProperty(name = "description")
@XmlType(name = "MD_Distribution_Type", propOrder = {
+ "description", // New in ISO 19115-3
"distributionFormats",
"distributors",
"transferOptions"
@@ -154,6 +159,8 @@ public class DefaultDistribution extends
*
* @since 0.5
*/
+ @XmlElement(name = "description")
+ @XmlJavaTypeAdapter(InternationalStringAdapter.Since2014.class)
@UML(identifier="description", obligation=OPTIONAL, specification=ISO_19115)
public InternationalString getDescription() {
return description;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -55,7 +55,7 @@ import org.apache.sis.metadata.iso.ISOMe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @version 1.0
* @since 0.3
* @module
*/
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -21,7 +21,7 @@ import java.util.function.BiConsumer;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.InternationalString;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.distribution.Format;
@@ -29,10 +29,15 @@ import org.opengis.metadata.distribution
import org.opengis.metadata.distribution.Distributor;
import org.apache.sis.internal.metadata.Dependencies;
import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.metadata.MD_Medium;
+import org.apache.sis.internal.jaxb.metadata.CI_Citation;
import org.apache.sis.metadata.iso.citation.DefaultCitation;
import org.apache.sis.metadata.iso.ISOMetadata;
-// Branch-dependent imports
+// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Obligation.MANDATORY;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -81,17 +86,23 @@ import static org.opengis.annotation.Spe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.8
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@XmlType(name = "MD_Format_Type", propOrder = {
+ // ISO 19115:2003 (legacy)
"name",
"version",
"amendmentNumber",
"specification",
+
+ // ISO 19115:2014
+ "formatSpecificationCitation",
"fileDecompressionTechnique",
+ "media",
"formatDistributors"
})
@XmlRootElement(name = "MD_Format")
@@ -191,7 +202,8 @@ public class DefaultFormat extends ISOMe
*
* @since 0.5
*/
-/// @XmlElement(name = "formatSpecificationCitation", required = true)
+ @XmlElement(name = "formatSpecificationCitation", required = true)
+ @XmlJavaTypeAdapter(CI_Citation.Since2014.class)
@UML(identifier="formatSpecificationCitation", obligation=MANDATORY, specification=ISO_19115)
public Citation getFormatSpecificationCitation() {
return formatSpecificationCitation;
@@ -240,11 +252,16 @@ public class DefaultFormat extends ISOMe
*/
@Override
@Deprecated
- @XmlElement(name = "specification")
@Dependencies("getFormatSpecificationCitation")
+ @XmlElement(name = "specification", namespace = LegacyNamespaces.GMD)
public InternationalString getSpecification() {
- final Citation citation = getFormatSpecificationCitation();
- return (citation != null) ? citation.getTitle() : null;
+ if (FilterByVersion.LEGACY_METADATA.accept()) {
+ final Citation citation = getFormatSpecificationCitation();
+ if (citation != null) {
+ return citation.getTitle();
+ }
+ }
+ return null;
}
/**
@@ -273,13 +290,15 @@ public class DefaultFormat extends ISOMe
*/
@Override
@Deprecated
- @XmlElement(name = "name", required = true)
@Dependencies("getFormatSpecificationCitation")
+ @XmlElement(name = "name", namespace = LegacyNamespaces.GMD)
public InternationalString getName() {
- final Citation citation = getFormatSpecificationCitation();
- if (citation != null) {
- return LegacyPropertyAdapter.getSingleton(citation.getAlternateTitles(),
- InternationalString.class, null, DefaultFormat.class, "getName");
+ if (FilterByVersion.LEGACY_METADATA.accept()) {
+ final Citation citation = getFormatSpecificationCitation();
+ if (citation != null) {
+ return LegacyPropertyAdapter.getSingleton(citation.getAlternateTitles(),
+ InternationalString.class, null, DefaultFormat.class, "getName");
+ }
}
return null;
}
@@ -311,11 +330,16 @@ public class DefaultFormat extends ISOMe
*/
@Override
@Deprecated
- @XmlElement(name = "version", required = true)
@Dependencies("getFormatSpecificationCitation")
+ @XmlElement(name = "version", namespace = LegacyNamespaces.GMD)
public InternationalString getVersion() {
- final Citation citation = getFormatSpecificationCitation();
- return (citation != null) ? citation.getEdition() : null;
+ if (FilterByVersion.LEGACY_METADATA.accept()) {
+ final Citation citation = getFormatSpecificationCitation();
+ if (citation != null) {
+ return citation.getEdition();
+ }
+ }
+ return null;
}
/**
@@ -385,7 +409,8 @@ public class DefaultFormat extends ISOMe
*
* @since 0.5
*/
-/// @XmlElement(name = "medium")
+ @XmlElement(name = "medium")
+ @XmlJavaTypeAdapter(MD_Medium.Since2014.class)
@UML(identifier="medium", obligation=OPTIONAL, specification=ISO_19115)
public Collection<Medium> getMedia() {
return media = nonNullCollection(media, Medium.class);
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -21,7 +21,7 @@ import javax.measure.Unit;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.InternationalString;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.distribution.Medium;
@@ -30,13 +30,18 @@ import org.opengis.metadata.distribution
import org.apache.sis.measure.ValueRange;
import org.apache.sis.metadata.TitleProperty;
import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.internal.jaxb.gco.GO_Real;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
import org.apache.sis.internal.jaxb.NonMarshalledAuthority;
+import org.apache.sis.internal.jaxb.metadata.MD_Identifier;
import org.apache.sis.internal.metadata.Dependencies;
import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
import static org.apache.sis.internal.metadata.MetadataUtilities.ensurePositive;
// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
@@ -61,14 +66,17 @@ import static org.opengis.annotation.Spe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@TitleProperty(name = "name")
@XmlType(name = "MD_Medium_Type", propOrder = {
+ "identifier", // New in ISO 19115-3
"name",
+ "density",
"densities",
"densityUnits",
"volumes",
@@ -179,6 +187,9 @@ public class DefaultMedium extends ISOMe
* Returns the name of the medium on which the resource can be received.
*
* @return name of the medium, or {@code null}.
+ *
+ * @see <a href="https://issues.apache.org/jira/browse/SIS-389">SIS-389</a>
+ *
*/
@Override
@XmlElement(name = "name")
@@ -204,6 +215,8 @@ public class DefaultMedium extends ISOMe
*
* @since 0.5
*/
+ @XmlElement(name = "density")
+ @XmlJavaTypeAdapter(GO_Real.Since2014.class)
@ValueRange(minimum = 0, isMinIncluded = false)
@UML(identifier="density", obligation=OPTIONAL, specification=ISO_19115)
public Double getDensity() {
@@ -233,9 +246,10 @@ public class DefaultMedium extends ISOMe
*/
@Override
@Deprecated
- @XmlElement(name = "density")
@Dependencies("getDensity")
+ @XmlElement(name = "density", namespace = LegacyNamespaces.GMD)
public Collection<Double> getDensities() {
+ if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
return densities = nonNullCollection(densities, Double.class);
}
@@ -343,7 +357,8 @@ public class DefaultMedium extends ISOMe
*
* @since 0.5
*/
-/// @XmlElement(name = "identifier")
+ @XmlElement(name = "identifier")
+ @XmlJavaTypeAdapter(MD_Identifier.Since2014.class)
@UML(identifier="identifier", obligation=OPTIONAL, specification=ISO_19115)
public Identifier getIdentifier() {
return NonMarshalledAuthority.getMarshallable(identifiers);
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -16,18 +16,22 @@
*/
package org.apache.sis.metadata.iso.distribution;
-import java.util.Currency;
import java.util.Date;
+import java.util.Currency;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.opengis.annotation.UML;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opengis.util.Record;
import org.opengis.util.RecordType;
import org.opengis.util.InternationalString;
import org.opengis.metadata.distribution.StandardOrderProcess;
+import org.apache.sis.internal.jaxb.gco.GO_RecordType;
+import org.apache.sis.internal.jaxb.gco.GO_Record;
import org.apache.sis.metadata.iso.ISOMetadata;
+// Branch-specific imports
+import org.opengis.annotation.UML;
import static org.opengis.annotation.Obligation.OPTIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
import static org.apache.sis.internal.metadata.MetadataUtilities.toDate;
@@ -50,7 +54,8 @@ import static org.apache.sis.internal.me
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
@@ -59,7 +64,9 @@ import static org.apache.sis.internal.me
"fees",
"plannedAvailableDateTime",
"orderingInstructions",
- "turnaround"
+ "turnaround",
+ "orderOptionType", // New in ISO 19115-3
+ "orderOptions" // New in ISO 19115-3
})
@XmlRootElement(name = "MD_StandardOrderProcess")
public class DefaultStandardOrderProcess extends ISOMetadata implements StandardOrderProcess {
@@ -294,7 +301,8 @@ public class DefaultStandardOrderProcess
*
* @see org.apache.sis.util.iso.DefaultRecord#getRecordType()
*/
-/// @XmlElement(name = "orderOptionType")
+ @XmlElement(name = "orderOptionsType")
+ @XmlJavaTypeAdapter(GO_RecordType.Since2014.class)
@UML(identifier="orderOptionType", obligation=OPTIONAL, specification=ISO_19115)
public RecordType getOrderOptionType() {
return orderOptionType;
@@ -323,7 +331,8 @@ public class DefaultStandardOrderProcess
* when he ordered the resource. We presume that this is not a record to be filled by the user for new
* orders, otherwise this method would need to be a factory rather than a getter.
*/
-/// @XmlElement(name = "orderOptions")
+ @XmlElement(name = "orderOptions")
+ @XmlJavaTypeAdapter(GO_Record.Since2014.class)
@UML(identifier="orderOptions", obligation=OPTIONAL, specification=ISO_19115)
public Record getOrderOptions() {
return orderOptions;
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=1825355&r1=1825354&r2=1825355&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] Mon Feb 26 11:28:17 2018
@@ -69,35 +69,41 @@
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.5
+ * @author Cullen Rombach (Image Matters)
+ * @version 1.0
* @since 0.3
* @module
*/
-@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = {
- @XmlNs(prefix = "gmx", namespaceURI = Namespaces.GMX),
- @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
- @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
- @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+@XmlSchema(location="http://standards.iso.org/iso/19115/-3/mrd/1.0/mrd.xsd",
+ elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MRD,
+ xmlns = {
+ @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD), // Metadata for Resource Distribution
+ @XmlNs(prefix = "mdt", namespaceURI = Namespaces.MDT), // Metadata for Data Transfer
+ @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes
+ @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD),
+ @XmlNs(prefix = "gmx", namespaceURI = LegacyNamespaces.GMX)
})
@XmlAccessorType(XmlAccessType.NONE)
@XmlJavaTypeAdapters({
+ @XmlJavaTypeAdapter(CI_OnlineResource.class),
+ @XmlJavaTypeAdapter(CI_Responsibility.class),
+ @XmlJavaTypeAdapter(GO_DateTime.class),
+ @XmlJavaTypeAdapter(GO_Integer.class),
+ @XmlJavaTypeAdapter(GO_LocalName.class),
+ @XmlJavaTypeAdapter(GO_Real.class),
@XmlJavaTypeAdapter(MD_DigitalTransferOptions.class),
@XmlJavaTypeAdapter(MD_Distributor.class),
@XmlJavaTypeAdapter(MD_Format.class),
@XmlJavaTypeAdapter(MD_Medium.class),
@XmlJavaTypeAdapter(MD_MediumFormatCode.class),
@XmlJavaTypeAdapter(MD_MediumNameCode.class),
- @XmlJavaTypeAdapter(CI_OnlineResource.class),
@XmlJavaTypeAdapter(CI_ResponsibleParty.class),
@XmlJavaTypeAdapter(MD_StandardOrderProcess.class),
// Java types, primitive types and basic OGC types handling
+ @XmlJavaTypeAdapter(URIAdapter.class),
@XmlJavaTypeAdapter(UnitAdapter.class),
- @XmlJavaTypeAdapter(InternationalStringAdapter.class),
- @XmlJavaTypeAdapter(GO_LocalName.class),
- @XmlJavaTypeAdapter(GO_DateTime.class),
- @XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class, value=GO_Integer.class),
- @XmlJavaTypeAdapter(GO_Real.class), @XmlJavaTypeAdapter(type=double.class, value=GO_Real.class)
+ @XmlJavaTypeAdapter(InternationalStringAdapter.class)
})
package org.apache.sis.metadata.iso.distribution;
@@ -109,7 +115,7 @@ import javax.xml.bind.annotation.XmlAcce
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import org.apache.sis.xml.Namespaces;
-import org.apache.sis.internal.jaxb.Schemas;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
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/extent/AbstractGeographicExtent.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -42,13 +42,13 @@ import org.apache.sis.metadata.iso.ISOMe
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.4
+ * @version 1.0
* @since 0.3
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
@XmlType(name = "AbstractEX_GeographicExtent_Type")
-@XmlRootElement(name = "EX_GeographicExtent")
+@XmlRootElement(name = "AbstractEX_GeographicExtent")
@XmlSeeAlso({
DefaultGeographicBoundingBox.class,
DefaultBoundingPolygon.class,
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -47,7 +47,7 @@ import org.opengis.metadata.extent.Bound
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @author Guilhem Legal (Geomatys)
- * @version 0.8
+ * @version 1.0
* @since 0.3
* @module
*/
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -82,7 +82,7 @@ import org.apache.sis.xml.NilReason;
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.8
+ * @version 1.0
*
* @see Extents#getGeographicBoundingBox(Extent)
* @see org.apache.sis.referencing.AbstractReferenceSystem#getDomainOfValidity()
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -107,7 +107,7 @@ import static java.lang.Double.doubleToL
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.8
+ * @version 1.0
*
* @see org.apache.sis.geometry.GeneralEnvelope
*
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java [UTF-8] Mon Feb 26 11:28:17 2018
@@ -58,7 +58,7 @@ import org.apache.sis.util.iso.Types;
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
- * @version 0.6
+ * @version 1.0
* @since 0.3
* @module
*/