Java Doc for Field.java in  » Web-Framework » TURBINE » org » apache » turbine » services » intake » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » TURBINE » org.apache.turbine.services.intake.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.turbine.services.intake.model.Field

All known Subclasses:   org.apache.turbine.services.intake.model.ShortField,  org.apache.turbine.services.intake.model.ComboKeyField,  org.apache.turbine.services.intake.model.IntegerField,  org.apache.turbine.services.intake.model.FileItemField,  org.apache.turbine.services.intake.model.DateStringField,  org.apache.turbine.services.intake.model.LongField,  org.apache.turbine.services.intake.model.StringField,  org.apache.turbine.services.intake.model.BooleanField,  org.apache.turbine.services.intake.model.StringKeyField,  org.apache.turbine.services.intake.model.AbstractNumberField,
Field
abstract public class Field (Code)
Base class for Intake generated input processing classes.
author:
   John McNally
author:
   Henning P. Schmiedehausen
author:
   Quinton McCombs
author:
   Jürgen Hoffmann
author:
   Thomas Vandahl
version:
   $Id: Field.java 538811 2007-05-17 05:55:42Z seade $


Field Summary
protected  booleanalwaysRequired
    
final public static  StringdefaultFieldPackage
    
final public static  StringdefaultValidatorPackage
    
protected  ObjectdefaultValue
    
protected  StringdisplayName
     Display name of the field to be used on data entry forms...
protected  ObjectemptyValue
    
final protected  Methodgetter
    
final protected  Groupgroup
    
protected  StringifRequiredMessage
    
protected  booleaninitialized
    
protected  booleanisDebugEnabled
    
final protected  booleanisMultiValued
    
final protected  Stringkey
    
protected  Loglog
    
final protected  StringmapToObject
    
protected  Stringmessage
    
final protected  Stringname
     Name of the field.
protected  ObjectonError
    
protected  ValueParserparser
     The object containing the field data.
protected  booleanrequired
    
protected  Retrievableretrievable
    
protected  booleansetFlag
    
final protected  Methodsetter
    
protected  booleanvalidFlag
    
protected  booleanvalidated
    
protected  Validatorvalidator
    

Constructor Summary
public  Field(XmlField field, Group group)
     Constructs a field based on data in the xml specification and assigns it to a Group.

Method Summary
public  voiddispose()
     Disposes the object after use.
protected  voiddoSetValue(ValueParser pp)
    
abstract protected  voiddoSetValue()
     Sets the value of the field from data in the parser.
public  voidgetDefault()
    
protected  StringgetDefaultValidator()
     Produces the fully qualified class name of the default validator.
public  ObjectgetDefaultValue()
    
public  StringgetDisplayName()
     Get the display name of the field.
public  StringgetDisplaySize()
     Gets the diplay size of the field.
public  ObjectgetEmptyValue()
    
public  GroupgetGroup()
     Returns the Group this field belongs to or null if unknown.
public  StringgetHTMLString()
     Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String.
public  ObjectgetInitialValue()
     Get the value used as a default.
public  StringgetKey()
     Get the key used to identify the field.
public  LocalegetLocale()
     Returns the Locale used when localizing data for this field, or null if unknown.
public  StringgetMaxSize()
     Gets the maximum size of the field.
public  StringgetMessage()
     Get any error message resulting from invalid input.
public  StringgetName()
     Gets the name of the field.
public  voidgetProperty(Object obj)
    
protected  ObjectgetSafeEmptyValue()
     Provides access to emptyValue such that the value returned will be acceptable as an argument parameter to Method.invoke.
public  StringgetStringValue()
     Gets the String representation of the Value.
public  ObjectgetTestValue()
     Get the value input by a user that will be validated.
public  ValidatorgetValidator()
     Gets the Validator object for this field.
public  ObjectgetValue()
     Get the value of the field.
public  StringgetValueIfAbsent()
     Use in a hidden field assign a default value in the event the field is absent from the query parameters.
public  Fieldinit(ValueParser pp)
     Method called when this field (the group it belongs to) is pulled from the pool.
public  Fieldinit(Retrievable obj)
     Method called when this field or the group it belongs to is pulled from the pool.
public  booleanisMultiValued()
     Flag to determine whether the field has been declared as multi-valued.
public  booleanisRequired()
     Flag to determine whether the field has been declared as required.
public  booleanisSet()
     Flag set to true, if the test value has been set by the parser (even to an empty value, so don't used this to determine if the field contains a non-empty value).
public  booleanisValid()
     Flag set to true, if the test value met the constraints.
public  booleanisValidated()
     Flag to determine whether the field has been validated.
public  voidremoveFromRequest()
    
abstract public  voidsetDefaultValue(String prop)
     Set the default Value.
public  voidsetDisplayName(String newDisplayName)
     Set the display name of the field.
abstract public  voidsetEmptyValue(String prop)
     Set the empty Value.
 voidsetInitialValue(Object obj)
     Set the value used as a default, in the event the field has not been set yet.
public  voidsetMessage(String message)
     Sets an error message.
public  voidsetProperty(Object obj)
     Calls a setter method on obj, if this field has been set.
public  voidsetRequired(boolean v)
     Set whether this field is required to have a value.
public  voidsetRequired(boolean v, String message)
     Set the value of required.
 voidsetTestValue(Object obj)
     Set the value input by a user that will be validated.
public  StringtoString()
     Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String.
protected  booleanvalidate(ValueParser pp)
    
public  booleanvalidate()
     Compares request data with constraints and sets the valid flag.

Field Detail
alwaysRequired
protected boolean alwaysRequired(Code)
Is this field always required? This is only set through the XML file



defaultFieldPackage
final public static String defaultFieldPackage(Code)
Default Field Package



defaultValidatorPackage
final public static String defaultValidatorPackage(Code)
Default Validator Package



defaultValue
protected Object defaultValue(Code)
Default value of the field



displayName
protected String displayName(Code)
Display name of the field to be used on data entry forms...



emptyValue
protected Object emptyValue(Code)
Value of the field to use if the mapped parameter is empty or non-existant



getter
final protected Method getter(Code)
Getter method in the mapped object used to populate the field



group
final protected Group group(Code)
Group to which the field belongs



ifRequiredMessage
protected String ifRequiredMessage(Code)
Error message set on the field if required and not set by parser



initialized
protected boolean initialized(Code)
Has the field has been set from the parser?



isDebugEnabled
protected boolean isDebugEnabled(Code)



isMultiValued
final protected boolean isMultiValued(Code)
Does this field accept multiple values?



key
final protected String key(Code)
Key used to identify the field in the parser



log
protected Log log(Code)
Logging



mapToObject
final protected String mapToObject(Code)
Class name of the object to which the field is mapped



message
protected String message(Code)
Error message, is any, resulting from validation



name
final protected String name(Code)
Name of the field.



onError
protected Object onError(Code)
Value of the field if an error occurs while getting the value from the mapped object



parser
protected ValueParser parser(Code)
The object containing the field data.



required
protected boolean required(Code)
Does the field require a value?



retrievable
protected Retrievable retrievable(Code)
Mapped object used to set the initial field value



setFlag
protected boolean setFlag(Code)
Has the field has been set from the parser?



setter
final protected Method setter(Code)
Setter method in the mapped object used to store the value of field



validFlag
protected boolean validFlag(Code)
Has the field passed the validation test?



validated
protected boolean validated(Code)
Has the field been validated?



validator
protected Validator validator(Code)
Used to validate the contents of the field




Constructor Detail
Field
public Field(XmlField field, Group group) throws IntakeException(Code)
Constructs a field based on data in the xml specification and assigns it to a Group.
Parameters:
  field - a XmlField value
Parameters:
  group - a Group value
throws:
  IntakeException - indicates the validator was not valid orcould not be loaded.
throws:
  SystemError - only occurs is the Validation object does notextend InitableByConstraintMap




Method Detail
dispose
public void dispose()(Code)
Disposes the object after use. The method is called when the Group is returned to its pool. if overridden, super.dispose() should be called.



doSetValue
protected void doSetValue(ValueParser pp)(Code)



doSetValue
abstract protected void doSetValue()(Code)
Sets the value of the field from data in the parser.



getDefault
public void getDefault()(Code)
Loads the default value from the object



getDefaultValidator
protected String getDefaultValidator()(Code)
Produces the fully qualified class name of the default validator. class name of the default validator



getDefaultValue
public Object getDefaultValue()(Code)
Get the default Value the default value



getDisplayName
public String getDisplayName()(Code)
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. a String value



getDisplaySize
public String getDisplaySize()(Code)
Gets the diplay size of the field. This is useful when building the HTML input tag. If no displaySize was set, an empty string is returned.



getEmptyValue
public Object getEmptyValue()(Code)
Get the Value to use if the field is empty the value to use if the field is empty.



getGroup
public Group getGroup()(Code)
Returns the Group this field belongs to or null if unknown. The group this field belongs to.



getHTMLString
public String getHTMLString()(Code)
Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String. Escapes " characters to be able to display these in HTML form fields. a String value



getInitialValue
public Object getInitialValue() throws IntakeException(Code)
Get the value used as a default. If the initial value has not been set and a Retrievable object has been associated with this field, the objects property will be used as the initial value. an Object value
exception:
  IntakeException - indicates the value could not bereturned from the mapped object



getKey
public String getKey()(Code)
Get the key used to identify the field. the query data key.



getLocale
public Locale getLocale()(Code)
Returns the Locale used when localizing data for this field, or null if unknown. Where to localize for.



getMaxSize
public String getMaxSize()(Code)
Gets the maximum size of the field. This is useful when building the HTML input tag. The maxSize is set with the maxLength rule. If this rul was not set, an enmpty string is returned.



getMessage
public String getMessage()(Code)
Get any error message resulting from invalid input. a String value



getName
public String getName()(Code)
Gets the name of the field. name of the field as specified in the XML file.



getProperty
public void getProperty(Object obj) throws IntakeException(Code)
Loads the valid value from a bean
throws:
  IntakeException - indicates a problem during the execution of theobject's getter method



getSafeEmptyValue
protected Object getSafeEmptyValue()(Code)
Provides access to emptyValue such that the value returned will be acceptable as an argument parameter to Method.invoke. Subclasses that deal with primitive types should ensure that they return an appropriate value wrapped in the object wrapper class for the primitive type. the value to use when the field is empty or an Object thatwraps the empty value for primitive types.



getStringValue
public String getStringValue()(Code)
Gets the String representation of the Value. This is basically a wrapper method for the toString method which doesn't seem to show anything on screen if accessed from Template. Name is also more in line with getValue method which returns the actual Object. This is useful for displaying correctly formatted data such as dates, such as 18/11/1968 instead of the toString dump of a Date Object. the String Value



getTestValue
public Object getTestValue()(Code)
Get the value input by a user that will be validated. an Object value



getValidator
public Validator getValidator()(Code)
Gets the Validator object for this field. a Validator object



getValue
public Object getValue()(Code)
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. an Object value



getValueIfAbsent
public String getValueIfAbsent()(Code)
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.



init
public Field init(ValueParser pp) throws IntakeException(Code)
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.
Parameters:
  pp - a ValueParser value a Field value
throws:
  IntakeException - this exception is only thrown by subclassesoverriding this implementation.



init
public Field init(Retrievable obj)(Code)
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.
Parameters:
  obj - a Retrievable value a Field value



isMultiValued
public boolean isMultiValued()(Code)
Flag to determine whether the field has been declared as multi-valued. value of isMultiValued.



isRequired
public boolean isRequired()(Code)
Flag to determine whether the field has been declared as required. value of required.



isSet
public boolean isSet()(Code)
Flag set to true, if the test value has been set by the parser (even to an empty value, so don't used this to determine if the field contains a non-empty value). Validation will only be executed for fields that have been set in this manner. a boolean value



isValid
public boolean isValid()(Code)
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. a boolean value



isValidated
public boolean isValidated()(Code)
Flag to determine whether the field has been validated. value of validated.



removeFromRequest
public void removeFromRequest()(Code)
Removes references to this group and its fields from the query parameters



setDefaultValue
abstract public void setDefaultValue(String prop)(Code)
Set the default Value. This value is used if Intake should map this field to a new object.
Parameters:
  prop - The value to use if the field is mapped to a new object.



setDisplayName
public void setDisplayName(String newDisplayName)(Code)
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.



setEmptyValue
abstract public void setEmptyValue(String prop)(Code)
Set the empty Value. This value is used if Intake maps a field to a parameter returned by the user and the corresponding field is either empty (empty string) or non-existant.
Parameters:
  prop - The value to use if the field is empty.



setInitialValue
void setInitialValue(Object obj)(Code)
Set the value used as a default, in the event the field has not been set yet.
Parameters:
  obj - an Object value



setMessage
public void setMessage(String message)(Code)
Sets an error message. The field is also marked as invalid.



setProperty
public void setProperty(Object obj) throws IntakeException(Code)
Calls a setter method on obj, if this field has been set.
throws:
  IntakeException - indicates a problem during the execution of theobject's setter method



setRequired
public void setRequired(boolean v)(Code)
Set whether this field is required to have a value. If the field is already required due to a setting in the XML file, this method can not set it to false.
Parameters:
  v - Value to assign to required.



setRequired
public void setRequired(boolean v, String message)(Code)
Set the value of required.
Parameters:
  v - a boolean value
Parameters:
  message - override the value from intake.xml



setTestValue
void setTestValue(Object obj)(Code)
Set the value input by a user that will be validated.
Parameters:
  obj - an Object value



toString
public String toString()(Code)
Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String. a String value



validate
protected boolean validate(ValueParser pp)(Code)



validate
public boolean validate()(Code)
Compares request data with constraints and sets the valid flag.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.