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

📄 field.html

📁 turbine教程
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="init(org.apache.turbine.util.RunData)"><!-- --></A><H3>init</H3><PRE>public <A HREF="../../../../../../org/apache/turbine/services/intake/model/Field.html">Field</A> <B>init</B>(<A HREF="../../../../../../org/apache/turbine/util/RunData.html">RunData</A>&nbsp;data)           throws <A HREF="../../../../../../org/apache/turbine/util/TurbineException.html">TurbineException</A></PRE><DL><DD>Method called when this field (the group it belongs to) is pulled from the pool.  The request data is searched to determine if a value has been supplied for this field.  if so, the value is validated.<DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - a <code>RunData</code> value<DT><B>Returns:</B><DD>a <code>Field</code> value<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../../org/apache/turbine/util/TurbineException.html">TurbineException</A></CODE> - if an error occurs</DL></DD></DL><HR><A NAME="init(org.apache.turbine.om.Retrievable)"><!-- --></A><H3>init</H3><PRE>public <A HREF="../../../../../../org/apache/turbine/services/intake/model/Field.html">Field</A> <B>init</B>(<A HREF="../../../../../../org/apache/turbine/om/Retrievable.html">Retrievable</A>&nbsp;obj)</PRE><DL><DD>Method called when this field or the group it belongs to is pulled from the pool.  The retrievable object can provide a default value for the field, or using setProperty the field's value can be transferred to the retrievable.<DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - a <code>Retrievable</code> value<DT><B>Returns:</B><DD>a <code>Field</code> value</DL></DD></DL><HR><A NAME="getDefaultValidator()"><!-- --></A><H3>getDefaultValidator</H3><PRE>protected java.lang.String <B>getDefaultValidator</B>()</PRE><DL></DL><HR><A NAME="getValidator()"><!-- --></A><H3>getValidator</H3><PRE>public <A HREF="../../../../../../org/apache/turbine/services/intake/validator/Validator.html">Validator</A> <B>getValidator</B>()</PRE><DL></DL><HR><A NAME="isRequired()"><!-- --></A><H3>isRequired</H3><PRE>public boolean <B>isRequired</B>()</PRE><DL><DD>Flag to determine whether the field has been declared as required.<DD><DL><DT><B>Returns:</B><DD>value of required.</DL></DD></DL><HR><A NAME="setRequired(boolean)"><!-- --></A><H3>setRequired</H3><PRE>public void <B>setRequired</B>(boolean&nbsp;v)</PRE><DL><DD>Set whether this field is required to have a value.<DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - Value to assign to required.</DL></DD></DL><HR><A NAME="setRequired(boolean, java.lang.String)"><!-- --></A><H3>setRequired</H3><PRE>public void <B>setRequired</B>(boolean&nbsp;v,                        java.lang.String&nbsp;message)</PRE><DL><DD>Set the value of required.<DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>boolean</code> value<DD><CODE>message,</CODE> - override the value from intake.xml</DL></DD></DL><HR><A NAME="removeFromRequest()"><!-- --></A><H3>removeFromRequest</H3><PRE>public void <B>removeFromRequest</B>()</PRE><DL><DD>Removes references to this group and its fields from the query parameters</DL><HR><A NAME="dispose()"><!-- --></A><H3>dispose</H3><PRE>public void <B>dispose</B>()</PRE><DL><DD>Disposes the object after use. The method is called when the Group is returned to its pool. if overridden, super.dispose() should be called.</DL><HR><A NAME="getKey()"><!-- --></A><H3>getKey</H3><PRE>public java.lang.String <B>getKey</B>()</PRE><DL><DD>Get the key used to identify the field.<DD><DL><DT><B>Returns:</B><DD>the query data key.</DL></DD></DL><HR><A NAME="getValueIfAbsent()"><!-- --></A><H3>getValueIfAbsent</H3><PRE>public java.lang.String <B>getValueIfAbsent</B>()</PRE><DL><DD>Use in a hidden field assign a default value in the event the field is absent from the query parameters.  Used to track checkboxes, since they only show up if checked.</DL><HR><A NAME="isValid()"><!-- --></A><H3>isValid</H3><PRE>public boolean <B>isValid</B>()</PRE><DL><DD>Flag set to true, if the test value met the constraints. Is also true, in the case the test value was not set, unless this field has been marked as required.<DD><DL><DT><B>Returns:</B><DD>a <code>boolean</code> value</DL></DD></DL><HR><A NAME="isSet()"><!-- --></A><H3>isSet</H3><PRE>public boolean <B>isSet</B>()</PRE><DL><DD>Flag set to true, if the test value has been set to anything other than an empty value.<DD><DL><DT><B>Returns:</B><DD>a <code>boolean</code> value</DL></DD></DL><HR><A NAME="getDisplayName()"><!-- --></A><H3>getDisplayName</H3><PRE>public java.lang.String <B>getDisplayName</B>()</PRE><DL><DD>Get the display name of the field. Useful for building data entry forms. Returns name of field if no display name has been assigned to the field by xml input file<DD><DL><DT><B>Returns:</B><DD>a <code>String</code> value</DL></DD></DL><HR><A NAME="setDisplayName(java.lang.String)"><!-- --></A><H3>setDisplayName</H3><PRE>public void <B>setDisplayName</B>(java.lang.String&nbsp;newDisplayName)</PRE><DL><DD>Set the display name of the field. Display names are used in building data entry forms and serve as a user friendly description of the data contained in the field.</DL><HR><A NAME="getMessage()"><!-- --></A><H3>getMessage</H3><PRE>public java.lang.String <B>getMessage</B>()</PRE><DL><DD>Get any error message resulting from invalid input.<DD><DL><DT><B>Returns:</B><DD>a <code>String</code> value</DL></DD></DL><HR><A NAME="setMessage(java.lang.String)"><!-- --></A><H3>setMessage</H3><PRE>public void <B>setMessage</B>(java.lang.String&nbsp;message)</PRE><DL><DD>Sets an error message.  The field is also marked as invalid.</DL><HR><A NAME="validate(org.apache.turbine.util.ParameterParser)"><!-- --></A><H3>validate</H3><PRE>protected boolean <B>validate</B>(<A HREF="../../../../../../org/apache/turbine/util/ParameterParser.html">ParameterParser</A>&nbsp;pp)</PRE><DL><DD>Compares request data with constraints and sets the valid flag.</DL><HR><A NAME="doSetValue(org.apache.turbine.util.ParameterParser)"><!-- --></A><H3>doSetValue</H3><PRE>protected abstract void <B>doSetValue</B>(<A HREF="../../../../../../org/apache/turbine/util/ParameterParser.html">ParameterParser</A>&nbsp;pp)</PRE><DL><DD>Compares request data with constraints and sets the valid flag. To be implemented in subclasses</DL><HR><A NAME="setDefaultValue(java.lang.String)"><!-- --></A><H3>setDefaultValue</H3><PRE>protected abstract void <B>setDefaultValue</B>(java.lang.String&nbsp;prop)</PRE><DL><DD>Set the default Value</DL><HR><A NAME="getInitialValue()"><!-- --></A><H3>getInitialValue</H3><PRE>public java.lang.Object <B>getInitialValue</B>()                                 throws java.lang.Exception</PRE><DL><DD>Get the value used as a default.  If the initial value has not been set and a <code>Retrievable</code> object has been associated with this field, the objects property will be used as the initial value.<DD><DL><DT><B>Returns:</B><DD>an <code>Object</code> value<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an error occurs</DL></DD></DL><HR><A NAME="getTestValue()"><!-- --></A><H3>getTestValue</H3><PRE>public java.lang.Object <B>getTestValue</B>()</PRE><DL><DD>Get the value input by a user that will be validated.<DD><DL><DT><B>Returns:</B><DD>an <code>Object</code> value</DL></DD></DL><HR><A NAME="getValue()"><!-- --></A><H3>getValue</H3><PRE>public java.lang.Object <B>getValue</B>()</PRE><DL><DD>Get the value of the field.  if a test value has been set, it will be returned as is, unless it is so badly formed that the validation could not parse it.  In most cases the test value is returned even though invalid, so that it can be returned to the user to make modifications.  if the test value is not set the initial value is returned.<DD><DL><DT><B>Returns:</B><DD>an <code>Object</code> value</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String.<DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> value</DL></DD></DL><HR><A NAME="getProperty(java.lang.Object)"><!-- --></A><H3>getProperty</H3><PRE>public void <B>getProperty</B>(java.lang.Object&nbsp;obj)                 throws java.lang.Exception</PRE><DL><DD>Loads the valid value from a bean</DL><HR><A NAME="getDefault()"><!-- --></A><H3>getDefault</H3><PRE>public void <B>getDefault</B>()</PRE><DL><DD>Loads the default value from the object</DL><HR><A NAME="setProperty(java.lang.Object)"><!-- --></A><H3>setProperty</H3><PRE>public void <B>setProperty</B>(java.lang.Object&nbsp;obj)                 throws <A HREF="../../../../../../org/apache/turbine/util/TurbineException.html">TurbineException</A></PRE><DL><DD>Calls a setter method on obj, if this field has been set.<DD><DL><DT><B>Throws:</B><DD><CODE>throws</CODE> - a TurbineException if called and the input was not valid.</DL></DD></DL><HR><A NAME="getDefaultValue()"><!-- --></A><H3>getDefaultValue</H3><PRE>public java.lang.Object <B>getDefaultValue</B>()</PRE><DL><DD>Get the default Value</DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Field.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../../org/apache/turbine/services/intake/model/DateStringField.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../../../org/apache/turbine/services/intake/model/FieldFactory.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Field.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR>Copyright &copy; 2000-2002 Apache Software Foundation. All Rights Reserved.</BODY></HTML>

⌨️ 快捷键说明

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