📄 defaultquery.html
字号:
<P><DT><B>Parameters:</B><DD><CODE>query</CODE> - </DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getPropertyNames()"><!-- --></A><H3>getPropertyNames</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] <B>getPropertyNames</B>()</PRE><DL><DD>The property names is used to specify the attributes that should be selected for the return feature collection. If the property array is null, then the datasource should return all available properties, its full schema. If an array of specified then the full schema should be used (all property names). The property names can be determined with a getSchema call from the DataSource interface. <p> This replaces our funky setSchema method of retrieving select properties. I think it makes it easier to understand how to get certain properties out of the datasource, instead of having users get the schema and then compose a new schema using the attributes that they want. The old way was also giving me problems because I couldn't have multiple object reuse the same datasource object, since some other object could come along and change its schema, and would then return the wrong properties. </p> <p></p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#getPropertyNames()">getPropertyNames</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the property names to be used in the returned FeatureCollection.</DL></DD></DL><HR><A NAME="setPropertyNames(java.lang.String[])"><!-- --></A><H3>setPropertyNames</H3><PRE>public void <B>setPropertyNames</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] propNames)</PRE><DL><DD>Sets the properties to retrieve from the db. If the boolean to load all properties is set to true then the AttributeTypes that are not in the database's schema will just be filled with null values.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>propNames</CODE> - The names of attributes to load from the datasouce.</DL></DD></DL><HR><A NAME="setPropertyNames(java.util.List)"><!-- --></A><H3>setPropertyNames</H3><PRE>public void <B>setPropertyNames</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/List.html" title="class or interface in java.util">List</A> propNames)</PRE><DL><DD>Sets the proper attributeTypes constructed from a schema and a list of propertyNames.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>propNames</CODE> - the names of the properties to check against the schema. If null then all attributes will be returned. If a List of size 0 is used then only the featureIDs should be used.<DT><B>'TODO:'</B></DT> <DD>REVISIT: This syntax is really obscure. Consider having an fid or featureID propertyName that datasource implementors look for instead of looking to see if the list size is 0.</DD></DL></DD></DL><HR><A NAME="retrieveAllProperties()"><!-- --></A><H3>retrieveAllProperties</H3><PRE>public boolean <B>retrieveAllProperties</B>()</PRE><DL><DD>Convenience method to determine if the query should use the full schema (all properties) of the data source for the features returned. This method is equivalent to if (query.getProperties() == null), but allows for more clarity on the part of datasource implementors, so they do not need to examine and use null values. All Query implementations should return true for this function if getProperties returns null.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#retrieveAllProperties()">retrieveAllProperties</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>if all datasource attributes should be included in the schema of the returned FeatureCollection.</DL></DD></DL><HR><A NAME="getMaxFeatures()"><!-- --></A><H3>getMaxFeatures</H3><PRE>public int <B>getMaxFeatures</B>()</PRE><DL><DD>The optional maxFeatures can be used to limit the number of features that a query request retrieves. If no maxFeatures is specified then all features should be returned. <p> This is the only method that is not directly out of the Query element in the WFS spec. It is instead a part of a <code>getFeatures</code> request, which can hold one or more queries. But each of those in turn will need a maxFeatures, so it is needed here. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#getMaxFeatures()">getMaxFeatures</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the max features the getFeature call should return.</DL></DD></DL><HR><A NAME="setMaxFeatures(int)"><!-- --></A><H3>setMaxFeatures</H3><PRE>public void <B>setMaxFeatures</B>(int maxFeatures)</PRE><DL><DD>Sets the max features to retrieved by this query.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>maxFeatures</CODE> - the maximum number of features the getFeature call should return.</DL></DD></DL><HR><A NAME="getFilter()"><!-- --></A><H3>getFilter</H3><PRE>public <A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> <B>getFilter</B>()</PRE><DL><DD>The Filter can be used to define constraints on a query. If no Filter is present then the query is unconstrained and all feature instances should be retrieved.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#getFilter()">getFilter</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>The filter that defines constraints on the query.</DL></DD></DL><HR><A NAME="setFilter(org.geotools.filter.Filter)"><!-- --></A><H3>setFilter</H3><PRE>public void <B>setFilter</B>(<A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> filter)</PRE><DL><DD>Sets the filter to constrain the query.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>filter</CODE> - the OGC filter to limit the datasource getFeatures request.</DL></DD></DL><HR><A NAME="getTypeName()"><!-- --></A><H3>getTypeName</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getTypeName</B>()</PRE><DL><DD>The typeName attribute is used to indicate the name of the feature type to be queried. <p> The DataStore API does not assume one feature type per datastore. It currently makes use of this field to to specify with each request what type to get. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#getTypeName()">getTypeName</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the name of the feature type to be returned with this query.</DL></DD></DL><HR><A NAME="getNamespace()"><!-- --></A><H3>getNamespace</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html" title="class or interface in java.net">URI</A> <B>getNamespace</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></B></DD><DD>The namespace attribute is used to indicate the namespace of the schema being represented.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#getNamespace()">getNamespace</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the gml namespace of the feature type to be returned with this query</DL></DD></DL><HR><A NAME="setTypeName(java.lang.String)"><!-- --></A><H3>setTypeName</H3><PRE>public void <B>setTypeName</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName)</PRE><DL><DD>Sets the typename.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - the name of the featureType to retrieve.</DL></DD></DL><HR><A NAME="getHandle()"><!-- --></A><H3>getHandle</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getHandle</B>()</PRE><DL><DD>The handle attribute is included to allow a client to associate a mnemonic name to the Query request. The purpose of the handle attribute is to provide an error handling mechanism for locating a statement that might fail.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/Query.html#getHandle()">getHandle</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the mnemonic name of the query request.</DL></DD></DL><HR><A NAME="setHandle(java.lang.String)"><!-- --></A><H3>setHandle</H3><PRE>public void <B>setHandle</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> handle)</PRE><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -