acceptformatskvpparser.java
来自「电子地图服务器,搭建自己的地图服务」· Java 代码 · 共 39 行
JAVA
39 行
/* 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.kvp;
import net.opengis.ows.AcceptFormatsType;
import net.opengis.ows.OwsFactory;
import org.geoserver.ows.KvpParser;
import org.geoserver.ows.util.KvpUtils;
import java.util.Iterator;
import java.util.List;
/**
* Parses a kvp of the form "acceptFormats=format1,format2,...,formatN" into
* an instance of {@link net.opengis.ows.v1_0_0.AcceptFormatsType}.
*
* @author Justin Deoliveira, The Open Planning Project
*
*/
public class AcceptFormatsKvpParser extends KvpParser {
public AcceptFormatsKvpParser() {
super("acceptFormats", AcceptFormatsType.class);
}
public Object parse(String value) throws Exception {
List values = KvpUtils.readFlat(value);
AcceptFormatsType acceptFormats = OwsFactory.eINSTANCE.createAcceptFormatsType();
for (Iterator v = values.iterator(); v.hasNext();) {
acceptFormats.getOutputFormat().add(v.next());
}
return acceptFormats;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?