/** * Returns the name of a subset, profile, or product specification of the format. * * @return name of a subset, profile, or product specification of the format, or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getTitle() getTitle()}</code>. */ @Override @Deprecated @XmlElement(name = "specification") @Dependencies("getFormatSpecificationCitation") public InternationalString getSpecification() { final Citation citation = getFormatSpecificationCitation(); return (citation != null) ? citation.getTitle() : null; }
/** * Returns the version of the format (date, number, etc.). * * @return version of the format, or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getEdition() * getEdition()}</code>. */ @Override @Deprecated @XmlElement(name = "version", required = true) @Dependencies("getFormatSpecificationCitation") public InternationalString getVersion() { final Citation citation = getFormatSpecificationCitation(); return (citation != null) ? citation.getEdition() : null; }
/** * Returns the name of a subset, profile, or product specification of the format. * * @return name of a subset, profile, or product specification of the format, or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getTitle() getTitle()}</code>. */ @Override @Deprecated @Dependencies("getFormatSpecificationCitation") @XmlElement(name = "specification", namespace = LegacyNamespaces.GMD) public InternationalString getSpecification() { if (FilterByVersion.LEGACY_METADATA.accept()) { final Citation citation = getFormatSpecificationCitation(); if (citation != null) { return citation.getTitle(); } } return null; }
/** * Returns the name of the data transfer format(s). * * @return name of the data transfer format(s), or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getAlternateTitles() * getAlternateTitles()}</code>. Note that citation alternate titles are often used for abbreviations. */ @Override @Deprecated @XmlElement(name = "name", required = true) @Dependencies("getFormatSpecificationCitation") public InternationalString getName() { final Citation citation = getFormatSpecificationCitation(); if (citation != null) { return LegacyPropertyAdapter.getSingleton(citation.getAlternateTitles(), InternationalString.class, null, DefaultFormat.class, "getName"); } return null; }
/** * Returns the version of the format (date, number, etc.). * * @return version of the format, or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getEdition() * getEdition()}</code>. */ @Override @Deprecated @Dependencies("getFormatSpecificationCitation") @XmlElement(name = "version", namespace = LegacyNamespaces.GMD) public InternationalString getVersion() { if (FilterByVersion.LEGACY_METADATA.accept()) { final Citation citation = getFormatSpecificationCitation(); if (citation != null) { return citation.getEdition(); } } return null; }
/** * Returns the name of the data transfer format(s). * * @return name of the data transfer format(s), or {@code null}. * * @deprecated As of ISO 19115:2014, replaced by * <code>{@linkplain #getFormatSpecificationCitation()}.{@linkplain DefaultCitation#getAlternateTitles() * getAlternateTitles()}</code>. Note that citation alternate titles are often used for abbreviations. */ @Override @Deprecated @Dependencies("getFormatSpecificationCitation") @XmlElement(name = "name", namespace = LegacyNamespaces.GMD) public InternationalString getName() { if (FilterByVersion.LEGACY_METADATA.accept()) { final Citation citation = getFormatSpecificationCitation(); if (citation != null) { return LegacyPropertyAdapter.getSingleton(citation.getAlternateTitles(), InternationalString.class, null, DefaultFormat.class, "getName"); } } return null; }
/** * Returns a more complete description of the GPX format. * The format will be part of the metadata returned by {@link #getMetadata()}. * * @see StoreProvider#getFormat() * @see org.apache.sis.internal.storage.gpx.Metadata#getResourceFormats() */ final Format getFormat() { assert Thread.holdsLock(this); Format format = ((StoreProvider) provider).getFormat(listeners); if (version != null) { final DefaultFormat df = new DefaultFormat(format); final DefaultCitation citation = new DefaultCitation(df.getFormatSpecificationCitation()); citation.setEdition(new SimpleInternationalString(version.toString())); df.setFormatSpecificationCitation(citation); format = df; } return format; }
/** * Adds a name to the resource format. Note that this method does not add a new format, * but only an alternative name to current format. Storage location is: * * <ul> * <li>{@code metadata/identificationInfo/resourceFormat/formatSpecificationCitation/alternateTitle}</li> * </ul> * * If this method is used together with {@link #setFormat(String)}, * then {@code setFormat} should be invoked <strong>before</strong> this method. * * @param value the format name, or {@code null} for no-operation. * * @see #setFormat(String) * @see #addCompression(CharSequence) */ public final void addFormatName(final CharSequence value) { final InternationalString i18n = trim(value); if (i18n != null) { final DefaultFormat format = format(); DefaultCitation citation = DefaultCitation.castOrCopy(format.getFormatSpecificationCitation()); if (citation == null) { citation = new DefaultCitation(i18n); } else { addIfNotPresent(citation.getAlternateTitles(), i18n); } format.setFormatSpecificationCitation(citation); } }
/** * 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(Format) */ public DefaultFormat(final Format object) { super(object); if (object != null) { amendmentNumber = object.getAmendmentNumber(); fileDecompressionTechnique = object.getFileDecompressionTechnique(); formatDistributors = copyCollection(object.getFormatDistributors(), Distributor.class); if (object instanceof DefaultFormat) { formatSpecificationCitation = ((DefaultFormat) object).getFormatSpecificationCitation(); media = copyCollection(((DefaultFormat) object).getMedia(), Medium.class); } else { setSpecification(object.getSpecification()); setVersion(object.getVersion()); setName(object.getName()); } } }
/** * 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(Format) */ public DefaultFormat(final Format object) { super(object); if (object != null) { amendmentNumber = object.getAmendmentNumber(); fileDecompressionTechnique = object.getFileDecompressionTechnique(); formatDistributors = copyCollection(object.getFormatDistributors(), Distributor.class); if (object instanceof DefaultFormat) { formatSpecificationCitation = ((DefaultFormat) object).getFormatSpecificationCitation(); media = copyCollection(((DefaultFormat) object).getMedia(), Medium.class); } else { setSpecification(object.getSpecification()); setVersion(object.getVersion()); setName(object.getName()); } } }