/** * Constructs a metadata entity initialized with the values from the specified metadata. * * @param source The metadata to copy, or {@code null} if none. * * @since 2.4 */ public DefaultProcessStep(final ProcessStep source) { super(source); if (source != null) { // Be careful to not overwrite date value (GEOTK-170). if (date == 0 && source.getDate() == null) { date = Long.MIN_VALUE; } } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Algorithm) */ public DefaultAlgorithm(final Algorithm object) { super(object); if (object != null) { citation = object.getCitation(); description = object.getDescription(); } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(ProcessStepReport) */ public DefaultProcessStepReport(final ProcessStepReport object) { super(object); if (object != null) { name = object.getName(); description = object.getDescription(); fileType = object.getFileType(); } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Source) */ public DefaultSource(final Source object) { super(object); if (object != null) { description = object.getDescription(); sourceReferenceSystem = object.getSourceReferenceSystem(); sourceCitation = object.getSourceCitation(); sourceSteps = copyCollection(object.getSourceSteps(), ProcessStep.class); processedLevel = object.getProcessedLevel(); resolution = object.getResolution(); if (object instanceof DefaultSource) { sourceSpatialResolution = ((DefaultSource) object).getSourceSpatialResolution(); sourceMetadata = copyCollection(((DefaultSource) object).getSourceMetadata(), Citation.class); scope = ((DefaultSource) object).getScope(); } else { setScaleDenominator(object.getScaleDenominator()); setSourceExtents(object.getSourceExtents()); } } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(ProcessStep) */ public DefaultProcessStep(final ProcessStep object) { super(object); 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); if (object instanceof DefaultProcessStep) { references = copyCollection(((DefaultProcessStep) object).getReferences(), Citation.class); scope = ((DefaultProcessStep) object).getScope(); } } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Processing) */ public DefaultProcessing(final Processing object) { super(object); 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); } }
/** * Wraps the given metadata into a Geotk implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original The original metadata provided by the user. * @return The metadata to marshall. */ public static DefaultProcessStep castOrCopy(final ProcessStep original) { if (original != null && !(original instanceof LE_ProcessStep)) { if (original.getProcessingInformation() != null || !isNullOrEmpty(original.getOutputs()) || !isNullOrEmpty(original.getReports())) { return new LE_ProcessStep(original); } } return DefaultProcessStep.castOrCopy(original); } }
/** * Wraps the given metadata into a SIS implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original the original metadata provided by the user. * @return the metadata to marshall. */ public static DefaultSource castOrCopy(final Source original) { if (original != null && !(original instanceof LE_Source)) { if (original.getProcessedLevel() != null || original.getResolution() != null) { return new LE_Source(original); } } return DefaultSource.castOrCopy(original); } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Lineage) */ public DefaultLineage(final Lineage object) { super(object); if (object != null) { statement = object.getStatement(); processSteps = copyCollection(object.getProcessSteps(), ProcessStep.class); sources = copyCollection(object.getSources(), Source.class); if (object instanceof DefaultLineage) { scope = ((DefaultLineage) object).getScope(); additionalDocumentation = copyCollection(((DefaultLineage) object).getAdditionalDocumentation(), Citation.class); } } }
/** * 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. * * <div class="note"><b>Note on properties validation:</b> * This constructor does not verify the property values of the given metadata (e.g. whether it contains * unexpected negative values). This is because invalid metadata exist in practice, and verifying their * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid * metadata instances can also be obtained by unmarshalling an invalid XML document. * </div> * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(NominalResolution) */ public DefaultNominalResolution(final NominalResolution object) { super(object); if (object != null) { scanningResolution = object.getScanningResolution(); groundResolution = object.getGroundResolution(); } }
/** * Verifies the unmarshalling result. */ private static void verify(final DefaultLineage lineage) { final Source source = TestUtilities.getSingleton(lineage.getSources()); assertEquals("source.description", "Description of source data level.", String.valueOf(source.getDescription())); }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Source) */ public DefaultSource(final Source object) { super(object); if (object != null) { description = object.getDescription(); sourceReferenceSystem = object.getSourceReferenceSystem(); sourceCitation = object.getSourceCitation(); sourceSteps = copyCollection(object.getSourceSteps(), ProcessStep.class); processedLevel = object.getProcessedLevel(); resolution = object.getResolution(); if (object instanceof DefaultSource) { sourceSpatialResolution = ((DefaultSource) object).getSourceSpatialResolution(); sourceMetadata = copyCollection(((DefaultSource) object).getSourceMetadata(), Citation.class); scope = ((DefaultSource) object).getScope(); } else { setScaleDenominator(object.getScaleDenominator()); setSourceExtents(object.getSourceExtents()); } } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Processing) */ public DefaultProcessing(final Processing object) { super(object); 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); } }
/** * Wraps the given metadata into a SIS implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original the original metadata provided by the user. * @return the metadata to marshall. */ public static DefaultProcessStep castOrCopy(final ProcessStep original) { if (original != null && !(original instanceof LE_ProcessStep)) { if (original.getProcessingInformation() != null || !isNullOrEmpty(original.getOutputs()) || !isNullOrEmpty(original.getReports())) { return new LE_ProcessStep(original); } } return DefaultProcessStep.castOrCopy(original); } }
/** * Wraps the given metadata into a Geotk implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original The original metadata provided by the user. * @return The metadata to marshall. */ public static DefaultSource castOrCopy(final Source original) { if (original != null && !(original instanceof LE_Source)) { if (original.getProcessedLevel() != null || original.getResolution() != null) { return new LE_Source(original); } } return DefaultSource.castOrCopy(original); } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(ProcessStepReport) */ public DefaultProcessStepReport(final ProcessStepReport object) { super(object); if (object != null) { name = object.getName(); description = object.getDescription(); fileType = object.getFileType(); } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Lineage) */ public DefaultLineage(final Lineage object) { super(object); if (object != null) { statement = object.getStatement(); processSteps = copyCollection(object.getProcessSteps(), ProcessStep.class); sources = copyCollection(object.getSources(), Source.class); if (object instanceof DefaultLineage) { scope = ((DefaultLineage) object).getScope(); additionalDocumentation = copyCollection(((DefaultLineage) object).getAdditionalDocumentation(), Citation.class); } } }
/** * 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, or {@code null} if none. * * @see #castOrCopy(Algorithm) */ public DefaultAlgorithm(final Algorithm object) { super(object); if (object != null) { citation = object.getCitation(); description = object.getDescription(); } }
/** * 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. * * <div class="note"><b>Note on properties validation:</b> * This constructor does not verify the property values of the given metadata (e.g. whether it contains * unexpected negative values). This is because invalid metadata exist in practice, and verifying their * validity in this copy constructor is often too late. Note that this is not the only hole, as invalid * metadata instances can also be obtained by unmarshalling an invalid XML document. * </div> * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(NominalResolution) */ public DefaultNominalResolution(final NominalResolution object) { super(object); if (object != null) { scanningResolution = object.getScanningResolution(); groundResolution = object.getGroundResolution(); } }
/** * Wraps the given metadata into a SIS implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original the original metadata provided by the user. * @return the metadata to marshall. */ public static DefaultSource castOrCopy(final Source original) { if (original != null && !(original instanceof LE_Source)) { if (original.getProcessedLevel() != null || original.getResolution() != null) { return new LE_Source(original); } } return DefaultSource.castOrCopy(original); } }