/** * Creates the feature descriptions object if it does not already exists, then returns it. * This method sets the {@code includedWithDataset} property to {@code true} because the * metadata built by this helper class are typically encoded together with the data. * * @return the feature descriptions (never {@code null}). * @see #newFeatureTypes() */ private DefaultFeatureCatalogueDescription featureDescription() { if (featureDescription == null) { featureDescription = new DefaultFeatureCatalogueDescription(); featureDescription.setIncludedWithDataset(true); } return featureDescription; }
/** * Sets the names of {@linkplain #getFeatureTypes() feature types}. * * @param newValues the new feature type names. * * @deprecated As of ISO 19115:2014, replaced by {@link #setFeatureTypeInfo(Collection)}. */ @Deprecated public void setFeatureTypes(final Collection<? extends GenericName> newValues) { checkWritePermission(); ((LegacyPropertyAdapter<GenericName,?>) getFeatureTypes()).setValues(newValues); }
/** * Returns the language(s) used within the catalogue * * @return language(s) used within the catalogue. */ @Override // @XmlElement at the end of this class. public Collection<Locale> getLanguages() { return languages = nonNullCollection(languages, Locale.class); }
/** * Creates a metadata sample with content information of different kind in a different order * than the one created by {@link #createSample1()}. */ private static DefaultMetadata createSample2() { final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription(); final DefaultImageDescription image = new DefaultImageDescription(); final DefaultMetadata metadata = new DefaultMetadata(); image.setProcessingLevelCode(new DefaultIdentifier("Level 2")); metadata.getContentInfo().add(image); features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("GPX file"))); features.setIncludedWithDataset(Boolean.TRUE); metadata.getContentInfo().add(features); metadata.getLanguages().add(Locale.FRENCH); return metadata; }
/** * 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(FeatureCatalogueDescription) */ public DefaultFeatureCatalogueDescription(final FeatureCatalogueDescription object) { super(object); if (object != null) { compliant = object.isCompliant(); includedWithDataset = object.isIncludedWithDataset(); languages = copyCollection(object.getLanguages(), Locale.class); featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class); if (object instanceof DefaultFeatureCatalogueDescription) { featureTypes = copyCollection(((DefaultFeatureCatalogueDescription) object).getFeatureTypeInfo(), DefaultFeatureTypeInfo.class); } else { setFeatureTypes(object.getFeatureTypes()); } } }
/** * Invoked by JAXB at both marshalling and unmarshalling time. * This attribute has been added by ISO 19115:2014 standard. * If (and only if) marshalling an older standard version, we omit this attribute. */ @XmlElement(name = "featureTypes") private Collection<DefaultFeatureTypeInfo> getFeatureTypesInfo() { return FilterByVersion.CURRENT_METADATA.accept() ? getFeatureTypeInfo() : null; }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action 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 DefaultFeatureCatalogueDescription}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultFeatureCatalogueDescription} instance is created using the * {@linkplain #DefaultFeatureCatalogueDescription(FeatureCatalogueDescription) 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 * given object itself), or {@code null} if the argument was null. */ public static DefaultFeatureCatalogueDescription castOrCopy(final FeatureCatalogueDescription object) { if (object == null || object instanceof DefaultFeatureCatalogueDescription) { return (DefaultFeatureCatalogueDescription) object; } return new DefaultFeatureCatalogueDescription(object); }
/** * Sets whether or not the cited feature catalogue complies with ISO 19110. * * @param newValue the new compliance value. */ public void setCompliant(final Boolean newValue) { checkWritePermission(); compliant = newValue; }
/** * Returns the locale to marshal if the XML document is to be written * according the new ISO 19115:2014 model. */ @XmlElement(name = "locale") private Collection<Locale> getLocale() { return FilterByVersion.CURRENT_METADATA.accept() ? getLanguages() : null; }
return DefaultFeatureCatalogueDescription.castOrCopy((FeatureCatalogueDescription) object);
/** * Creates a metadata sample with 3 content information of different kind. */ private static DefaultMetadata createSample1() { final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription(); final DefaultCoverageDescription coverage = new DefaultCoverageDescription(); final DefaultImageDescription image = new DefaultImageDescription(); final DefaultMetadata metadata = new DefaultMetadata(); features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("Shapefile"))); features.setIncludedWithDataset(Boolean.TRUE); metadata.getContentInfo().add(features); coverage.setProcessingLevelCode(new DefaultIdentifier("Level 1")); metadata.getContentInfo().add(coverage); image.setImagingCondition(ImagingCondition.CLOUD); image.setCloudCoverPercentage(0.8); metadata.getContentInfo().add(image); metadata.getLanguages().add(Locale.JAPANESE); metadata.getCharacterSets().add(StandardCharsets.UTF_16); return metadata; }
/** * 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(FeatureCatalogueDescription) */ public DefaultFeatureCatalogueDescription(final FeatureCatalogueDescription object) { super(object); if (object != null) { compliant = object.isCompliant(); includedWithDataset = object.isIncludedWithDataset(); languages = copyCollection(object.getLanguages(), Locale.class); featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class); if (object instanceof DefaultFeatureCatalogueDescription) { featureTypes = copyCollection(((DefaultFeatureCatalogueDescription) object).getFeatureTypeInfo(), DefaultFeatureTypeInfo.class); } else { setFeatureTypes(object.getFeatureTypes()); } } }
@Dependencies("getFeatureTypeInfo") public final Collection<GenericName> getFeatureTypes() { return new LegacyPropertyAdapter<GenericName,DefaultFeatureTypeInfo>(getFeatureTypeInfo()) {
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action 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 DefaultFeatureCatalogueDescription}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultFeatureCatalogueDescription} instance is created using the * {@linkplain #DefaultFeatureCatalogueDescription(FeatureCatalogueDescription) 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 * given object itself), or {@code null} if the argument was null. */ public static DefaultFeatureCatalogueDescription castOrCopy(final FeatureCatalogueDescription object) { if (object == null || object instanceof DefaultFeatureCatalogueDescription) { return (DefaultFeatureCatalogueDescription) object; } return new DefaultFeatureCatalogueDescription(object); }
/** * Sets whether or not the feature catalogue is included with the resource. * * @param newValue {@code true} if the feature catalogue is included. */ public void setIncludedWithDataset(final boolean newValue) { checkWritePermission(); includedWithDataset = newValue; }
/** * Returns the locale to marshal if the XML document is to be written * according the legacy ISO 19115:2003 model. */ @XmlElement(name = "language", namespace = LegacyNamespaces.GMD) @XmlJavaTypeAdapter(LocaleAdapter.class) private Collection<Locale> getLanguage() { return FilterByVersion.LEGACY_METADATA.accept() ? getLanguages() : null; } }
return DefaultFeatureCatalogueDescription.castOrCopy((FeatureCatalogueDescription) object);
/** * Creates the feature descriptions object if it does not already exists, then returns it. * This method sets the {@code includedWithDataset} property to {@code true} because the * metadata built by this helper class are typically encoded together with the data. * * @return the feature descriptions (never {@code null}). * @see #newFeatureTypes() */ private DefaultFeatureCatalogueDescription featureDescription() { if (featureDescription == null) { featureDescription = new DefaultFeatureCatalogueDescription(); featureDescription.setIncludedWithDataset(true); } return featureDescription; }
public final Collection<GenericName> getFeatureTypes() { if (!FilterByVersion.LEGACY_METADATA.accept()) return null; return new LegacyPropertyAdapter<GenericName,DefaultFeatureTypeInfo>(getFeatureTypeInfo()) {
/** * Sets the names of {@linkplain #getFeatureTypes() feature types}. * * @param newValues the new feature type names. * * @deprecated As of ISO 19115:2014, replaced by {@link #setFeatureTypeInfo(Collection)}. */ @Deprecated public void setFeatureTypes(final Collection<? extends GenericName> newValues) { checkWritePermission(valueIfDefined(featureTypes)); ((LegacyPropertyAdapter<GenericName,?>) getFeatureTypes()).setValues(newValues); }