/** * 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()); } } }
/** * 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); } }
/** * 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())); }
/** * 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(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()); } } }
/** * 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); } }