Search in sources :

Example 1 with DefaultScope

use of org.apache.sis.metadata.iso.maintenance.DefaultScope in project sis by apache.

the class DefaultSource method setSourceExtents.

/**
 * Information about the spatial, vertical and temporal extent of the source data.
 * This method stores the values in the {@linkplain #setScope(Scope) scope}.
 *
 * @param  newValues  the new source extents.
 *
 * @deprecated As of ISO 19115:2014, moved to {@link DefaultScope#setExtents(Collection)}.
 */
@Deprecated
public void setSourceExtents(final Collection<? extends Extent> newValues) {
    checkWritePermission();
    Scope scope = this.scope;
    if (!(scope instanceof DefaultScope)) {
        scope = new DefaultScope(scope);
        setScope(scope);
    }
    ((DefaultScope) scope).setExtents(newValues);
}
Also used : DefaultScope(org.apache.sis.metadata.iso.maintenance.DefaultScope) Scope(org.opengis.metadata.quality.Scope) MD_Scope(org.apache.sis.internal.jaxb.metadata.MD_Scope) DefaultScope(org.apache.sis.metadata.iso.maintenance.DefaultScope)

Example 2 with DefaultScope

use of org.apache.sis.metadata.iso.maintenance.DefaultScope in project sis by apache.

the class DefaultSource method getSourceExtents.

/**
 * Returns the information about the spatial, vertical and temporal extent of the source data.
 * This method fetches the values from the {@linkplain #getScope() scope}.
 *
 * @return information about the extent of the source data.
 *
 * @deprecated As of ISO 19115:2014, moved to {@link DefaultScope#getExtents()}.
 */
@Override
@Deprecated
@Dependencies("getScope")
@XmlElement(name = "sourceExtent", namespace = LegacyNamespaces.GMD)
public Collection<Extent> getSourceExtents() {
    if (FilterByVersion.LEGACY_METADATA.accept()) {
        Scope scope = getScope();
        if (!(scope instanceof DefaultScope)) {
            if (isModifiable()) {
                scope = new DefaultScope(scope);
                this.scope = scope;
            } else {
                return Collections.singleton(scope.getExtent());
            }
        }
    }
    return null;
}
Also used : DefaultScope(org.apache.sis.metadata.iso.maintenance.DefaultScope) Scope(org.opengis.metadata.quality.Scope) MD_Scope(org.apache.sis.internal.jaxb.metadata.MD_Scope) DefaultScope(org.apache.sis.metadata.iso.maintenance.DefaultScope) XmlElement(javax.xml.bind.annotation.XmlElement) Dependencies(org.apache.sis.internal.metadata.Dependencies)

Aggregations

MD_Scope (org.apache.sis.internal.jaxb.metadata.MD_Scope)2 DefaultScope (org.apache.sis.metadata.iso.maintenance.DefaultScope)2 Scope (org.opengis.metadata.quality.Scope)2 XmlElement (javax.xml.bind.annotation.XmlElement)1 Dependencies (org.apache.sis.internal.metadata.Dependencies)1