You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/08/07 19:10:00 UTC
svn commit: r1616545 [1/2] - in /sis/branches/JDK6: ./
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acqui...
Author: desruisseaux
Date: Thu Aug 7 17:09:59 2014
New Revision: 1616545
URL: http://svn.apache.org/r1616545
Log:
Merge from the JDK7 branch.
Added:
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataScope.java
- copied unchanged from r1616540, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataScope.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultReleasability.java
- copied unchanged from r1616540, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultReleasability.java
Removed:
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMetadataScope.java
sis/branches/JDK6/src/main/docbook/
sis/branches/JDK6/src/site/resources/book/
Modified:
sis/branches/JDK6/ (props changed)
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_MetadataScope.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
sis/branches/JDK6/pom.xml
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
Merged /sis/branches/JDK8:r1615099-1616536
Merged /sis/branches/JDK7:r1615102-1616540
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_MetadataScope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_MetadataScope.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_MetadataScope.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_MetadataScope.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -17,8 +17,8 @@
package org.apache.sis.internal.jaxb.metadata;
import javax.xml.bind.annotation.XmlElementRef;
-import org.opengis.metadata.maintenance.MetadataScope;
-import org.apache.sis.metadata.iso.maintenance.DefaultMetadataScope;
+import org.opengis.metadata.MetadataScope;
+import org.apache.sis.metadata.iso.DefaultMetadataScope;
import org.apache.sis.internal.jaxb.gco.PropertyType;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -26,6 +26,7 @@ import org.opengis.metadata.citation.Res
import org.opengis.metadata.ExtendedElementInformation;
import org.opengis.util.InternationalString;
import org.apache.sis.measure.ValueRange;
+import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.iso.Types;
@@ -398,7 +399,7 @@ public class DefaultExtendedElementInfor
* @return Maximum occurrence of the extended element, or {@code null}.
*/
@Override
- @ValueRange(minimum=0)
+ @ValueRange(minimum = 0)
@XmlElement(name = "maximumOccurrence")
public Integer getMaximumOccurrence() {
return maximumOccurrence;
@@ -408,9 +409,13 @@ public class DefaultExtendedElementInfor
* Sets the maximum occurrence of the extended element.
*
* @param newValue The new maximum occurrence.
+ * @throws IllegalArgumentException if the given value is negative.
*/
- public void setMaximumOccurrence(final Integer newValue) {
+ public void setMaximumOccurrence(final Integer newValue) throws IllegalArgumentException {
checkWritePermission();
+ if (newValue != null) {
+ ArgumentChecks.ensurePositive("maximumOccurrence", newValue);
+ }
maximumOccurrence = newValue;
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -23,6 +23,7 @@ import org.opengis.metadata.acquisition.
import org.opengis.util.InternationalString;
import org.apache.sis.measure.ValueRange;
import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.util.ArgumentChecks;
/**
@@ -153,7 +154,7 @@ public class DefaultEnvironmentalRecord
* @return Maximum relative humidity along the flight pass during the photo flight, or {@code null}.
*/
@Override
- @ValueRange(minimum=0, maximum=100)
+ @ValueRange(minimum = 0, maximum = 100)
@XmlElement(name = "maxRelativeHumidity", required = true)
public Double getMaxRelativeHumidity() {
return maxRelativeHumidity;
@@ -166,6 +167,9 @@ public class DefaultEnvironmentalRecord
*/
public void setMaxRelativeHumidity(final Double newValue) {
checkWritePermission();
+ if (newValue != null) {
+ ArgumentChecks.ensureBetween("maxRelativeHumidity", 0, 100, newValue);
+ }
maxRelativeHumidity = newValue;
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -309,7 +309,7 @@ public class DefaultContact extends ISOM
*
* @param newValue The new address, or {@code null} if none.
*
- * @deprecated As of ISO 19115:2014, replaced by {@link #setAddresses(Collectio)}.
+ * @deprecated As of ISO 19115:2014, replaced by {@link #setAddresses(Collection)}.
*/
@Deprecated
public final void setAddress(final Address newValue) {
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -82,7 +82,7 @@ public class DefaultConstraints extends
/**
* Spatial and / or temporal extent and or level of the application of the constraints restrictions.
*/
- private Collection<Scope> constraintApplicationScopes;
+ private Scope constraintApplicationScope;
/**
* Graphic / symbol indicating the constraint.
@@ -131,12 +131,12 @@ public class DefaultConstraints extends
public DefaultConstraints(final Constraints object) {
super(object);
if (object != null) {
- useLimitations = copyCollection(object.getUseLimitations(), InternationalString.class);
- constraintApplicationScopes = copyCollection(object.getConstraintApplicationScopes(), Scope.class);
- graphics = copyCollection(object.getGraphics(), BrowseGraphic.class);
- references = copyCollection(object.getReferences(), Citation.class);
- releasability = object.getReleasability();
- responsibleParties = copyCollection(object.getResponsibleParties(), Responsibility.class);
+ useLimitations = copyCollection(object.getUseLimitations(), InternationalString.class);
+ constraintApplicationScope = object.getConstraintApplicationScope();
+ graphics = copyCollection(object.getGraphics(), BrowseGraphic.class);
+ references = copyCollection(object.getReferences(), Citation.class);
+ releasability = object.getReleasability();
+ responsibleParties = copyCollection(object.getResponsibleParties(), Responsibility.class);
}
}
@@ -209,19 +209,20 @@ public class DefaultConstraints extends
*/
@Override
/// @XmlElement(name = "constraintApplicationScope")
- public Collection<Scope> getConstraintApplicationScopes() {
- return constraintApplicationScopes = nonNullCollection(constraintApplicationScopes, Scope.class);
+ public Scope getConstraintApplicationScope() {
+ return constraintApplicationScope;
}
/**
* Sets the spatial and / or temporal extents and or levels of the application of the constraints restrictions.
*
- * @param newValues The new spatial and / or temporal extents.
+ * @param newValue The new spatial and / or temporal extents.
*
* @since 0.5
*/
- public void setConstraintApplicationScopes(final Collection<? extends Scope> newValues) {
- constraintApplicationScopes = writeCollection(newValues, constraintApplicationScopes, Scope.class);
+ public void setConstraintApplicationScope(final Scope newValue) {
+ checkWritePermission();
+ constraintApplicationScope = newValue;
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -27,11 +27,13 @@ import org.opengis.metadata.constraint.L
/**
* Restrictions and legal prerequisites for accessing and using the resource.
- * The {@linkplain #getOtherConstraints() other constraint} element shall be non-empty only if
+ *
+ * {@section Relationship between properties}
+ * The {@linkplain #getOtherConstraints() other constraints} collection shall be non-empty if
* {@linkplain #getAccessConstraints() access constraints} and/or {@linkplain #getUseConstraints()
* use constraints} elements have a value of {@link Restriction#OTHER_RESTRICTIONS}.
*
- * <p><b>Limitations:</b></p>
+ * {@section Limitations}
* <ul>
* <li>Instances of this class are not synchronized for multi-threading.
* Synchronization, if needed, is caller's responsibility.</li>
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -54,7 +54,7 @@ public class DefaultSecurityConstraints
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 621767670847345848L;;
+ private static final long serialVersionUID = 621767670847345848L;
/**
* Name of the handling restrictions on the resource.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -30,14 +30,16 @@
* <th class="sep">Aggregation hierarchy</th>
* </tr><tr><td style="width: 50%; white-space: nowrap">
* {@linkplain org.apache.sis.metadata.iso.ISOMetadata ISO-19115 metadata}<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultConstraints Constraints}<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints Legal constraints}<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints Security constraints}<br>
+ * {@code ├─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultConstraints Constraints}<br>
+ * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints Legal constraints}<br>
+ * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints Security constraints}<br>
+ * {@code └─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultReleasability Releasability}<br>
* {@linkplain org.opengis.util.CodeList Code list}<br>
* {@code ├─} {@linkplain org.opengis.metadata.constraint.Restriction Restriction}<br>
* {@code └─} {@linkplain org.opengis.metadata.constraint.Classification Classification}<br>
* </td><td class="sep" style="width: 50%; white-space: nowrap">
* {@linkplain org.apache.sis.metadata.iso.constraint.DefaultConstraints Constraints}<br>
+ * {@code └─} {@linkplain org.apache.sis.metadata.iso.constraint.DefaultReleasability Releasability}<br>
* {@linkplain org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints Legal constraints}<br>
* {@code └─} {@linkplain org.opengis.metadata.constraint.Restriction Restriction} «code list»<br>
* {@linkplain org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints Security constraints}<br>
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -26,7 +26,7 @@ import org.apache.sis.metadata.iso.ISOMe
/**
- * Description of the content of a dataset.
+ * Description of the content of a resource.
*
* <p><b>Limitations:</b></p>
* <ul>
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -47,7 +47,7 @@ import org.apache.sis.metadata.iso.ISOMe
*/
@XmlType(name = "MD_AttributeGroup_Type", propOrder = {
"contentType",
- "groupAttribute"
+ "attribute"
})
@XmlRootElement(name = "MD_AttributeGroup")
public class DefaultAttributeGroup extends ISOMetadata implements AttributeGroup {
@@ -64,12 +64,23 @@ public class DefaultAttributeGroup exten
/**
* Content type for attributes groups for a {@link RangeDimension}.
*/
- private Collection<RangeDimension> groupAttributes;
+ private Collection<RangeDimension> attributes;
/**
* Constructs an initially empty attribute group.
*/
- public DefaultAttributeGroup(){
+ public DefaultAttributeGroup() {
+ }
+
+ /**
+ * Constructs an attribute group initialized to the given values.
+ *
+ * @param contentType Type of information represented by the value, or {@code null}.
+ * @param attribute The attribute, or {@code null}.
+ */
+ public DefaultAttributeGroup(final CoverageContentType contentType, final RangeDimension attribute) {
+ contentTypes = singleton(contentType, CoverageContentType.class);
+ attributes = singleton(attribute, RangeDimension.class);
}
/**
@@ -84,8 +95,8 @@ public class DefaultAttributeGroup exten
public DefaultAttributeGroup(final AttributeGroup object) {
super(object);
if (object != null) {
- contentTypes = copyCollection(object.getContentTypes(), CoverageContentType.class);
- groupAttributes = copyCollection(object.getGroupAttributes(), RangeDimension.class);
+ contentTypes = copyCollection(object.getContentTypes(), CoverageContentType.class);
+ attributes = copyCollection(object.getAttributes(), RangeDimension.class);
}
}
@@ -135,22 +146,22 @@ public class DefaultAttributeGroup exten
}
/**
- * Returns the content types for attributes groups for a {@code RangeDimension}, or {@code null} if none.
+ * Returns information on an attribute of the resource.
*
- * @return The content types for attributes groups for a {@code RangeDimension}, or {@code null} if none.
+ * @return Information on an attribute of the resource.
*/
@Override
- @XmlElement(name = "groupAttribute")
- public Collection<RangeDimension> getGroupAttributes() {
- return groupAttributes = nonNullCollection(groupAttributes, RangeDimension.class);
+ @XmlElement(name = "attribute")
+ public Collection<RangeDimension> getAttributes() {
+ return attributes = nonNullCollection(attributes, RangeDimension.class);
}
/**
- * Sets the content types for attributes groups for a {@code RangeDimension}.
+ * Sets information on an attribute of the resource.
*
- * @param newValues The new content types for attributes groups for a {@code RangeDimension}.
+ * @param newValues The new attributes.
*/
- public void setGroupAttributes(final Collection<? extends RangeDimension> newValues) {
- groupAttributes = writeCollection(newValues, groupAttributes, RangeDimension.class);
+ public void setAttributes(final Collection<? extends RangeDimension> newValues) {
+ attributes = writeCollection(newValues, attributes, RangeDimension.class);
}
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -187,7 +187,7 @@ public class DefaultBand extends Default
* @since 0.5
*/
@Override
- @ValueRange(minimum=0)
+ @ValueRange(minimum = 0)
/// @XmlElement(name = "boundMax")
public Double getBoundMax() {
return boundMax;
@@ -215,7 +215,7 @@ public class DefaultBand extends Default
* @since 0.5
*/
@Override
- @ValueRange(minimum=0)
+ @ValueRange(minimum = 0)
/// @XmlElement(name = "boundMin")
public Double getBoundMin() {
return boundMin;
@@ -265,7 +265,7 @@ public class DefaultBand extends Default
* @return Wavelength at which the response is the highest, or {@code null} if unspecified.
*/
@Override
- @ValueRange(minimum=0)
+ @ValueRange(minimum = 0)
@XmlElement(name = "peakResponse")
public Double getPeakResponse() {
return peakResponse;
@@ -285,7 +285,7 @@ public class DefaultBand extends Default
* {@inheritDoc}
*/
@Override
- @ValueRange(minimum=1)
+ @ValueRange(minimum = 1)
@XmlElement(name = "bitsPerValue")
public Integer getBitsPerValue() {
return super.getBitsPerValue();
@@ -305,7 +305,7 @@ public class DefaultBand extends Default
* @return Number of discrete numerical values in the grid data, or {@code null} if none.
*/
@Override
- @ValueRange(minimum=0)
+ @ValueRange(minimum = 0)
@XmlElement(name = "toneGradation")
public Integer getToneGradation() {
return toneGradation;
@@ -383,7 +383,7 @@ public class DefaultBand extends Default
* @return Smallest distance between which separate points can be distinguished, or {@code null}.
*/
@Override
- @ValueRange(minimum=0, isMinIncluded=false)
+ @ValueRange(minimum = 0, isMinIncluded = false)
@XmlElement(name = "nominalSpatialResolution", namespace = Namespaces.GMI)
public Double getNominalSpatialResolution() {
return nominalSpatialResolution;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -289,20 +289,20 @@ public class DefaultCoverageDescription
/** Stores a legacy value into the new kind of value. */
@Override protected AttributeGroup wrap(final RangeDimension value) {
final DefaultAttributeGroup container = new DefaultAttributeGroup();
- container.setGroupAttributes(asCollection(value));
+ container.setAttributes(asCollection(value));
return container;
}
/** Extracts the legacy value from the new kind of value. */
@Override protected RangeDimension unwrap(final AttributeGroup container) {
- return getSingleton(container.getGroupAttributes(), RangeDimension.class,
+ return getSingleton(container.getAttributes(), RangeDimension.class,
this, DefaultCoverageDescription.class, "getDimensions");
}
/** Updates the legacy value in an existing instance of the new kind of value. */
@Override protected boolean update(final AttributeGroup container, final RangeDimension value) {
if (container instanceof DefaultAttributeGroup) {
- ((DefaultAttributeGroup) container).setGroupAttributes(asCollection(value));
+ ((DefaultAttributeGroup) container).setAttributes(asCollection(value));
return true;
}
return false;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -24,10 +24,12 @@ import javax.xml.bind.annotation.XmlRoot
import org.opengis.util.GenericName;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.content.FeatureCatalogueDescription;
+import org.opengis.metadata.content.FeatureTypeInfo;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
/**
- * Information identifying the feature catalogue.
+ * Information identifying the feature catalogue or the conceptual schema.
*
* <p><b>Limitations:</b></p>
* <ul>
@@ -42,7 +44,7 @@ import org.opengis.metadata.content.Feat
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @since 0.3 (derived from geotk-2.1)
- * @version 0.4
+ * @version 0.5
* @module
*/
@XmlType(name = "MD_FeatureCatalogueDescription_Type", propOrder = {
@@ -59,7 +61,7 @@ public class DefaultFeatureCatalogueDesc
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -3626075463499626815L;
+ private static final long serialVersionUID = 5731044701122380718L;
/**
* Whether or not the cited feature catalogue complies with ISO 19110.
@@ -76,14 +78,14 @@ public class DefaultFeatureCatalogueDesc
private Collection<Locale> languages;
/**
- * Whether or not the feature catalogue is included with the dataset.
+ * Whether or not the feature catalogue is included with the resource.
*/
private boolean includedWithDataset;
/**
- * Subset of feature types from cited feature catalogue occurring in dataset.
+ * Subset of feature types from cited feature catalogue occurring in resource.
*/
- private Collection<GenericName> featureTypes;
+ private Collection<FeatureTypeInfo> featureTypes;
/**
* Complete bibliographic reference to one or more external feature catalogues.
@@ -111,7 +113,7 @@ public class DefaultFeatureCatalogueDesc
compliant = object.isCompliant();
includedWithDataset = object.isIncludedWithDataset();
languages = copyCollection(object.getLanguages(), Locale.class);
- featureTypes = copyCollection(object.getFeatureTypes(), GenericName.class);
+ featureTypes = copyCollection(object.getFeatureTypeInfo(), FeatureTypeInfo.class);
featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class);
}
}
@@ -183,9 +185,9 @@ public class DefaultFeatureCatalogueDesc
}
/**
- * Returns whether or not the feature catalogue is included with the dataset.
+ * Returns whether or not the feature catalogue is included with the resource.
*
- * @return Whether or not the feature catalogue is included with the dataset.
+ * @return Whether or not the feature catalogue is included with the resource.
*/
@Override
@XmlElement(name = "includedWithDataset", required = true)
@@ -194,7 +196,7 @@ public class DefaultFeatureCatalogueDesc
}
/**
- * Sets whether or not the feature catalogue is included with the dataset.
+ * Sets whether or not the feature catalogue is included with the resource.
*
* @param newValue {@code true} if the feature catalogue is included.
*/
@@ -204,23 +206,72 @@ public class DefaultFeatureCatalogueDesc
}
/**
- * Returns the subset of feature types from cited feature catalogue occurring in dataset.
+ * Returns the subset of feature types from cited feature catalogue occurring in resource.
*
- * @return Subset of feature types occurring in dataset.
+ * @return Subset of feature types occurring in resource.
+ *
+ * @since 0.5
*/
@Override
- @XmlElement(name = "featureTypes")
- public Collection<GenericName> getFeatureTypes() {
- return featureTypes = nonNullCollection(featureTypes, GenericName.class);
+ public Collection<FeatureTypeInfo> getFeatureTypeInfo() {
+ return featureTypes = nonNullCollection(featureTypes, FeatureTypeInfo.class);
}
/**
- * Sets the subset of feature types from cited feature catalogue occurring in dataset.
+ * Sets the subset of feature types from cited feature catalogue occurring in resource.
*
* @param newValues The new feature types.
+ *
+ * @since 0.5
+ */
+ public void setFeatureTypeInfo(final Collection<? extends FeatureTypeInfo> newValues) {
+ featureTypes = writeCollection(newValues, featureTypes, FeatureTypeInfo.class);
+ }
+
+ /**
+ * Returns the names of {@linkplain #getFeatureTypes() feature types}.
+ *
+ * @return The feature type names.
+ *
+ * @deprecated As of ISO 19115:2014, replaced by {@link #getFeatureTypeInfo()}.
*/
- public void setFeatureTypes(final Collection<? extends GenericName> newValues) {
- featureTypes = writeCollection(newValues, featureTypes, GenericName.class);
+ @Override
+ @Deprecated
+ @XmlElement(name = "featureTypes")
+ public final Collection<GenericName> getFeatureTypes() {
+ return new LegacyPropertyAdapter<GenericName,FeatureTypeInfo>(getFeatureTypeInfo()) {
+ /** Stores a legacy value into the new kind of value. */
+ @Override protected FeatureTypeInfo wrap(final GenericName value) {
+ return new DefaultFeatureTypeInfo(value);
+ }
+
+ /** Extracts the legacy value from the new kind of value. */
+ @Override protected GenericName unwrap(final FeatureTypeInfo container) {
+ return container.getFeatureTypeName();
+ }
+
+ /** Updates the legacy value in an existing instance of the new kind of value. */
+ @Override protected boolean update(final FeatureTypeInfo container, final GenericName value) {
+ if (container instanceof DefaultFeatureTypeInfo) {
+ ((DefaultFeatureTypeInfo) container).setFeatureTypeName(value);
+ return true;
+ }
+ return false;
+ }
+ }.validOrNull();
+ }
+
+ /**
+ * Sets the names of {@linkplain #getFeatureTypes() feature types}.
+ *
+ * @param newValues The new feature type names.
+ *
+ * @deprecated As of ISO 19115:2014, replaced by {@link #setFeatureTypeInfo(Collection)}.
+ */
+ @Deprecated
+ public final void setFeatureTypes(final Collection<? extends GenericName> newValues) {
+ checkWritePermission();
+ ((LegacyPropertyAdapter<GenericName,?>) getFeatureTypes()).setValues(newValues);
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureTypeInfo.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -72,17 +72,12 @@ public class DefaultFeatureTypeInfo exte
}
/**
- * Constructs a feature type info initialized to the specified value.
+ * Constructs a feature type info initialized to the specified name.
*
* @param featureTypeName Name of the feature type.
- * @param featureInstanceCount Number of occurrence of feature instances for this feature types, or {@code null}.
*/
- public DefaultFeatureTypeInfo(final GenericName featureTypeName, final Integer featureInstanceCount) {
- if (featureInstanceCount != null) {
- ArgumentChecks.ensurePositive("featureInstanceCount", featureInstanceCount);
- }
- this.featureTypeName = featureTypeName;
- this.featureInstanceCount = featureInstanceCount;
+ public DefaultFeatureTypeInfo(final GenericName featureTypeName) {
+ this.featureTypeName = featureTypeName;
}
/**
@@ -131,6 +126,8 @@ public class DefaultFeatureTypeInfo exte
* Returns the name of the feature type.
*
* @return Name of the feature type.
+ *
+ * @see org.apache.sis.feature.DefaultFeatureType#getName()
*/
@Override
@XmlElement(name = "featureTypeName", required = true)
@@ -164,8 +161,9 @@ public class DefaultFeatureTypeInfo exte
* Set a new number of occurrence of feature instances for this feature types.
*
* @param newValue the new number of occurrence.
+ * @throws IllegalArgumentException if the given value is negative.
*/
- public void setFeatureInstanceCount(final Integer newValue) {
+ public void setFeatureInstanceCount(final Integer newValue) throws IllegalArgumentException {
checkWritePermission();
if (newValue != null) {
ArgumentChecks.ensurePositive("featureInstanceCount", newValue);
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -197,7 +197,7 @@ public class DefaultImageDescription ext
* @return A value between -90° and +90°, or {@code null} if unspecified.
*/
@Override
- @ValueRange(minimum=0, maximum=180)
+ @ValueRange(minimum = -90, maximum = +90)
@XmlElement(name = "illuminationElevationAngle")
public Double getIlluminationElevationAngle() {
return illuminationElevationAngle;
@@ -222,7 +222,7 @@ public class DefaultImageDescription ext
* @return A value between 0° and 360°, or {@code null} if unspecified.
*/
@Override
- @ValueRange(minimum=0, maximum=360)
+ @ValueRange(minimum = 0, maximum = 360)
@XmlElement(name = "illuminationAzimuthAngle")
public Double getIlluminationAzimuthAngle() {
return illuminationAzimuthAngle;
@@ -240,9 +240,9 @@ public class DefaultImageDescription ext
}
/**
- * Returns the conditions affected the image.
+ * Returns the conditions which affected the image.
*
- * @return Conditions affected the image, or {@code null} if unspecified.
+ * @return Conditions which affected the image, or {@code null} if unspecified.
*/
@Override
@XmlElement(name = "imagingCondition")
@@ -251,7 +251,7 @@ public class DefaultImageDescription ext
}
/**
- * Sets the conditions affected the image.
+ * Sets the conditions that affected the image.
*
* @param newValue The new imaging condition.
*/
@@ -261,7 +261,7 @@ public class DefaultImageDescription ext
}
/**
- * Returns the identifier that specifies the image quality.
+ * Returns a code in producer’s codespace that specifies the image quality.
*
* @return The image quality, or {@code null} if unspecified.
*/
@@ -272,7 +272,7 @@ public class DefaultImageDescription ext
}
/**
- * Sets the identifier that specifies the image quality.
+ * Sets a code in producer’s codespace that specifies the image quality.
*
* @param newValue The new image quality code.
*/
@@ -287,7 +287,7 @@ public class DefaultImageDescription ext
* @return A value between 0 and 100, or {@code null} if unspecified.
*/
@Override
- @ValueRange(minimum=0, maximum=100)
+ @ValueRange(minimum = 0, maximum = 100)
@XmlElement(name = "cloudCoverPercentage")
public Double getCloudCoverPercentage() {
return cloudCoverPercentage;
@@ -334,7 +334,7 @@ public class DefaultImageDescription ext
* or {@code null} if unspecified.
*/
@Override
- @ValueRange(minimum=0)
+ @ValueRange(minimum = 0)
@XmlElement(name = "compressionGenerationQuantity")
public Integer getCompressionGenerationQuantity() {
return compressionGenerationQuantity;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -63,7 +63,7 @@ public class DefaultRangeDimension exten
private static final long serialVersionUID = 4517148689016920767L;
/**
- * Number that uniquely identifies instances of bands of wavelengths on which a sensor operates.
+ * Unique name or number that identifies attributes included in the coverage.
*/
private MemberName sequenceIdentifier;
@@ -134,9 +134,9 @@ public class DefaultRangeDimension exten
}
/**
- * Returns the number that uniquely identifies instances of bands of wavelengths on which a sensor operates.
+ * Returns a unique name or number that identifies attributes included in the coverage.
*
- * @return Identifier of bands on which a sensor operates, or {@code null}.
+ * @return Unique name or number, or {@code null}.
*/
@Override
@XmlElement(name = "sequenceIdentifier")
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -407,7 +407,7 @@ public class DefaultSampleDimension exte
* for the value in each band of each pixel, or {@code null} if none.
*/
@Override
- @ValueRange(minimum=1)
+ @ValueRange(minimum = 1)
/// @XmlElement(name = "bitsPerValues")
public Integer getBitsPerValue() {
return bitsPerValue;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -31,11 +31,14 @@
* </tr><tr><td style="width: 50%; white-space: nowrap">
* {@linkplain org.apache.sis.metadata.iso.ISOMetadata ISO-19115 metadata}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation Content information} «abstract»<br>
+ * {@code │ ├─} Feature catalogue<br>
* {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription Feature catalogue description}<br>
* {@code │ └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultCoverageDescription Coverage description}<br>
* {@code │ └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultImageDescription Image description}<br>
+ * {@code ├─} {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo Feature type info}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeDimension Range dimension}<br>
- * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultBand Band}<br>
+ * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultSampleDimension Sample dimension}<br>
+ * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultBand Band}<br>
* {@code └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeElementDescription Range element description}<br>
* {@linkplain org.opengis.util.CodeList Code list}<br>
* {@code ├─} {@linkplain org.opengis.metadata.content.BandDefinition Band definition}<br>
@@ -44,18 +47,20 @@
* {@code ├─} {@linkplain org.opengis.metadata.content.PolarizationOrientation Polarization orientation}<br>
* {@code └─} {@linkplain org.opengis.metadata.content.TransferFunctionType Transfer function type}<br>
* </td><td class="sep" style="width: 50%; white-space: nowrap">
- * {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation Content information} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription Feature catalogue description}<br>
- * {@linkplain org.apache.sis.metadata.iso.content.DefaultCoverageDescription Coverage description}<br>
- * {@code ├─} {@linkplain org.opengis.metadata.content.CoverageContentType Coverage content type} «code list»<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeDimension Range dimension}<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeElementDescription Range element description}<br>
- * {@linkplain org.apache.sis.metadata.iso.content.DefaultBand Band}<br>
- * {@code ├─} {@linkplain org.opengis.metadata.content.BandDefinition Band definition} «code list»<br>
- * {@code ├─} {@linkplain org.opengis.metadata.content.PolarizationOrientation Polarization orientation} «code list»<br>
- * {@code └─} {@linkplain org.opengis.metadata.content.TransferFunctionType Transfer function type} «code list»<br>
- * {@linkplain org.apache.sis.metadata.iso.content.DefaultImageDescription Image description}<br>
- * {@code └─} {@linkplain org.opengis.metadata.content.ImagingCondition Imaging condition} «code list»<br>
+ * {@linkplain org.apache.sis.metadata.iso.content.AbstractContentInformation Content information} «abstract»<br>
+ * {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription Feature catalogue description}<br>
+ * {@code └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo Feature type info}<br>
+ * {@linkplain org.apache.sis.metadata.iso.content.DefaultCoverageDescription Coverage description}<br>
+ * {@code ├─} {@linkplain org.apache.sis.metadata.iso.content.DefaultAttributeGroup Attribute group}<br>
+ * {@code │ ├─} {@linkplain org.opengis.metadata.content.CoverageContentType Coverage content type} «code list»<br>
+ * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeDimension Range dimension}<br>
+ * {@code └─} {@linkplain org.apache.sis.metadata.iso.content.DefaultRangeElementDescription Range element description}<br>
+ * {@linkplain org.apache.sis.metadata.iso.content.DefaultBand Band}<br>
+ * {@code ├─} {@linkplain org.opengis.metadata.content.BandDefinition Band definition} «code list»<br>
+ * {@code ├─} {@linkplain org.opengis.metadata.content.PolarizationOrientation Polarization orientation} «code list»<br>
+ * {@code └─} {@linkplain org.opengis.metadata.content.TransferFunctionType Transfer function type} «code list»<br>
+ * {@linkplain org.apache.sis.metadata.iso.content.DefaultImageDescription Image description}<br>
+ * {@code └─} {@linkplain org.opengis.metadata.content.ImagingCondition Imaging condition} «code list»<br>
* </td></tr></table>
*
* {@section Bands in gridded data}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -21,11 +21,15 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.util.InternationalString;
+import org.opengis.temporal.PeriodDuration;
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.distribution.DigitalTransferOptions;
+import org.opengis.metadata.distribution.Format;
import org.opengis.metadata.distribution.Medium;
+import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
import org.apache.sis.measure.ValueRange;
import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.util.ArgumentChecks;
/**
@@ -44,7 +48,7 @@ import org.apache.sis.metadata.iso.ISOMe
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @since 0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
* @module
*/
@XmlType(name = "MD_DigitalTransferOptions_Type", propOrder = {
@@ -58,7 +62,7 @@ public class DefaultDigitalTransferOptio
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 3797035083686261676L;
+ private static final long serialVersionUID = -2901375920581273330L;
/**
* Tiles, layers, geographic areas, etc., in which data is available.
@@ -79,7 +83,17 @@ public class DefaultDigitalTransferOptio
/**
* Information about offline media on which the resource can be obtained.
*/
- private Medium offLine;
+ private Collection<Medium> offLines;
+
+ /**
+ * Rate of occurrence of distribution.
+ */
+ private PeriodDuration transferFrequency;
+
+ /**
+ * Formats of distribution.
+ */
+ private Collection<Format> distributionFormats;
/**
* Constructs an initially empty digital transfer options.
@@ -102,7 +116,9 @@ public class DefaultDigitalTransferOptio
unitsOfDistribution = object.getUnitsOfDistribution();
transferSize = object.getTransferSize();
onLines = copyCollection(object.getOnLines(), OnlineResource.class);
- offLine = object.getOffLine();
+ offLines = copyCollection(object.getOffLines(), Medium.class);
+ transferFrequency = object.getTransferFrequency();
+ distributionFormats = copyCollection(object.getDistributionFormats(), Format.class);
}
}
@@ -160,7 +176,7 @@ public class DefaultDigitalTransferOptio
*/
@Override
@XmlElement(name = "transferSize")
- @ValueRange(minimum=0, isMinIncluded=false)
+ @ValueRange(minimum = 0, isMinIncluded = false)
public Double getTransferSize() {
return transferSize;
}
@@ -170,9 +186,13 @@ public class DefaultDigitalTransferOptio
* The transfer shall be greater than zero.
*
* @param newValue The new transfer size.
+ * @throws IllegalArgumentException if the given value is negative.
*/
- public void setTransferSize(final Double newValue) {
+ public void setTransferSize(final Double newValue) throws IllegalArgumentException {
checkWritePermission();
+ if (newValue != null) {
+ ArgumentChecks.ensurePositive("transferSize", newValue);
+ }
transferSize = newValue;
}
@@ -199,21 +219,96 @@ public class DefaultDigitalTransferOptio
/**
* Returns information about offline media on which the resource can be obtained.
*
+ * @return Offline media on which the resource can be obtained.
+ *
+ * @since 0.5
+ */
+ @Override
+ public Collection<Medium> getOffLines() {
+ return offLines = nonNullCollection(offLines, Medium.class);
+ }
+
+ /**
+ * Sets information about offline media on which the resource can be obtained.
+ *
+ * @param newValues The new offline media.
+ *
+ * @since 0.5
+ */
+ public void setOffLines(final Collection<? extends Medium> newValues) {
+ offLines = writeCollection(newValues, offLines, Medium.class);
+ }
+
+ /**
+ * Returns information about offline media on which the resource can be obtained.
+ *
* @return Offline media on which the resource can be obtained, or {@code null}.
+ *
+ * @deprecated As of ISO 19115:2014, replaced by {@link #getOffLines()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "offLine")
- public Medium getOffLine() {
- return offLine;
+ public final Medium getOffLine() {
+ return LegacyPropertyAdapter.getSingleton(offLines, Medium.class, null, DefaultDigitalTransferOptions.class, "getOffLine");
}
/**
* Sets information about offline media on which the resource can be obtained.
*
* @param newValue The new offline media.
+ *
+ * @deprecated As of ISO 19115:2014, replaced by {@link #setOffLines(Collection)}.
*/
+ @Deprecated
public void setOffLine(final Medium newValue) {
+ setOffLines(LegacyPropertyAdapter.asCollection(newValue));
+ }
+
+ /**
+ * Returns the rate of occurrence of distribution.
+ *
+ * @return Rate of occurrence of distribution, or {@code null} if none.
+ *
+ * @since 0.5
+ */
+ @Override
+ public PeriodDuration getTransferFrequency() {
+ return transferFrequency;
+ }
+
+ /**
+ * Sets the rate of occurrence of distribution.
+ *
+ * @param newValue The new rate of occurrence of distribution.
+ *
+ * @since 0.5
+ */
+ public void setTransferFrequency(final PeriodDuration newValue) {
checkWritePermission();
- offLine = newValue;
+ transferFrequency = newValue;
+ }
+
+ /**
+ * Returns the formats of distribution.
+ *
+ * @return Formats of distribution.
+ *
+ * @since 0.5
+ */
+ @Override
+ public Collection<Format> getDistributionFormats() {
+ return distributionFormats = nonNullCollection(distributionFormats, Format.class);
+ }
+
+ /**
+ * Sets the formats of distribution.
+ *
+ * @param newValues The new formats of distribution.
+ *
+ * @since 0.5
+ */
+ public void setDistributionFormats(final Collection<? extends Format> newValues) {
+ distributionFormats = writeCollection(newValues, distributionFormats, Format.class);
}
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -20,6 +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.util.InternationalString;
import org.opengis.metadata.distribution.DigitalTransferOptions;
import org.opengis.metadata.distribution.Distribution;
import org.opengis.metadata.distribution.Distributor;
@@ -43,7 +44,7 @@ import org.apache.sis.metadata.iso.ISOMe
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @since 0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
* @module
*/
@XmlType(name = "MD_Distribution_Type", propOrder = {
@@ -59,6 +60,11 @@ public class DefaultDistribution extends
private static final long serialVersionUID = 1331353255189686369L;
/**
+ * Brief description of a set of distribution options.
+ */
+ private InternationalString description;
+
+ /**
* Provides a description of the format of the data to be distributed.
*/
private Collection<Format> distributionFormats;
@@ -92,6 +98,7 @@ public class DefaultDistribution extends
public DefaultDistribution(final Distribution object) {
super(object);
if (object != null) {
+ description = object.getDescription();
distributionFormats = copyCollection(object.getDistributionFormats(), Format.class);
distributors = copyCollection(object.getDistributors(), Distributor.class);
transferOptions = copyCollection(object.getTransferOptions(), DigitalTransferOptions.class);
@@ -124,6 +131,30 @@ public class DefaultDistribution extends
}
/**
+ * Returns a brief description of a set of distribution options.
+ *
+ * @return Brief description of a set of distribution options.
+ *
+ * @since 0.5
+ */
+ @Override
+ public InternationalString getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets a brief description of a set of distribution options.
+ *
+ * @param newValue The new description.
+ *
+ * @since 0.5
+ */
+ public void setDescription(final InternationalString newValue) {
+ checkWritePermission();
+ description = newValue;
+ }
+
+ /**
* Provides a description of the format of the data to be distributed.
*
* @return Description of the format of the data to be distributed.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -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.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.citation.Responsibility;
import org.opengis.metadata.distribution.Format;
import org.opengis.metadata.distribution.Distributor;
import org.opengis.metadata.distribution.StandardOrderProcess;
@@ -44,7 +44,7 @@ import org.apache.sis.metadata.iso.ISOMe
* @author Touraïvane (IRD)
* @author Cédric Briançon (Geomatys)
* @since 0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.5
* @module
*/
@XmlType(name = "MD_Distributor_Type", propOrder = {
@@ -58,12 +58,12 @@ public class DefaultDistributor extends
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 5706757156163948001L;
+ private static final long serialVersionUID = -8819538342342106743L;
/**
* Party from whom the resource may be obtained. This list need not be exhaustive.
*/
- private ResponsibleParty distributorContact;
+ private Responsibility distributorContact;
/**
* Provides information about how the resource may be obtained, and related
@@ -92,7 +92,7 @@ public class DefaultDistributor extends
*
* @param distributorContact Party from whom the resource may be obtained, or {@code null}.
*/
- public DefaultDistributor(final ResponsibleParty distributorContact) {
+ public DefaultDistributor(final Responsibility distributorContact) {
this.distributorContact = distributorContact;
}
@@ -141,22 +141,22 @@ public class DefaultDistributor extends
}
/**
- * Party from whom the resource may be obtained. This list need not be exhaustive.
+ * Party from whom the resource may be obtained.
*
* @return Party from whom the resource may be obtained, or {@code null}.
*/
@Override
@XmlElement(name = "distributorContact", required = true)
- public ResponsibleParty getDistributorContact() {
+ public Responsibility getDistributorContact() {
return distributorContact;
}
/**
- * Sets the party from whom the resource may be obtained. This list need not be exhaustive.
+ * Sets the party from whom the resource may be obtained.
*
* @param newValue The new distributor contact.
*/
- public void setDistributorContact(final ResponsibleParty newValue) {
+ public void setDistributorContact(final Responsibility newValue) {
checkWritePermission();
distributorContact = newValue;
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -88,7 +88,7 @@
@XmlJavaTypeAdapter(MD_MediumFormatCode.class),
@XmlJavaTypeAdapter(MD_MediumNameCode.class),
@XmlJavaTypeAdapter(CI_OnlineResource.class),
- @XmlJavaTypeAdapter(CI_ResponsibleParty.class),
+ @XmlJavaTypeAdapter(CI_Responsibility.class),
@XmlJavaTypeAdapter(MD_StandardOrderProcess.class),
// Java types, primitive types and basic OGC types handling
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -438,6 +438,7 @@ public class AbstractIdentification exte
/**
* Returns the factor which provides a general understanding of the density of spatial data in the resource(s).
+ * This element should be repeated when describing upper and lower range.
*
* @return Factor which provides a general understanding of the density of spatial data.
*
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -18,6 +18,7 @@ package org.apache.sis.metadata.iso.iden
import java.util.Iterator;
import java.util.ArrayList;
+import java.util.Collection;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -157,9 +158,12 @@ public class DefaultAggregateInformation
*/
static Identifier getAggregateDataSetIdentifier(final Citation name) {
if (name != null) {
- final Iterator<? extends Identifier> it = name.getIdentifiers().iterator();
- if (it.hasNext()) {
- return it.next();
+ final Collection<? extends Identifier> names = name.getIdentifiers();
+ if (names != null) { // May be null on XML marshalling.
+ final Iterator<? extends Identifier> it = names.iterator();
+ if (it.hasNext()) {
+ return it.next();
+ }
}
}
return null;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -62,6 +62,8 @@ import static org.apache.sis.util.collec
* @since 0.3 (derived from geotk-2.4)
* @version 0.4
* @module
+ *
+ * @see DefaultResolution#getEquivalentScale()
*/
@XmlType(name = "MD_RepresentativeFraction_Type")
@XmlRootElement(name = "MD_RepresentativeFraction")
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.opengis.util.InternationalString;
import org.opengis.metadata.identification.RepresentativeFraction;
import org.opengis.metadata.identification.Resolution;
import org.apache.sis.internal.jaxb.gco.GO_Distance;
@@ -27,7 +28,6 @@ import org.apache.sis.internal.metadata.
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.measure.ValueRange;
import org.apache.sis.util.resources.Messages;
-import org.apache.sis.util.Workaround;
/**
@@ -55,6 +55,8 @@ import org.apache.sis.util.Workaround;
* @since 0.3 (derived from geotk-2.1)
* @version 0.3
* @module
+ *
+ * @see AbstractIdentification#getSpatialResolutions()
*/
@XmlType(name = "MD_Resolution_Type") // No need for propOrder since this structure is a union (see javadoc).
@XmlRootElement(name = "MD_Resolution")
@@ -62,12 +64,46 @@ public class DefaultResolution extends I
/**
* Serial number for compatibility with different versions.
*/
- private static final long serialVersionUID = 3856547985745400172L;
+ private static final long serialVersionUID = 4333582736458380544L;
+
+ /**
+ * Enumeration of possible values for {@link #property}.
+ */
+ private static final byte SCALE=1, DISTANCE=2, VERTICAL=3, ANGULAR=4, TEXT=5;
/**
- * Either the scale as a {@link RepresentativeFraction} instance or the distance as a {@code Double} instance.
+ * The names of the mutually exclusive properties.
+ * The index of each name shall be the value of the above {@code byte} constants minus one.
*/
- private Object scaleOrDistance;
+ private static final String[] NAMES = {
+ "equivalentScale",
+ "distance",
+ "vertical",
+ "angularDistance",
+ "levelOfDetail"
+ };
+
+ /**
+ * The names of the setter methods, for logging purpose only.
+ */
+ private static final String[] SETTERS = {
+ "setEquivalentScale",
+ "setDistance",
+ "setVertical",
+ "setAngularDistance",
+ "setLevelOfDetail"
+ };
+
+ /**
+ * Specifies which property is set, or 0 if none.
+ */
+ private byte property;
+
+ /**
+ * Either the scale as a {@link RepresentativeFraction} instance, the distance, the angle,
+ * or the level of details as an {@link InternationalString} instance.
+ */
+ private Object value;
/**
* Constructs an initially empty resolution.
@@ -83,7 +119,7 @@ public class DefaultResolution extends I
* @since 0.4
*/
public DefaultResolution(final RepresentativeFraction scale) {
- scaleOrDistance = scale;
+ value = scale;
}
// Note: there is not yet DefaultResolution(double) method because
@@ -94,8 +130,10 @@ public class DefaultResolution extends I
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * <p>If both {@linkplain #getEquivalentScale() scale} and {@linkplain #getDistance() distance}
- * are specified, then the scale will have precedence and the distance is silently discarded.</p>
+ * <p>If more than one of the {@linkplain #getEquivalentScale() equivalent scale},
+ * {@linkplain #getDistance() distance}, {@linkplain #getVertical() vertical},
+ * {@linkplain #getAngularDistance() angular distance} and {@linkplain #getLevelOfDetail() level of detail}
+ * are specified, then the first of those values is taken and the other values are silently discarded.</p>
*
* @param object The metadata to copy values from, or {@code null} if none.
*
@@ -104,9 +142,21 @@ public class DefaultResolution extends I
public DefaultResolution(final Resolution object) {
super(object);
if (object != null) {
- scaleOrDistance = object.getEquivalentScale();
- if (scaleOrDistance == null) {
- scaleOrDistance = object.getDistance();
+ for (byte p=SCALE; p<=TEXT; p++) {
+ final Object c;
+ switch (p) {
+ case SCALE: c = object.getEquivalentScale(); break;
+ case DISTANCE: c = object.getDistance(); break;
+ case VERTICAL: c = object.getVertical(); break;
+ case ANGULAR: c = object.getAngularDistance(); break;
+ case TEXT: c = object.getLevelOfDetail(); break;
+ default: throw new AssertionError(p);
+ }
+ if (c != null) {
+ property = p;
+ value = c;
+ break;
+ }
}
}
}
@@ -137,33 +187,34 @@ public class DefaultResolution extends I
}
/**
- * Invoked every time the code needs to decide whether the provided information
- * is scale or distance. Defined as a method in order to have a single word to
- * search if we need to revisit the policy.
- */
- private boolean isDistance() {
- return (scaleOrDistance instanceof Double);
- }
-
- /**
- * Invoked when setting a property discards the other one.
+ * Sets the properties identified by the {@code code} argument, if non-null.
+ * This discards any other properties.
+ *
+ * @param code The property which is going to be set.
+ * @param newValue The new value.
*/
- private static void warning(final String method, final String oldName, final String newName) {
- MetadataUtilities.warning(DefaultResolution.class, method,
- Messages.Keys.DiscardedExclusiveProperty_2, oldName, newName);
+ private void setProperty(final byte code, final Object newValue) {
+ checkWritePermission();
+ if (value != null && property != code) {
+ if (newValue == null) {
+ return; // Do not erase the other property.
+ }
+ MetadataUtilities.warning(DefaultResolution.class, SETTERS[code-1],
+ Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
+ }
+ value = newValue;
+ property = code;
}
/**
* Returns the level of detail expressed as the scale of a comparable hardcopy map or chart.
- * Only one of {@linkplain #getEquivalentScale() equivalent scale} and
- * {@linkplain #getDistance() ground sample distance} shall be provided.
*
* @return Level of detail expressed as the scale of a comparable hardcopy, or {@code null}.
*/
@Override
@XmlElement(name = "equivalentScale")
public RepresentativeFraction getEquivalentScale() {
- return isDistance() ? null : (RepresentativeFraction) scaleOrDistance;
+ return (property == SCALE) ? (RepresentativeFraction) value : null;
}
/**
@@ -171,74 +222,120 @@ public class DefaultResolution extends I
*
* {@section Effect on other properties}
* If and only if the {@code newValue} is non-null, then this method automatically
- * discards the {@linkplain #setDistance distance}.
+ * discards all other properties.
*
* @param newValue The new equivalent scale.
*/
public void setEquivalentScale(final RepresentativeFraction newValue) {
- checkWritePermission();
- if (isDistance()) {
- if (newValue == null) {
- return; // Do not erase the other property.
- }
- warning("setEquivalentScale", "distance", "equivalentScale");
- }
- scaleOrDistance = newValue;
+ setProperty(SCALE, newValue);
}
/**
* Returns the ground sample distance.
- * Only one of {@linkplain #getEquivalentScale equivalent scale} and
- * {@linkplain #getDistance ground sample distance} shall be provided.
*
* @return The ground sample distance, or {@code null}.
*/
@Override
+ @XmlElement(name = "distance")
+ @XmlJavaTypeAdapter(GO_Distance.class)
@ValueRange(minimum=0, isMinIncluded=false)
public Double getDistance() {
- return isDistance() ? (Double) scaleOrDistance : null;
+ return (property == DISTANCE) ? (Double) value : null;
}
/**
* Sets the ground sample distance.
*
+ * {@section Effect on other properties}
+ * If and only if the {@code newValue} is non-null, then this method automatically
+ * discards all other properties.
+ *
* @param newValue The new distance.
*/
public void setDistance(final Double newValue) {
- checkWritePermission();
- if (scaleOrDistance != null && !isDistance()) {
- if (newValue == null) {
- return; // Do not erase the other property.
- }
- warning("setDistance", "equivalentScale", "distance");
- }
- scaleOrDistance = newValue;
+ setProperty(DISTANCE, newValue);
}
/**
- * Workaround for a strange JAXB behavior (bug?). For an unknown reason, we are unable to annotate the
- * {@link #getDistance()} method directly. Doing so cause JAXB to randomly ignores the {@code <gmd:distance>}
- * property. Annotating a separated method which in turn invokes the real method seems to work.
+ * Returns the vertical sampling distance.
*
- * <p>In order to check if this workaround is still needed with more recent JAXB versions, move the
- * {@link XmlElement} and {@link XmlJavaTypeAdapter} annotations to the {@link #getDistance()} method,
- * then execute the {@link DefaultResolutionTest#testXML()} test at least 10 times (because the failure
- * happen randomly). If the test succeeded every time, then the {@code getValue()} and {@code setValue(Double)}
- * methods can be completely deleted.</p>
+ * @return The vertical sampling distance, or {@code null}.
*
- * @see DefaultResolutionTest#testXML()
+ * @since 0.5
*/
- @XmlElement(name = "distance")
- @XmlJavaTypeAdapter(GO_Distance.class)
- @Workaround(library = "JAXB", version = "2.2.4-2")
- private Double getValue() {
- return getDistance();
+ @Override
+ @ValueRange(minimum=0, isMinIncluded=false)
+ public Double getVertical() {
+ return (property == VERTICAL) ? (Double) value : null;
}
/**
- * The corresponding setter for the {@link #getValue()} workaround.
+ * Sets the vertical sampling distance.
+ *
+ * {@section Effect on other properties}
+ * If and only if the {@code newValue} is non-null, then this method automatically
+ * discards all other properties.
+ *
+ * @param newValue The new distance.
+ *
+ * @since 0.5
+ */
+ public void setVertical(final Double newValue) {
+ setProperty(VERTICAL, newValue);
+ }
+
+ /**
+ * Returns the angular sampling measure.
+ *
+ * @return The angular sampling measure, or {@code null}.
+ *
+ * @since 0.5
+ */
+ @Override
+ @ValueRange(minimum=0, isMinIncluded=false)
+ public Double getAngularDistance() {
+ return (property == ANGULAR) ? (Double) value : null;
+ }
+
+ /**
+ * Sets the angular sampling measure.
+ *
+ * {@section Effect on other properties}
+ * If and only if the {@code newValue} is non-null, then this method automatically
+ * discards all other properties.
+ *
+ * @param newValue The new distance.
+ *
+ * @since 0.5
+ */
+ public void setAngularDistance(final Double newValue) {
+ setProperty(ANGULAR, newValue);
+ }
+
+ /**
+ * Returns a brief textual description of the spatial resolution of the resource.
+ *
+ * @return Textual description of the spatial resolution, or {@code null}.
+ *
+ * @since 0.5
+ */
+ @Override
+ public InternationalString getLevelOfDetail() {
+ return (property == TEXT) ? (InternationalString) value : null;
+ }
+
+ /**
+ * Sets the textual description of the spatial resolution of the resource.
+ *
+ * {@section Effect on other properties}
+ * If and only if the {@code newValue} is non-null, then this method automatically
+ * discards all other properties.
+ *
+ * @param newValue The new distance.
+ *
+ * @since 0.5
*/
- private void setValue(final Double newValue) {
- setDistance(newValue);
+ public void setLevelOfDetail(final InternationalString newValue) {
+ setProperty(TEXT, newValue);
}
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java?rev=1616545&r1=1616544&r2=1616545&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] Thu Aug 7 17:09:59 2014
@@ -36,8 +36,8 @@ import org.apache.sis.metadata.iso.quali
* the scope or lack of knowledge about lineage.
*
* {@section Relationship between properties}
- * Only one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps() process steps}
- * and {@link #getSources() sources} should be provided.
+ * At least one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps() process steps}
+ * and {@link #getSources() sources} shall be provided.
*
* {@section Limitations}
* <ul>
@@ -80,7 +80,7 @@ public class DefaultLineage extends ISOM
/**
* Type of resource and / or extent to which the lineage information applies.
*/
- private Collection<Scope> scopes;
+ private Scope scope;
/**
* A resources (for example publication) that describes the whole
@@ -117,7 +117,7 @@ public class DefaultLineage extends ISOM
super(object);
if (object != null) {
statement = object.getStatement();
- scopes = copyCollection(object.getScopes(), Scope.class);
+ scope = object.getScope();
additionalDocumentation = copyCollection(object.getAdditionalDocumentation(), Citation.class);
processSteps = copyCollection(object.getProcessSteps(), ProcessStep.class);
sources = copyCollection(object.getSources(), Source.class);
@@ -173,34 +173,34 @@ public class DefaultLineage extends ISOM
}
/**
- * Returns the types of resource and / or extents to which the lineage information applies.
+ * Returns the type of resource and / or extents to which the lineage information applies.
*
- * @return Types of resource and / or extents to which the lineage information applies.
+ * @return Type of resource and / or extents to which the lineage information applies.
*
* @since 0.5
*/
@Override
/// @XmlElement(name = "scope")
- public Collection<Scope> getScopes() {
- return scopes = nonNullCollection(scopes, Scope.class);
+ public Scope getScope() {
+ return scope;
}
/**
- * Sets the types of resource and / or extents to which the lineage information applies.
+ * Sets the type of resource and / or extents to which the lineage information applies.
*
- * @param newValues The new types of resource.
+ * @param newValue The new type of resource.
*
* @since 0.5
*/
- public void setScopes(final Collection<? extends Scope> newValues) {
- scopes = writeCollection(newValues, scopes, Scope.class);
+ public void setScope(final Scope newValue) {
+ checkWritePermission();
+ scope = newValue;
}
/**
- * Returns information about resources (for example publication) that describes the whole
- * process to generate this resource (for example a dataset).
+ * Returns additional documentation.
*
- * @return Resources that describes the whole process to generate this resource.
+ * @return Additional documentation.
*
* @since 0.5
*/
@@ -211,20 +211,20 @@ public class DefaultLineage extends ISOM
}
/**
- * Sets information about resources that describes the whole process to generate this resource.
+ * Sets additional documentation.
*
- * @param newValues The new information about resource.
+ * @param newValues Additional documentation.
*
* @since 0.5
*/
public void setAdditionalDocumentation(final Collection<? extends Citation> newValues) {
- additionalDocumentation = writeCollection(newValues, additionalDocumentation , Citation.class);
+ additionalDocumentation = writeCollection(newValues, additionalDocumentation, Citation.class);
}
/**
- * Returns the information about an event in the creation process for the data specified by the scope.
+ * Returns the information about about events in the life of a resource specified by the scope.
*
- * @return Information about an event in the creation process.
+ * @return Information about events in the life of a resource.
*/
@Override
@XmlElement(name = "processStep")
@@ -233,7 +233,7 @@ public class DefaultLineage extends ISOM
}
/**
- * Sets information about an event in the creation process for the data specified by the scope.
+ * Sets information about events in the life of a resource specified by the scope.
*
* @param newValues The new process steps.
*/