Search in sources :

Example 1 with DefaultFormat

use of org.apache.sis.metadata.iso.distribution.DefaultFormat in project sis by apache.

the class Store method getFormat.

/**
 * 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;
}
Also used : Format(org.opengis.metadata.distribution.Format) DefaultFormat(org.apache.sis.metadata.iso.distribution.DefaultFormat) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) DefaultFormat(org.apache.sis.metadata.iso.distribution.DefaultFormat)

Example 2 with DefaultFormat

use of org.apache.sis.metadata.iso.distribution.DefaultFormat in project sis by apache.

the class MetadataSourceTest method testSearch.

/**
 * Tests {@link MetadataSource#search(Object)}
 *
 * @param  source  the instance to test.
 * @throws MetadataStoreException if an error occurred while querying the database.
 */
@TestStep
public static void testSearch(final MetadataSource source) throws MetadataStoreException {
    final DefaultCitation specification = new DefaultCitation("PNG (Portable Network Graphics) Specification");
    specification.setAlternateTitles(Collections.singleton(new SimpleInternationalString("PNG")));
    final DefaultFormat format = new DefaultFormat();
    format.setFormatSpecificationCitation(specification);
    assertEquals("PNG", source.search(format));
    specification.setTitle(null);
    assertNull(source.search(format));
}
Also used : DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) DefaultFormat(org.apache.sis.metadata.iso.distribution.DefaultFormat) TestStep(org.apache.sis.test.TestStep)

Example 3 with DefaultFormat

use of org.apache.sis.metadata.iso.distribution.DefaultFormat in project sis by apache.

the class MetadataBuilder method addCompression.

/**
 * Adds a compression name.
 * Storage location is:
 *
 * <ul>
 *   <li>{@code metadata/identificationInfo/resourceFormat/fileDecompressionTechnique}</li>
 * </ul>
 *
 * @param value  the compression name, or {@code null} for no-operation.
 *
 * @see #setFormat(String)
 */
public final void addCompression(final CharSequence value) {
    final InternationalString i18n = trim(value);
    if (i18n != null) {
        final DefaultFormat format = format();
        format.setFileDecompressionTechnique(append(format.getFileDecompressionTechnique(), i18n));
    }
}
Also used : InternationalString(org.opengis.util.InternationalString) DefaultFormat(org.apache.sis.metadata.iso.distribution.DefaultFormat)

Aggregations

DefaultFormat (org.apache.sis.metadata.iso.distribution.DefaultFormat)3 DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)2 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)2 TestStep (org.apache.sis.test.TestStep)1 Format (org.opengis.metadata.distribution.Format)1 InternationalString (org.opengis.util.InternationalString)1