⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wfsdescribefeaturetypeoutputformat.java

📁 电子地图服务器,搭建自己的地图服务
💻 JAVA
字号:
/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
 * This code is licensed under the GPL 2.0 license, availible at the root
 * application directory.
 */
package org.geoserver.wfs;

import net.opengis.wfs.FeatureCollectionType;
import org.geoserver.ows.Response;
import org.geoserver.platform.Operation;
import org.geoserver.platform.ServiceException;
import org.vfny.geoserver.global.FeatureTypeInfo;
import java.io.IOException;
import java.io.OutputStream;


/**
 * Base class for a response to a WFS DescribeFeatureType operation.
 * <p>
 * The result of a DescribeFeatureType operation is an array of
 * {@link FeatureTypeInfo}. Subclasses are responsible for serializing these
 * instances. See  {@link #write(FeatureCollectionType, OutputStream, Operation)}.
 * </p>
 * <p>
 * Subclasses also need declare the mime-type in which the format is encoded.
 * </p>
 * @author Justin Deoliveira, The Open Planning Project
 *
 */
public abstract class WFSDescribeFeatureTypeOutputFormat extends Response {
    /**
     * Constructor which sets the outputFormat.
     *
     * @param outputFormat The well-known name of the format, not <code>null</code>
     */
    public WFSDescribeFeatureTypeOutputFormat(String outputFormat) {
        super(FeatureTypeInfo[].class, outputFormat);
    }

    /**
     * Ensures that the operation being executed is a DescribeFeatureType operation.
     * <p>
     * This method may be extended to add additional checks, it should not be
     * overriden.
     * </p>
     */
    public boolean canHandle(Operation operation) {
        if ("DescribeFeatureType".equalsIgnoreCase(operation.getId())) {
            return true;
        }

        return false;
    }

    /**
     * Calls through to {@link #write(FeatureTypeInfo[], OutputStream, Operation)}.
     */
    public final void write(Object value, OutputStream output, Operation operation)
        throws IOException, ServiceException {
        write((FeatureTypeInfo[]) value, output, operation);
    }

    /**
     * Serializes the collection of feature type metadata objects  in the format
     * declared.
     *
     * @param featureTypeInfos The feature type metadata objects to serialize
     * @param output The output stream to serialize to.
     * @param getFeature The DescribeFeatureType operation descriptor.
     */
    protected abstract void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -