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 2013/07/04 19:36:21 UTC
svn commit: r1499819 [2/3] - in /sis/branches/JDK6: ./
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisitio...
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -88,16 +88,18 @@ public class DefaultCoverageDescription
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(CoverageDescription)
*/
public DefaultCoverageDescription(final CoverageDescription object) {
super(object);
- attributeDescription = object.getAttributeDescription();
- contentType = object.getContentType();
- dimensions = copyCollection(object.getDimensions(), RangeDimension.class);
- rangeElementDescriptions = copyCollection(object.getRangeElementDescriptions(), RangeElementDescription.class);
+ if (object != null) {
+ attributeDescription = object.getAttributeDescription();
+ contentType = object.getContentType();
+ dimensions = copyCollection(object.getDimensions(), RangeDimension.class);
+ rangeElementDescriptions = copyCollection(object.getRangeElementDescriptions(), RangeElementDescription.class);
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -106,17 +106,19 @@ public class DefaultFeatureCatalogueDesc
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(FeatureCatalogueDescription)
*/
public DefaultFeatureCatalogueDescription(final FeatureCatalogueDescription object) {
super(object);
- booleans = object.isIncludedWithDataset() ? INCLUDED_MASK : 0;
- booleans = (byte) setBoolean(booleans, COMPLIANT_MASK, object.isCompliant());
- languages = copyCollection(object.getLanguages(), Locale.class);
- featureTypes = copyCollection(object.getFeatureTypes(), GenericName.class);
- featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class);
+ if (object != null) {
+ booleans = object.isIncludedWithDataset() ? INCLUDED_MASK : 0;
+ booleans = (byte) setBoolean(booleans, COMPLIANT_MASK, object.isCompliant());
+ languages = copyCollection(object.getLanguages(), Locale.class);
+ featureTypes = copyCollection(object.getFeatureTypes(), GenericName.class);
+ featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class);
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -162,27 +162,29 @@ public class DefaultImageDescription ext
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(ImageDescription)
*/
public DefaultImageDescription(final ImageDescription object) {
super(object);
- illuminationElevationAngle = object.getIlluminationElevationAngle();
- illuminationAzimuthAngle = object.getIlluminationAzimuthAngle();
- imagingCondition = object.getImagingCondition();
- imageQualityCode = object.getImageQualityCode();
- cloudCoverPercentage = object.getCloudCoverPercentage();
- processingLevelCode = object.getProcessingLevelCode();
- compressionGenerationQuantity = object.getCompressionGenerationQuantity();
-
- int flags;
- flags = setBoolean(0, TRIANGULATION_MASK, object.getTriangulationIndicator());
- flags = setBoolean(flags, RADIOMETRIC_MASK, object.isRadiometricCalibrationDataAvailable());
- flags = setBoolean(flags, CAMERA_MASK, object.isCameraCalibrationInformationAvailable());
- flags = setBoolean(flags, FILM_MASK, object.isFilmDistortionInformationAvailable());
- flags = setBoolean(flags, LENS_MASK, object.isLensDistortionInformationAvailable());
- booleans = (short) flags;
+ if (object != null) {
+ illuminationElevationAngle = object.getIlluminationElevationAngle();
+ illuminationAzimuthAngle = object.getIlluminationAzimuthAngle();
+ imagingCondition = object.getImagingCondition();
+ imageQualityCode = object.getImageQualityCode();
+ cloudCoverPercentage = object.getCloudCoverPercentage();
+ processingLevelCode = object.getProcessingLevelCode();
+ compressionGenerationQuantity = object.getCompressionGenerationQuantity();
+
+ int flags;
+ flags = setBoolean(0, TRIANGULATION_MASK, object.getTriangulationIndicator());
+ flags = setBoolean(flags, RADIOMETRIC_MASK, object.isRadiometricCalibrationDataAvailable());
+ flags = setBoolean(flags, CAMERA_MASK, object.isCameraCalibrationInformationAvailable());
+ flags = setBoolean(flags, FILM_MASK, object.isFilmDistortionInformationAvailable());
+ flags = setBoolean(flags, LENS_MASK, object.isLensDistortionInformationAvailable());
+ booleans = (short) flags;
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -70,14 +70,16 @@ public class DefaultRangeDimension exten
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(RangeDimension)
*/
public DefaultRangeDimension(final RangeDimension object) {
super(object);
- sequenceIdentifier = object.getSequenceIdentifier();
- descriptor = object.getDescriptor();
+ if (object != null) {
+ sequenceIdentifier = object.getSequenceIdentifier();
+ descriptor = object.getDescriptor();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -74,15 +74,17 @@ public class DefaultRangeElementDescript
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(RangeElementDescription)
*/
public DefaultRangeElementDescription(final RangeElementDescription object) {
super(object);
- name = object.getName();
- definition = object.getDefinition();
- rangeElements = copyCollection(object.getRangeElements(), Record.class);
+ if (object != null) {
+ name = object.getName();
+ definition = object.getDefinition();
+ rangeElements = copyCollection(object.getRangeElements(), Record.class);
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -111,10 +111,9 @@
@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_Decimal.class), @XmlJavaTypeAdapter(type=double.class, value=GO_Decimal.class),
- @XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class, value=GO_Integer.class),
- @XmlJavaTypeAdapter(GO_Integer.AsLong.class), @XmlJavaTypeAdapter(type=long.class, value=GO_Integer.AsLong.class)
+ @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class),
+ @XmlJavaTypeAdapter(GO_Decimal.class), @XmlJavaTypeAdapter(type=double.class, value=GO_Decimal.class),
+ @XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class, value=GO_Integer.class)
})
package org.apache.sis.metadata.iso.content;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -71,14 +71,16 @@ public class DefaultDataFile extends ISO
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(DataFile)
*/
public DefaultDataFile(final DataFile object) {
super(object);
- featureTypes = copyCollection(object.getFeatureTypes(), LocalName.class);
- fileFormat = object.getFileFormat();
+ if (object != null) {
+ featureTypes = copyCollection(object.getFeatureTypes(), LocalName.class);
+ fileFormat = object.getFileFormat();
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -85,16 +85,18 @@ public class DefaultDigitalTransferOptio
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(DigitalTransferOptions)
*/
public DefaultDigitalTransferOptions(final DigitalTransferOptions object) {
super(object);
- unitsOfDistribution = object.getUnitsOfDistribution();
- transferSize = object.getTransferSize();
- onLines = copyCollection(object.getOnLines(), OnlineResource.class);
- offLine = object.getOffLine();
+ if (object != null) {
+ unitsOfDistribution = object.getUnitsOfDistribution();
+ transferSize = object.getTransferSize();
+ onLines = copyCollection(object.getOnLines(), OnlineResource.class);
+ offLine = object.getOffLine();
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -76,15 +76,17 @@ public class DefaultDistribution extends
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Distribution)
*/
public DefaultDistribution(final Distribution object) {
super(object);
- distributionFormats = copyCollection(object.getDistributionFormats(), Format.class);
- distributors = copyCollection(object.getDistributors(), Distributor.class);
- transferOptions = copyCollection(object.getTransferOptions(), DigitalTransferOptions.class);
+ if (object != null) {
+ distributionFormats = copyCollection(object.getDistributionFormats(), Format.class);
+ distributors = copyCollection(object.getDistributors(), Distributor.class);
+ transferOptions = copyCollection(object.getTransferOptions(), DigitalTransferOptions.class);
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -92,16 +92,18 @@ public class DefaultDistributor extends
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Distributor)
*/
public DefaultDistributor(final Distributor object) {
super(object);
- distributorContact = object.getDistributorContact();
- distributionOrderProcesses = copyCollection(object.getDistributionOrderProcesses(), StandardOrderProcess.class);
- distributorFormats = copyCollection(object.getDistributorFormats(), Format.class);
- distributorTransferOptions = copyCollection(object.getDistributorTransferOptions(), DigitalTransferOptions.class);
+ if (object != null) {
+ distributorContact = object.getDistributorContact();
+ distributionOrderProcesses = copyCollection(object.getDistributionOrderProcesses(), StandardOrderProcess.class);
+ distributorFormats = copyCollection(object.getDistributorFormats(), Format.class);
+ distributorTransferOptions = copyCollection(object.getDistributorTransferOptions(), DigitalTransferOptions.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -106,18 +106,20 @@ public class DefaultFormat extends ISOMe
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Format)
*/
public DefaultFormat(final Format object) {
super(object);
- name = object.getName();
- version = object.getVersion();
- amendmentNumber = object.getAmendmentNumber();
- specification = object.getSpecification();
- fileDecompressionTechnique = object.getFileDecompressionTechnique();
- formatDistributors = copyCollection(object.getFormatDistributors(), Distributor.class);
+ if (object != null) {
+ name = object.getName();
+ version = object.getVersion();
+ amendmentNumber = object.getAmendmentNumber();
+ specification = object.getSpecification();
+ fileDecompressionTechnique = object.getFileDecompressionTechnique();
+ formatDistributors = copyCollection(object.getFormatDistributors(), Distributor.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -96,18 +96,20 @@ public class DefaultMedium extends ISOMe
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Medium)
*/
public DefaultMedium(final Medium object) {
super(object);
- name = object.getName();
- densities = copyCollection(object.getDensities(), Double.class);
- densityUnits = object.getDensityUnits();
- volumes = object.getVolumes();
- mediumFormats = copyCollection(object.getMediumFormats(), MediumFormat.class);
- mediumNote = object.getMediumNote();
+ if (object != null) {
+ name = object.getName();
+ densities = copyCollection(object.getDensities(), Double.class);
+ densityUnits = object.getDensityUnits();
+ volumes = object.getVolumes();
+ mediumFormats = copyCollection(object.getMediumFormats(), MediumFormat.class);
+ mediumNote = object.getMediumNote();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -62,7 +62,7 @@ public class DefaultStandardOrderProcess
* Date and time when the dataset will be available,
* in milliseconds elapsed since January 1st, 1970.
*/
- private long plannedAvailableDateTime;
+ private long plannedAvailableDateTime = Long.MIN_VALUE;
/**
* General instructions, terms and services provided by the distributor.
@@ -78,7 +78,6 @@ public class DefaultStandardOrderProcess
* Constructs an initially empty standard order process.
*/
public DefaultStandardOrderProcess() {
- plannedAvailableDateTime = Long.MIN_VALUE;
}
/**
@@ -86,16 +85,18 @@ public class DefaultStandardOrderProcess
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(StandardOrderProcess)
*/
public DefaultStandardOrderProcess(final StandardOrderProcess object) {
super(object);
- fees = object.getFees();
- plannedAvailableDateTime = toMilliseconds(object.getPlannedAvailableDateTime());
- orderingInstructions = object.getOrderingInstructions();
- turnaround = object.getTurnaround();
+ if (object != null) {
+ fees = object.getFees();
+ plannedAvailableDateTime = toMilliseconds(object.getPlannedAvailableDateTime());
+ orderingInstructions = object.getOrderingInstructions();
+ turnaround = object.getTurnaround();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -88,13 +88,15 @@ public class AbstractGeographicExtent ex
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(GeographicExtent)
*/
public AbstractGeographicExtent(final GeographicExtent object) {
super(object);
- booleans = (byte) setBoolean(0, INCLUSION_MASK, object.getInclusion());
+ if (object != null) {
+ booleans = (byte) setBoolean(0, INCLUSION_MASK, object.getInclusion());
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -70,13 +70,15 @@ public class DefaultBoundingPolygon exte
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(BoundingPolygon)
*/
public DefaultBoundingPolygon(final BoundingPolygon object) {
super(object);
- polygons = copyCollection(object.getPolygons(), Geometry.class);
+ if (object != null) {
+ polygons = copyCollection(object.getPolygons(), Geometry.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -112,16 +112,18 @@ public class DefaultExtent extends ISOMe
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Extent)
*/
public DefaultExtent(final Extent object) {
super(object);
- description = object.getDescription();
- geographicElements = copyCollection(object.getGeographicElements(), GeographicExtent.class);
- temporalElements = copyCollection(object.getTemporalElements(), TemporalExtent.class);
- verticalElements = copyCollection(object.getVerticalElements(), VerticalExtent.class);
+ if (object != null) {
+ description = object.getDescription();
+ geographicElements = copyCollection(object.getGeographicElements(), GeographicExtent.class);
+ temporalElements = copyCollection(object.getTemporalElements(), TemporalExtent.class);
+ verticalElements = copyCollection(object.getVerticalElements(), VerticalExtent.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -168,16 +168,18 @@ public class DefaultGeographicBoundingBo
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(GeographicBoundingBox)
*/
public DefaultGeographicBoundingBox(final GeographicBoundingBox object) {
super(object);
- westBoundLongitude = object.getWestBoundLongitude();
- eastBoundLongitude = object.getEastBoundLongitude();
- southBoundLatitude = object.getSouthBoundLatitude();
- northBoundLatitude = object.getNorthBoundLatitude();
+ if (object != null) {
+ westBoundLongitude = object.getWestBoundLongitude();
+ eastBoundLongitude = object.getEastBoundLongitude();
+ southBoundLatitude = object.getSouthBoundLatitude();
+ northBoundLatitude = object.getNorthBoundLatitude();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -75,13 +75,15 @@ public class DefaultGeographicDescriptio
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(GeographicDescription)
*/
public DefaultGeographicDescription(final GeographicDescription object) {
super(object);
- geographicIdentifier = object.getGeographicIdentifier();
+ if (object != null) {
+ geographicIdentifier = object.getGeographicIdentifier();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -63,13 +63,15 @@ public class DefaultSpatialTemporalExten
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(SpatialTemporalExtent)
*/
public DefaultSpatialTemporalExtent(final SpatialTemporalExtent object) {
super(object);
- spatialExtent = copyCollection(object.getSpatialExtent(), GeographicExtent.class);
+ if (object != null) {
+ spatialExtent = copyCollection(object.getSpatialExtent(), GeographicExtent.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -76,13 +76,15 @@ public class DefaultTemporalExtent exten
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(TemporalExtent)
*/
public DefaultTemporalExtent(final TemporalExtent object) {
super(object);
- extent = object.getExtent();
+ if (object != null) {
+ extent = object.getExtent();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -98,15 +98,17 @@ public class DefaultVerticalExtent exten
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(VerticalExtent)
*/
public DefaultVerticalExtent(final VerticalExtent object) {
super(object);
- minimumValue = object.getMinimumValue();
- maximumValue = object.getMaximumValue();
- verticalCRS = object.getVerticalCRS();
+ if (object != null) {
+ minimumValue = object.getMinimumValue();
+ maximumValue = object.getMaximumValue();
+ verticalCRS = object.getVerticalCRS();
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -154,25 +154,27 @@ public class AbstractIdentification exte
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Identification)
*/
public AbstractIdentification(final Identification object) {
super(object);
- citation = object.getCitation();
- abstracts = object.getAbstract();
- purpose = object.getPurpose();
- credits = copyCollection(object.getCredits(), String.class);
- status = copyCollection(object.getStatus(), Progress.class);
- pointOfContacts = copyCollection(object.getPointOfContacts(), ResponsibleParty.class);
- resourceMaintenances = copyCollection(object.getResourceMaintenances(), MaintenanceInformation.class);
- graphicOverviews = copyCollection(object.getGraphicOverviews(), BrowseGraphic.class);
- resourceFormats = copyCollection(object.getResourceFormats(), Format.class);
- descriptiveKeywords = copyCollection(object.getDescriptiveKeywords(), Keywords.class);
- resourceSpecificUsages = copyCollection(object.getResourceSpecificUsages(), Usage.class);
- resourceConstraints = copyCollection(object.getResourceConstraints(), Constraints.class);
- aggregationInfo = copyCollection(object.getAggregationInfo(), AggregateInformation.class);
+ if (object != null) {
+ citation = object.getCitation();
+ abstracts = object.getAbstract();
+ purpose = object.getPurpose();
+ credits = copyCollection(object.getCredits(), String.class);
+ status = copyCollection(object.getStatus(), Progress.class);
+ pointOfContacts = copyCollection(object.getPointOfContacts(), ResponsibleParty.class);
+ resourceMaintenances = copyCollection(object.getResourceMaintenances(), MaintenanceInformation.class);
+ graphicOverviews = copyCollection(object.getGraphicOverviews(), BrowseGraphic.class);
+ resourceFormats = copyCollection(object.getResourceFormats(), Format.class);
+ descriptiveKeywords = copyCollection(object.getDescriptiveKeywords(), Keywords.class);
+ resourceSpecificUsages = copyCollection(object.getResourceSpecificUsages(), Usage.class);
+ resourceConstraints = copyCollection(object.getResourceConstraints(), Constraints.class);
+ aggregationInfo = copyCollection(object.getAggregationInfo(), AggregateInformation.class);
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -85,16 +85,18 @@ public class DefaultAggregateInformation
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(AggregateInformation)
*/
public DefaultAggregateInformation(final AggregateInformation object) {
super(object);
- aggregateDataSetName = object.getAggregateDataSetName();
- aggregateDataSetIdentifier = object.getAggregateDataSetIdentifier();
- associationType = object.getAssociationType();
- initiativeType = object.getInitiativeType();
+ if (object != null) {
+ aggregateDataSetName = object.getAggregateDataSetName();
+ aggregateDataSetIdentifier = object.getAggregateDataSetIdentifier();
+ associationType = object.getAssociationType();
+ initiativeType = object.getInitiativeType();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -83,15 +83,17 @@ public class DefaultBrowseGraphic extend
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(BrowseGraphic)
*/
public DefaultBrowseGraphic(final BrowseGraphic object) {
super(object);
- fileName = object.getFileName();
- fileDescription = object.getFileDescription();
- fileType = object.getFileType();
+ if (object != null) {
+ fileName = object.getFileName();
+ fileDescription = object.getFileDescription();
+ fileType = object.getFileType();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -129,20 +129,22 @@ public class DefaultDataIdentification e
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(DataIdentification)
*/
public DefaultDataIdentification(final DataIdentification object) {
super(object);
- spatialRepresentationTypes = copyCollection(object.getSpatialRepresentationTypes(), SpatialRepresentationType.class);
- spatialResolutions = copyCollection(object.getSpatialResolutions(), Resolution.class);
- languages = copyCollection(object.getLanguages(), Locale.class);
- characterSets = copyCollection(object.getCharacterSets(), CharacterSet.class);
- topicCategories = copyCollection(object.getTopicCategories(), TopicCategory.class);
- environmentDescription = object.getEnvironmentDescription();
- extents = copyCollection(object.getExtents(), Extent.class);
- supplementalInformation = object.getSupplementalInformation();
+ if (object != null) {
+ spatialRepresentationTypes = copyCollection(object.getSpatialRepresentationTypes(), SpatialRepresentationType.class);
+ spatialResolutions = copyCollection(object.getSpatialResolutions(), Resolution.class);
+ languages = copyCollection(object.getLanguages(), Locale.class);
+ characterSets = copyCollection(object.getCharacterSets(), CharacterSet.class);
+ topicCategories = copyCollection(object.getTopicCategories(), TopicCategory.class);
+ environmentDescription = object.getEnvironmentDescription();
+ extents = copyCollection(object.getExtents(), Extent.class);
+ supplementalInformation = object.getSupplementalInformation();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -96,15 +96,17 @@ public class DefaultKeywords extends ISO
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Keywords)
*/
public DefaultKeywords(final Keywords object) {
super(object);
- keywords = copyCollection(object.getKeywords(), InternationalString.class);
- type = object.getType();
- thesaurusName = object.getThesaurusName();
+ if (object != null) {
+ keywords = copyCollection(object.getKeywords(), InternationalString.class);
+ type = object.getType();
+ thesaurusName = object.getThesaurusName();
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -19,7 +19,9 @@ package org.apache.sis.metadata.iso.iden
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.metadata.identification.RepresentativeFraction;
+import org.apache.sis.internal.jaxb.gco.GO_Integer;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.resources.Errors;
@@ -74,13 +76,14 @@ public class DefaultRepresentativeFracti
/**
* Constructs a new representative fraction initialized to the value of the given object.
*
- * @param object The representative fraction to copy.
+ * @param object The metadata to copy values from, or {@code null} if none.
* @throws IllegalArgumentException If the denominator of the given source is negative.
*/
public DefaultRepresentativeFraction(final RepresentativeFraction object) throws IllegalArgumentException {
- ArgumentChecks.ensureNonNull("object", object);
- denominator = object.getDenominator();
- ArgumentChecks.ensurePositive("object", denominator);
+ if (object != null) {
+ denominator = object.getDenominator();
+ ArgumentChecks.ensurePositive("object", denominator);
+ }
}
/**
@@ -104,6 +107,7 @@ public class DefaultRepresentativeFracti
* Returns the denominator of this representative fraction.
*/
@Override
+ @XmlJavaTypeAdapter(value = GO_Integer.AsLong.class, type = long.class)
@XmlElement(name = "denominator", required = true)
public long getDenominator() {
return denominator;
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -27,6 +27,7 @@ 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;
/**
@@ -74,15 +75,17 @@ public class DefaultResolution extends I
* <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>
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Resolution)
*/
public DefaultResolution(final Resolution object) {
super(object);
- scaleOrDistance = object.getEquivalentScale();
- if (scaleOrDistance == null) {
- scaleOrDistance = object.getDistance();
+ if (object != null) {
+ scaleOrDistance = object.getEquivalentScale();
+ if (scaleOrDistance == null) {
+ scaleOrDistance = object.getDistance();
+ }
}
}
@@ -166,8 +169,6 @@ public class DefaultResolution extends I
*/
@Override
@ValueRange(minimum=0, isMinIncluded=false)
- @XmlJavaTypeAdapter(GO_Distance.class)
- @XmlElement(name = "distance")
public Double getDistance() {
return isDistance() ? (Double) scaleOrDistance : null;
}
@@ -187,4 +188,31 @@ public class DefaultResolution extends I
}
scaleOrDistance = 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.
+ *
+ * <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>
+ *
+ * @see DefaultResolutionTest#testXML()
+ */
+ @XmlElement(name = "distance")
+ @XmlJavaTypeAdapter(GO_Distance.class)
+ @Workaround(library = "JAXB", version = "2.2.4-2")
+ private Double getValue() {
+ return getDistance();
+ }
+
+ /**
+ * The corresponding setter for the {@link #getValue()} workaround.
+ */
+ private void setValue(final Double newValue) {
+ setDistance(newValue);
+ }
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -52,7 +52,7 @@ public class DefaultServiceIdentificatio
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(ServiceIdentification)
*/
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -64,7 +64,7 @@ public class DefaultUsage extends ISOMet
* Values are milliseconds elapsed since January 1st, 1970,
* or {@link Long#MIN_VALUE} if this value is not set.
*/
- private long usageDate;
+ private long usageDate = Long.MIN_VALUE;
/**
* Applications, determined by the user for which the resource and/or resource series
@@ -82,7 +82,6 @@ public class DefaultUsage extends ISOMet
* Constructs an initially empty usage.
*/
public DefaultUsage() {
- usageDate = Long.MIN_VALUE;
}
/**
@@ -94,7 +93,6 @@ public class DefaultUsage extends ISOMet
public DefaultUsage(final CharSequence specificUsage,
final ResponsibleParty userContactInfo)
{
- this(); // Initialize the date field.
this.specificUsage = Types.toInternationalString(specificUsage);
this.userContactInfo = singleton(userContactInfo, ResponsibleParty.class);
}
@@ -104,16 +102,18 @@ public class DefaultUsage extends ISOMet
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Usage)
*/
public DefaultUsage(final Usage object) {
super(object);
- specificUsage = object.getSpecificUsage();
- usageDate = toMilliseconds(object.getUsageDate());
- userDeterminedLimitations = object.getUserDeterminedLimitations();
- userContactInfo = copyCollection(object.getUserContactInfo(), ResponsibleParty.class);
+ if (object != null) {
+ specificUsage = object.getSpecificUsage();
+ usageDate = toMilliseconds(object.getUsageDate());
+ userDeterminedLimitations = object.getUserDeterminedLimitations();
+ userContactInfo = copyCollection(object.getUserContactInfo(), ResponsibleParty.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -122,9 +122,7 @@
@XmlJavaTypeAdapter(LocaleAdapter.class),
@XmlJavaTypeAdapter(StringAdapter.class),
@XmlJavaTypeAdapter(InternationalStringAdapter.class),
- @XmlJavaTypeAdapter(GO_DateTime.class),
- @XmlJavaTypeAdapter(GO_Decimal.class), @XmlJavaTypeAdapter(type=double.class, value=GO_Decimal.class),
- @XmlJavaTypeAdapter(GO_Integer.AsLong.class), @XmlJavaTypeAdapter(type=long.class, value=GO_Integer.AsLong.class)
+ @XmlJavaTypeAdapter(GO_DateTime.class)
})
package org.apache.sis.metadata.iso.identification;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -68,14 +68,16 @@ public class DefaultAlgorithm extends IS
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Algorithm)
*/
public DefaultAlgorithm(final Algorithm object) {
super(object);
- citation = object.getCitation();
- description = object.getDescription();
+ if (object != null) {
+ citation = object.getCitation();
+ description = object.getDescription();
+ }
}
/**
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=1499819&r1=1499818&r2=1499819&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 Jul 4 17:36:19 2013
@@ -83,15 +83,17 @@ public class DefaultLineage extends ISOM
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Lineage)
*/
public DefaultLineage(final Lineage object) {
super(object);
- statement = object.getStatement();
- processSteps = copyCollection(object.getProcessSteps(), ProcessStep.class);
- sources = copyCollection(object.getSources(), Source.class);
+ if (object != null) {
+ statement = object.getStatement();
+ processSteps = copyCollection(object.getProcessSteps(), ProcessStep.class);
+ sources = copyCollection(object.getSources(), Source.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -68,14 +68,16 @@ public class DefaultNominalResolution ex
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(NominalResolution)
*/
public DefaultNominalResolution(final NominalResolution object) {
super(object);
- scanningResolution = object.getScanningResolution();
- groundResolution = object.getGroundResolution();
+ if (object != null) {
+ scanningResolution = object.getScanningResolution();
+ groundResolution = object.getGroundResolution();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -79,7 +79,7 @@ public class DefaultProcessStep extends
* in milliseconds elapsed since January 1st, 1970. If there is no such date, then this
* field is set to the special value {@link Long#MIN_VALUE}.
*/
- private long date;
+ private long date = Long.MIN_VALUE;
/**
* Identification of, and means of communication with, person(s) and
@@ -113,7 +113,6 @@ public class DefaultProcessStep extends
* Creates an initially empty process step.
*/
public DefaultProcessStep() {
- date = Long.MIN_VALUE;
}
/**
@@ -122,7 +121,6 @@ public class DefaultProcessStep extends
* @param description Description of the event, including related parameters or tolerances.
*/
public DefaultProcessStep(final CharSequence description) {
- this(); // Initialize the date field.
this.description = Types.toInternationalString(description);
}
@@ -131,20 +129,22 @@ public class DefaultProcessStep extends
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(ProcessStep)
*/
public DefaultProcessStep(final ProcessStep object) {
super(object);
- description = object.getDescription();
- rationale = object.getRationale();
- date = toMilliseconds(object.getDate());
- processors = copyCollection(object.getProcessors(), ResponsibleParty.class);
- sources = copyCollection(object.getSources(), Source.class);
- outputs = copyCollection(object.getOutputs(), Source.class);
- processingInformation = object.getProcessingInformation();
- reports = copyCollection(object.getReports(), ProcessStepReport.class);
+ if (object != null) {
+ description = object.getDescription();
+ rationale = object.getRationale();
+ date = toMilliseconds(object.getDate());
+ processors = copyCollection(object.getProcessors(), ResponsibleParty.class);
+ sources = copyCollection(object.getSources(), Source.class);
+ outputs = copyCollection(object.getOutputs(), Source.class);
+ processingInformation = object.getProcessingInformation();
+ reports = copyCollection(object.getReports(), ProcessStepReport.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -73,15 +73,17 @@ public class DefaultProcessStepReport ex
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(ProcessStepReport)
*/
public DefaultProcessStepReport(final ProcessStepReport object) {
super(object);
- name = object.getName();
- description = object.getDescription();
- fileType = object.getFileType();
+ if (object != null) {
+ name = object.getName();
+ description = object.getDescription();
+ fileType = object.getFileType();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -93,18 +93,20 @@ public class DefaultProcessing extends I
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Processing)
*/
public DefaultProcessing(final Processing object) {
super(object);
- identifiers = singleton(object.getIdentifier(), Identifier.class);
- softwareReferences = copyCollection(object.getSoftwareReferences(), Citation.class);
- procedureDescription = object.getProcedureDescription();
- documentations = copyCollection(object.getDocumentations(), Citation.class);
- runTimeParameters = object.getRunTimeParameters();
- algorithms = copyCollection(object.getAlgorithms(), Algorithm.class);
+ if (object != null) {
+ identifiers = singleton(object.getIdentifier(), Identifier.class);
+ softwareReferences = copyCollection(object.getSoftwareReferences(), Citation.class);
+ procedureDescription = object.getProcedureDescription();
+ documentations = copyCollection(object.getDocumentations(), Citation.class);
+ runTimeParameters = object.getRunTimeParameters();
+ algorithms = copyCollection(object.getAlgorithms(), Algorithm.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -127,20 +127,22 @@ public class DefaultSource extends ISOMe
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Source)
*/
public DefaultSource(final Source object) {
super(object);
- description = object.getDescription();
- scaleDenominator = object.getScaleDenominator();
- sourceCitation = object.getSourceCitation();
- sourceExtents = copyCollection(object.getSourceExtents(), Extent.class);
- sourceSteps = copyCollection(object.getSourceSteps(), ProcessStep.class);
- processedLevel = object.getProcessedLevel();
- resolution = object.getResolution();
- sourceReferenceSystem = object.getSourceReferenceSystem();
+ if (object != null) {
+ description = object.getDescription();
+ scaleDenominator = object.getScaleDenominator();
+ sourceCitation = object.getSourceCitation();
+ sourceExtents = copyCollection(object.getSourceExtents(), Extent.class);
+ sourceSteps = copyCollection(object.getSourceSteps(), ProcessStep.class);
+ processedLevel = object.getProcessedLevel();
+ resolution = object.getResolution();
+ sourceReferenceSystem = object.getSourceReferenceSystem();
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -72,7 +72,7 @@ public class DefaultMaintenanceInformati
* since January 1st, 1970. If there is no such date, then this field
* is set to the special value {@link Long#MIN_VALUE}.
*/
- private long dateOfNextUpdate;
+ private long dateOfNextUpdate = Long.MIN_VALUE;
/**
* Maintenance period other than those defined, in milliseconds.
@@ -104,7 +104,6 @@ public class DefaultMaintenanceInformati
* Creates a an initially empty maintenance information.
*/
public DefaultMaintenanceInformation() {
- dateOfNextUpdate = Long.MIN_VALUE;
}
/**
@@ -114,7 +113,6 @@ public class DefaultMaintenanceInformati
* made to the resource after the initial resource is completed, or {@code null} if none.
*/
public DefaultMaintenanceInformation(final MaintenanceFrequency maintenanceAndUpdateFrequency) {
- this(); // Initialize the date field.
this.maintenanceAndUpdateFrequency = maintenanceAndUpdateFrequency;
}
@@ -123,19 +121,21 @@ public class DefaultMaintenanceInformati
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(MaintenanceInformation)
*/
public DefaultMaintenanceInformation(final MaintenanceInformation object) {
super(object);
- maintenanceAndUpdateFrequency = object.getMaintenanceAndUpdateFrequency();
- dateOfNextUpdate = toMilliseconds(object.getDateOfNextUpdate());
- userDefinedMaintenanceFrequency = object.getUserDefinedMaintenanceFrequency();
- updateScopes = copyCollection(object.getUpdateScopes(), ScopeCode.class);
- updateScopeDescriptions = copyCollection(object.getUpdateScopeDescriptions(), ScopeDescription.class);
- maintenanceNotes = copyCollection(object.getMaintenanceNotes(), InternationalString.class);
- contacts = copyCollection(object.getContacts(), ResponsibleParty.class);
+ if (object != null) {
+ maintenanceAndUpdateFrequency = object.getMaintenanceAndUpdateFrequency();
+ dateOfNextUpdate = toMilliseconds(object.getDateOfNextUpdate());
+ userDefinedMaintenanceFrequency = object.getUserDefinedMaintenanceFrequency();
+ updateScopes = copyCollection(object.getUpdateScopes(), ScopeCode.class);
+ updateScopeDescriptions = copyCollection(object.getUpdateScopeDescriptions(), ScopeDescription.class);
+ maintenanceNotes = copyCollection(object.getMaintenanceNotes(), InternationalString.class);
+ contacts = copyCollection(object.getContacts(), ResponsibleParty.class);
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -122,40 +122,42 @@ public class DefaultScopeDescription ext
* {@linkplain #getAttributeInstances() attribute instances}, {@linkplain #getDataset() dataset}
* and {@linkplain #getOther() other}.</p>
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(ScopeDescription)
*/
@SuppressWarnings("unchecked")
public DefaultScopeDescription(final ScopeDescription object) {
super(object);
- for (byte i=ATTRIBUTES; i<=OTHER; i++) {
- Object candidate;
- switch (i) {
- case ATTRIBUTES: candidate = object.getAttributes(); break;
- case FEATURES: candidate = object.getFeatures(); break;
- case FEATURE_INSTANCES: candidate = object.getFeatureInstances(); break;
- case ATTRIBUTE_INSTANCES: candidate = object.getAttributeInstances(); break;
- case DATASET: candidate = object.getDataset(); break;
- case OTHER: candidate = object.getOther(); break;
- default: throw new AssertionError(i);
- }
- if (candidate != null) {
+ if (object != null) {
+ for (byte i=ATTRIBUTES; i<=OTHER; i++) {
+ Object candidate;
switch (i) {
- case ATTRIBUTES:
- case ATTRIBUTE_INSTANCES: {
- candidate = copySet((Set<AttributeType>) candidate, AttributeType.class);
- break;
- }
- case FEATURES:
- case FEATURE_INSTANCES: {
- candidate = copySet((Set<FeatureType>) candidate, FeatureType.class);
- break;
+ case ATTRIBUTES: candidate = object.getAttributes(); break;
+ case FEATURES: candidate = object.getFeatures(); break;
+ case FEATURE_INSTANCES: candidate = object.getFeatureInstances(); break;
+ case ATTRIBUTE_INSTANCES: candidate = object.getAttributeInstances(); break;
+ case DATASET: candidate = object.getDataset(); break;
+ case OTHER: candidate = object.getOther(); break;
+ default: throw new AssertionError(i);
+ }
+ if (candidate != null) {
+ switch (i) {
+ case ATTRIBUTES:
+ case ATTRIBUTE_INSTANCES: {
+ candidate = copySet((Set<AttributeType>) candidate, AttributeType.class);
+ break;
+ }
+ case FEATURES:
+ case FEATURE_INSTANCES: {
+ candidate = copySet((Set<FeatureType>) candidate, FeatureType.class);
+ break;
+ }
}
+ value = candidate;
+ property = i;
+ break;
}
- value = candidate;
- property = i;
- break;
}
}
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -56,7 +56,7 @@ public class AbstractCompleteness extend
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Completeness)
*/
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -297,7 +297,6 @@ public class AbstractElement extends ISO
* acceptable conformance quality level.
*/
public AbstractElement(final Result result) {
- this(); // Initialize date fields.
results = singleton(result, Result.class);
}
@@ -306,20 +305,22 @@ public class AbstractElement extends ISO
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(Element)
*/
public AbstractElement(final Element object) {
super(object);
- namesOfMeasure = copyCollection(object.getNamesOfMeasure(), InternationalString.class);
- measureIdentification = object.getMeasureIdentification();
- measureDescription = object.getMeasureDescription();
- evaluationMethodType = object.getEvaluationMethodType();
- evaluationMethodDescription = object.getEvaluationMethodDescription();
- evaluationProcedure = object.getEvaluationProcedure();
- results = copyCollection(object.getResults(), Result.class);
- writeDates(object.getDates());
+ if (object != null) {
+ namesOfMeasure = copyCollection(object.getNamesOfMeasure(), InternationalString.class);
+ measureIdentification = object.getMeasureIdentification();
+ measureDescription = object.getMeasureDescription();
+ evaluationMethodType = object.getEvaluationMethodType();
+ evaluationMethodDescription = object.getEvaluationMethodDescription();
+ evaluationProcedure = object.getEvaluationProcedure();
+ results = copyCollection(object.getResults(), Result.class);
+ writeDates(object.getDates());
+ }
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -61,7 +61,7 @@ public class AbstractLogicalConsistency
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(LogicalConsistency)
*/
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java?rev=1499819&r1=1499818&r2=1499819&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java [UTF-8] Thu Jul 4 17:36:19 2013
@@ -69,7 +69,7 @@ public class AbstractPositionalAccuracy
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object The metadata to copy values from.
+ * @param object The metadata to copy values from, or {@code null} if none.
*
* @see #castOrCopy(PositionalAccuracy)
*/