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/03/28 16:25:54 UTC
svn commit: r1462152 [1/5] - in
/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis:
internal/jaxb/gmi/ metadata/ metadata/iso/ metadata/iso/acquisition/
metadata/iso/citation/ metadata/iso/constraint/ metadata/iso/content/
metadata/iso/distri...
Author: desruisseaux
Date: Thu Mar 28 15:25:51 2013
New Revision: 1462152
URL: http://svn.apache.org/r1462152
Log:
Added copy constructor in every metadata class. The cost in JAR file size is approximatively 7 kb.
We paid that cost because invoking virtual methods using Java reflection at object construction time
is unsafe. Furthermore the copy constructor may be invoked more often than other operation, because
JAXB wants an annotated implementation class at marshalling time.
Modified:
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultFeatureTypeList.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultAddress.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultSeries.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeElementDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDataFile.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDigitalTransferOptions.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistribution.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultDistributor.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultMedium.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultStandardOrderProcess.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/AbstractGeographicExtent.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultBoundingPolygon.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultSpatialTemporalExtent.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/AbstractIdentification.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphic.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentification.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultKeywords.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentification.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultScope.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractGeolocationInformation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/AbstractSpatialRepresentation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultDimension.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCP.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGCPCollection.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeoreferenceable.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultVectorSpatialRepresentation.java
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_ProcessStep.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,7 +55,7 @@ public class LE_ProcessStep extends Defa
* @param original The original metadata to copy.
*/
public LE_ProcessStep(final ProcessStep original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/LE_Source.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -53,7 +53,7 @@ public class LE_Source extends DefaultSo
* @param original The original metadata to copy.
*/
public LE_Source(final Source original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Band.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -53,7 +53,7 @@ public class MI_Band extends DefaultBand
* @param original The original metadata to copy.
*/
public MI_Band(final Band original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_CoverageDescription.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,7 +55,7 @@ public class MI_CoverageDescription exte
* @param original The original metadata to copy.
*/
public MI_CoverageDescription(final CoverageDescription original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georectified.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,7 +55,7 @@ public class MI_Georectified extends Def
* @param original The original metadata to copy.
*/
public MI_Georectified(final Georectified original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Georeferenceable.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,7 +55,7 @@ public class MI_Georeferenceable extend
* @param original The original metadata to copy.
*/
public MI_Georeferenceable(final Georeferenceable original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_ImageDescription.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,7 +55,7 @@ public class MI_ImageDescription extends
* @param original The original metadata to copy.
*/
public MI_ImageDescription(final ImageDescription original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/MI_Metadata.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -55,7 +55,7 @@ public class MI_Metadata extends Default
* @param original The original metadata to copy.
*/
public MI_Metadata(final Metadata original) {
- shallowCopy(original);
+ super(original);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -269,7 +269,7 @@ public class MetadataStandard {
type = findInterface(implementation);
if (type == null) {
if (mandatory) {
- throw new ClassCastException(Errors.format(Errors.Keys.UnknownType_1, type));
+ throw new ClassCastException(Errors.format(Errors.Keys.UnknownType_1, implementation));
}
return null;
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultApplicationSchemaInformation.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -110,12 +110,38 @@ public class DefaultApplicationSchemaInf
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(ApplicationSchemaInformation)
+ */
+ public DefaultApplicationSchemaInformation(final ApplicationSchemaInformation object) {
+ super(object);
+ name = object.getName();
+ schemaLanguage = object.getSchemaLanguage();
+ constraintLanguage = object.getConstraintLanguage();
+ schemaAscii = object.getSchemaAscii();
+ graphicsFile = object.getGraphicsFile();
+ softwareDevelopmentFile = object.getSoftwareDevelopmentFile();
+ softwareDevelopmentFileFormat = object.getSoftwareDevelopmentFileFormat();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultApplicationSchemaInformation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultApplicationSchemaInformation} instance is created using the
+ * {@linkplain #DefaultApplicationSchemaInformation(ApplicationSchemaInformation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -125,9 +151,7 @@ public class DefaultApplicationSchemaInf
if (object == null || object instanceof DefaultApplicationSchemaInformation) {
return (DefaultApplicationSchemaInformation) object;
}
- final DefaultApplicationSchemaInformation copy = new DefaultApplicationSchemaInformation();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultApplicationSchemaInformation(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultExtendedElementInformation.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -176,12 +176,44 @@ public class DefaultExtendedElementInfor
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(ExtendedElementInformation)
+ */
+ public DefaultExtendedElementInformation(final ExtendedElementInformation object) {
+ super(object);
+ name = object.getName();
+ shortName = object.getShortName();
+ domainCode = object.getDomainCode();
+ definition = object.getDefinition();
+ obligation = object.getObligation();
+ condition = object.getCondition();
+ dataType = object.getDataType();
+ maximumOccurrence = object.getMaximumOccurrence();
+ domainValue = object.getDomainValue();
+ parentEntity = copyCollection(object.getParentEntity(), String.class);
+ rule = object.getRule();
+ rationales = copyCollection(object.getRationales(), InternationalString.class);
+ sources = copyCollection(object.getSources(), ResponsibleParty.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultExtendedElementInformation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultExtendedElementInformation} instance is created using the
+ * {@linkplain #DefaultExtendedElementInformation(ExtendedElementInformation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -191,9 +223,7 @@ public class DefaultExtendedElementInfor
if (object == null || object instanceof DefaultExtendedElementInformation) {
return (DefaultExtendedElementInformation) object;
}
- final DefaultExtendedElementInformation copy = new DefaultExtendedElementInformation();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultExtendedElementInformation(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultFeatureTypeList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultFeatureTypeList.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultFeatureTypeList.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultFeatureTypeList.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -71,12 +71,33 @@ public class DefaultFeatureTypeList exte
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(FeatureTypeList)
+ */
+ public DefaultFeatureTypeList(final FeatureTypeList object) {
+ super(object);
+ spatialObject = object.getSpatialObject();
+ spatialSchemaName = object.getSpatialSchemaName();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultFeatureTypeList}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultFeatureTypeList} instance is created using the
+ * {@linkplain #DefaultFeatureTypeList(FeatureTypeList) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -86,9 +107,7 @@ public class DefaultFeatureTypeList exte
if (object == null || object instanceof DefaultFeatureTypeList) {
return (DefaultFeatureTypeList) object;
}
- final DefaultFeatureTypeList copy = new DefaultFeatureTypeList();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultFeatureTypeList(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -93,12 +93,33 @@ public class DefaultIdentifier extends I
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Identifier)
+ */
+ public DefaultIdentifier(final Identifier object) {
+ super(object);
+ code = object.getCode();
+ authority = object.getAuthority();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultIdentifier}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultIdentifier} instance is created using the
+ * {@linkplain #DefaultIdentifier(Identifier) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -108,9 +129,7 @@ public class DefaultIdentifier extends I
if (object == null || object instanceof DefaultIdentifier) {
return (DefaultIdentifier) object;
}
- final DefaultIdentifier copy = new DefaultIdentifier();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultIdentifier(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -246,12 +246,55 @@ public class DefaultMetadata extends ISO
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Metadata)
+ */
+ public DefaultMetadata(final Metadata object) {
+ super(object);
+ fileIdentifier = object.getFileIdentifier();
+ language = object.getLanguage();
+ characterSet = object.getCharacterSet();
+ parentIdentifier = object.getParentIdentifier();
+ hierarchyLevels = copyCollection(object.getHierarchyLevels(), ScopeCode.class);
+ hierarchyLevelNames = copyCollection(object.getHierarchyLevelNames(), String.class);
+ contacts = copyCollection(object.getContacts(), ResponsibleParty.class);
+// TODO dateStamp = object.getDateStamp();
+ metadataStandardName = object.getMetadataStandardName();
+ metadataStandardVersion = object.getMetadataStandardVersion();
+ dataSetUri = object.getDataSetUri();
+ locales = copyCollection(object.getLocales(), Locale.class);
+ spatialRepresentationInfo = copyCollection(object.getSpatialRepresentationInfo(), SpatialRepresentation.class);
+ referenceSystemInfo = copyCollection(object.getReferenceSystemInfo(), ReferenceSystem.class);
+ metadataExtensionInfo = copyCollection(object.getMetadataExtensionInfo(), MetadataExtensionInformation.class);
+ identificationInfo = copyCollection(object.getIdentificationInfo(), Identification.class);
+ contentInfo = copyCollection(object.getContentInfo(), ContentInformation.class);
+ distributionInfo = object.getDistributionInfo();
+ dataQualityInfo = copyCollection(object.getDataQualityInfo(), DataQuality.class);
+ portrayalCatalogueInfo = copyCollection(object.getPortrayalCatalogueInfo(), PortrayalCatalogueReference.class);
+ metadataConstraints = copyCollection(object.getMetadataConstraints(), Constraints.class);
+ applicationSchemaInfo = copyCollection(object.getApplicationSchemaInfo(), ApplicationSchemaInformation.class);
+ metadataMaintenance = object.getMetadataMaintenance();
+ acquisitionInformation = copyCollection(object.getAcquisitionInformation(), AcquisitionInformation.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultMetadata}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultMetadata} instance is created using the
+ * {@linkplain #DefaultMetadata(Metadata) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -261,9 +304,7 @@ public class DefaultMetadata extends ISO
if (object == null || object instanceof DefaultMetadata) {
return (DefaultMetadata) object;
}
- final DefaultMetadata copy = new DefaultMetadata();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultMetadata(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadataExtensionInformation.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -67,12 +67,33 @@ public class DefaultMetadataExtensionInf
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(MetadataExtensionInformation)
+ */
+ public DefaultMetadataExtensionInformation(final MetadataExtensionInformation object) {
+ super(object);
+ extensionOnLineResource = object.getExtensionOnLineResource();
+ extendedElementInformation = copyCollection(object.getExtendedElementInformation(), ExtendedElementInformation.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultMetadataExtensionInformation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultMetadataExtensionInformation} instance is created using the
+ * {@linkplain #DefaultMetadataExtensionInformation(MetadataExtensionInformation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -82,9 +103,7 @@ public class DefaultMetadataExtensionInf
if (object == null || object instanceof DefaultMetadataExtensionInformation) {
return (DefaultMetadataExtensionInformation) object;
}
- final DefaultMetadataExtensionInformation copy = new DefaultMetadataExtensionInformation();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultMetadataExtensionInformation(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultPortrayalCatalogueReference.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -65,12 +65,32 @@ public class DefaultPortrayalCatalogueRe
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(PortrayalCatalogueReference)
+ */
+ public DefaultPortrayalCatalogueReference(final PortrayalCatalogueReference object) {
+ super(object);
+ portrayalCatalogueCitations = copyCollection(object.getPortrayalCatalogueCitations(), Citation.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultPortrayalCatalogueReference}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultPortrayalCatalogueReference} instance is created using the
+ * {@linkplain #DefaultPortrayalCatalogueReference(PortrayalCatalogueReference) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -80,9 +100,7 @@ public class DefaultPortrayalCatalogueRe
if (object == null || object instanceof DefaultPortrayalCatalogueReference) {
return (DefaultPortrayalCatalogueReference) object;
}
- final DefaultPortrayalCatalogueReference copy = new DefaultPortrayalCatalogueReference();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultPortrayalCatalogueReference(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -25,6 +25,7 @@ import org.apache.sis.xml.IdentifiedObje
import org.apache.sis.metadata.MetadataStandard;
import org.apache.sis.metadata.ModifiableMetadata;
import org.apache.sis.internal.jaxb.IdentifierMapWithSpecialCases;
+import org.apache.sis.util.ArgumentChecks;
/**
@@ -68,9 +69,10 @@ public class ISOMetadata extends Modifia
* If the given object is an instance of {@link IdentifiedObject}, then this constructor
* copies the {@linkplain #identifiers collection of identifiers}.
*
- * @param object The metadata to copy values from, or {@code null} if none.
+ * @param object The metadata to copy values from.
*/
protected ISOMetadata(final Object object) {
+ ArgumentChecks.ensureNonNull("object", object);
if (object instanceof IdentifiedObject) {
identifiers = copyCollection(((IdentifiedObject) object).getIdentifiers(), Identifier.class);
}
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultAcquisitionInformation.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -99,12 +99,38 @@ public class DefaultAcquisitionInformati
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(AcquisitionInformation)
+ */
+ public DefaultAcquisitionInformation(final AcquisitionInformation object) {
+ super(object);
+ acquisitionPlans = copyCollection(object.getAcquisitionPlans(), Plan.class);
+ acquisitionRequirements = copyCollection(object.getAcquisitionRequirements(), Requirement.class);
+ environmentalConditions = object.getEnvironmentalConditions();
+ instruments = copyCollection(object.getInstruments(), Instrument.class);
+ objectives = copyCollection(object.getObjectives(), Objective.class);
+ operations = copyCollection(object.getOperations(), Operation.class);
+ platforms = copyCollection(object.getPlatforms(), Platform.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultAcquisitionInformation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultAcquisitionInformation} instance is created using the
+ * {@linkplain #DefaultAcquisitionInformation(AcquisitionInformation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -114,9 +140,7 @@ public class DefaultAcquisitionInformati
if (object == null || object instanceof DefaultAcquisitionInformation) {
return (DefaultAcquisitionInformation) object;
}
- final DefaultAcquisitionInformation copy = new DefaultAcquisitionInformation();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultAcquisitionInformation(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEnvironmentalRecord.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -74,12 +74,35 @@ public class DefaultEnvironmentalRecord
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(EnvironmentalRecord)
+ */
+ public DefaultEnvironmentalRecord(final EnvironmentalRecord object) {
+ super(object);
+ averageAirTemperature = object.getAverageAirTemperature();
+ maxRelativeHumidity = object.getMaxRelativeHumidity();
+ maxAltitude = object.getMaxAltitude();
+ meteorologicalConditions = object.getMeteorologicalConditions();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultEnvironmentalRecord}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultEnvironmentalRecord} instance is created using the
+ * {@linkplain #DefaultEnvironmentalRecord(EnvironmentalRecord) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -89,9 +112,7 @@ public class DefaultEnvironmentalRecord
if (object == null || object instanceof DefaultEnvironmentalRecord) {
return (DefaultEnvironmentalRecord) object;
}
- final DefaultEnvironmentalRecord copy = new DefaultEnvironmentalRecord();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultEnvironmentalRecord(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultEvent.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -102,12 +102,39 @@ public class DefaultEvent extends ISOMet
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Event)
+ */
+ public DefaultEvent(final Event object) {
+ super(object);
+ identifiers = singleton(object.getIdentifier(), Identifier.class); // TODO
+ trigger = object.getTrigger();
+ context = object.getContext();
+ sequence = object.getSequence();
+// TODO time = object.getTime();
+ expectedObjectives = copyCollection(object.getExpectedObjectives(), Objective.class);
+ relatedPass = object.getRelatedPass();
+ relatedSensors = copyCollection(object.getRelatedSensors(), Instrument.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultEvent}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultEvent} instance is created using the
+ * {@linkplain #DefaultEvent(Event) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -117,9 +144,7 @@ public class DefaultEvent extends ISOMet
if (object == null || object instanceof DefaultEvent) {
return (DefaultEvent) object;
}
- final DefaultEvent copy = new DefaultEvent();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultEvent(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultInstrument.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -79,12 +79,36 @@ public class DefaultInstrument extends I
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Instrument)
+ */
+ public DefaultInstrument(final Instrument object) {
+ super(object);
+ citations = copyCollection(object.getCitations(), Citation.class);
+ identifiers = singleton(object.getIdentifier(), Identifier.class);
+ type = object.getType();
+ description = object.getDescription();
+ mountedOn = object.getMountedOn();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultInstrument}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultInstrument} instance is created using the
+ * {@linkplain #DefaultInstrument(Instrument) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -94,9 +118,7 @@ public class DefaultInstrument extends I
if (object == null || object instanceof DefaultInstrument) {
return (DefaultInstrument) object;
}
- final DefaultInstrument copy = new DefaultInstrument();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultInstrument(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultObjective.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -104,12 +104,39 @@ public class DefaultObjective extends IS
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Objective)
+ */
+ public DefaultObjective(final Objective object) {
+ super(object);
+ identifiers = copyCollection(object.getIdentifiers(), Identifier.class);
+ priority = object.getPriority();
+ types = copyCollection(object.getTypes(), ObjectiveType.class);
+ functions = copyCollection(object.getFunctions(), InternationalString.class);
+ extents = copyCollection(object.getExtents(), Extent.class);
+ objectiveOccurences = copyCollection(object.getObjectiveOccurences(), Event.class);
+ pass = copyCollection(object.getPass(), PlatformPass.class);
+ sensingInstruments = copyCollection(object.getSensingInstruments(), Instrument.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultObjective}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultObjective} instance is created using the
+ * {@linkplain #DefaultObjective(Objective) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -119,9 +146,7 @@ public class DefaultObjective extends IS
if (object == null || object instanceof DefaultObjective) {
return (DefaultObjective) object;
}
- final DefaultObjective copy = new DefaultObjective();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultObjective(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultOperation.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -121,12 +121,42 @@ public class DefaultOperation extends IS
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Operation)
+ */
+ public DefaultOperation(final Operation object) {
+ super(object);
+ description = object.getDescription();
+ citation = object.getCitation();
+ identifiers = singleton(object.getIdentifier(), Identifier.class); // TODO
+ status = object.getStatus();
+ type = object.getType();
+ childOperations = copyCollection(object.getChildOperations(), Operation.class);
+ objectives = copyCollection(object.getObjectives(), Objective.class);
+ parentOperation = object.getParentOperation();
+ plan = object.getPlan();
+ platforms = copyCollection(object.getPlatforms(), Platform.class);
+ significantEvents = copyCollection(object.getSignificantEvents(), Event.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultOperation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultOperation} instance is created using the
+ * {@linkplain #DefaultOperation(Operation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -136,9 +166,7 @@ public class DefaultOperation extends IS
if (object == null || object instanceof DefaultOperation) {
return (DefaultOperation) object;
}
- final DefaultOperation copy = new DefaultOperation();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultOperation(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlan.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -84,12 +84,36 @@ public class DefaultPlan extends ISOMeta
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Plan)
+ */
+ public DefaultPlan(final Plan object) {
+ super(object);
+ type = object.getType();
+ status = object.getStatus();
+ citation = object.getCitation();
+ operations = copyCollection(object.getOperations(), Operation.class);
+ satisfiedRequirements = copyCollection(object.getSatisfiedRequirements(), Requirement.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultPlan}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultPlan} instance is created using the
+ * {@linkplain #DefaultPlan(Plan) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -99,9 +123,7 @@ public class DefaultPlan extends ISOMeta
if (object == null || object instanceof DefaultPlan) {
return (DefaultPlan) object;
}
- final DefaultPlan copy = new DefaultPlan();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultPlan(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatform.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -80,12 +80,36 @@ public class DefaultPlatform extends ISO
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Platform)
+ */
+ public DefaultPlatform(final Platform object) {
+ super(object);
+ citation = object.getCitation();
+ identifiers = singleton(object.getIdentifier(), Identifier.class); // TODO
+ description = object.getDescription();
+ sponsors = copyCollection(object.getSponsors(), ResponsibleParty.class);
+ instruments = copyCollection(object.getInstruments(), Instrument.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultPlatform}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultPlatform} instance is created using the
+ * {@linkplain #DefaultPlatform(Platform) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -95,9 +119,7 @@ public class DefaultPlatform extends ISO
if (object == null || object instanceof DefaultPlatform) {
return (DefaultPlatform) object;
}
- final DefaultPlatform copy = new DefaultPlatform();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultPlatform(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultPlatformPass.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -66,12 +66,34 @@ public class DefaultPlatformPass extends
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(PlatformPass)
+ */
+ public DefaultPlatformPass(final PlatformPass object) {
+ super(object);
+ identifiers = singleton(object.getIdentifier(), Identifier.class); // TODO
+ extent = object.getExtent();
+ relatedEvents = copyCollection(object.getRelatedEvents(), Event.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultPlatformPass}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultPlatformPass} instance is created using the
+ * {@linkplain #DefaultPlatformPass(PlatformPass) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -81,9 +103,7 @@ public class DefaultPlatformPass extends
if (object == null || object instanceof DefaultPlatformPass) {
return (DefaultPlatformPass) object;
}
- final DefaultPlatformPass copy = new DefaultPlatformPass();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultPlatformPass(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequestedDate.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -65,12 +65,33 @@ public class DefaultRequestedDate extend
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(RequestedDate)
+ */
+ public DefaultRequestedDate(final RequestedDate object) {
+ super(object);
+// TODO requestedDateOfCollection = object.getRequestedDateOfCollection();
+// TODO latestAcceptableDate = object.getLatestAcceptableDate();
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultRequestedDate}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultRequestedDate} instance is created using the
+ * {@linkplain #DefaultRequestedDate(RequestedDate) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -80,9 +101,7 @@ public class DefaultRequestedDate extend
if (object == null || object instanceof DefaultRequestedDate) {
return (DefaultRequestedDate) object;
}
- final DefaultRequestedDate copy = new DefaultRequestedDate();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultRequestedDate(object);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java?rev=1462152&r1=1462151&r2=1462152&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java [UTF-8] Thu Mar 28 15:25:51 2013
@@ -102,12 +102,39 @@ public class DefaultRequirement extends
}
/**
- * Returns a SIS metadata implementation with the same values than the given arbitrary
- * implementation. If the given object is {@code null}, then this method returns {@code null}.
- * Otherwise if the given object is already a SIS implementation, then the given object is
- * returned unchanged. Otherwise a new SIS implementation is created and initialized to the
- * property values of the given object, using a <cite>shallow</cite> copy operation
- * (i.e. properties are not cloned).
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * 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.
+ *
+ * @see #castOrCopy(Requirement)
+ */
+ public DefaultRequirement(final Requirement object) {
+ super(object);
+ citation = object.getCitation();
+ identifiers = singleton(object.getIdentifier(), Identifier.class); // TODO
+ requestors = copyCollection(object.getRequestors(), ResponsibleParty.class);
+ recipients = copyCollection(object.getRecipients(), ResponsibleParty.class);
+ priority = object.getPriority();
+ requestedDate = object.getRequestedDate();
+// TODO expiryDate = object.getExpiryDate();
+ satisfiedPlans = copyCollection(object.getSatisfiedPlans(), Plan.class);
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable actions in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultRequirement}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultRequirement} instance is created using the
+ * {@linkplain #DefaultRequirement(Requirement) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
*
* @param object The object to get as a SIS implementation, or {@code null} if none.
* @return A SIS implementation containing the values of the given object (may be the
@@ -117,9 +144,7 @@ public class DefaultRequirement extends
if (object == null || object instanceof DefaultRequirement) {
return (DefaultRequirement) object;
}
- final DefaultRequirement copy = new DefaultRequirement();
- copy.shallowCopy(object);
- return copy;
+ return new DefaultRequirement(object);
}
/**