📄 query.java
字号:
package com.esri.solutions.jitk.datasources.ogc.wfs;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import com.esri.solutions.jitk.datasources.ogc.filters.IFilter;
public class Query implements IQuery {
protected String _typeName = null;
protected List<String> _propertyNames = null;
protected IFilter _filter = null;
protected CoordinateReferenceSystem _crs = null;
public Query() {
_propertyNames = new ArrayList<String>();
}
public String getTypeName() {
return _typeName;
}
public void setCrs(CoordinateReferenceSystem crs) {
_crs = crs;
}
public void setTypeName(String name) {
_typeName = name;
}
public List<String> getPropertyNames() {
return _propertyNames;
}
public void sePropertyNames(List<String> names) {
_propertyNames = names;
}
public IFilter getFilter() {
return _filter;
}
public void setFilter(IFilter _filter) {
this._filter = _filter;
}
/**
* From WFS Spec, page 36:
* The optional srsName attribute of the <Query> element is used to
* specify a specific WFS-supported SRS to be used for
* returned feature geometries. Its value may be the <DefaultSRS>
* or any of the <OtherSRS> values listed for the feature type in
* WFS capabilities document. If no srsName value is supplied, then
* the features shall be returned using the advertised <DefaultSRS>
* value. This attribute has no meaning for feature types with no
* spatial properties; if an srsName value is specified for a
* feature with no spatial properties, a web feature service may
* ignore the parameter and its value.
*/
public void toXML(OutputStream os) throws IOException {
String s = "<wfs:Query typeName=\"" + _typeName + "\"";
if (_crs != null) {
s += " srsName=\"" + _crs.getURNFormat() + "\"";
}
s += ">";
os.write(s.getBytes());
if (_filter != null) {
_filter.toXML(os);
}
os.write("</wfs:Query>".getBytes());
}
public void addPropertyName(String propertyName) {
_propertyNames.add(propertyName);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -