org.apache.turbine.services.intake.model
Class FileItemField

java.lang.Object
  extended byorg.apache.turbine.services.intake.model.Field
      extended byorg.apache.turbine.services.intake.model.FileItemField

public class FileItemField
extends Field

This Intake field is intended to represent a File input element in a HTML form.

Version:
$Id: FileItemField.java 537514 2007-05-12 20:55:26Z tv $
Author:
John McNally, Henning P. Schmiedehausen, Quinton McCombs

Field Summary
 
Fields inherited from class org.apache.turbine.services.intake.model.Field
alwaysRequired, defaultFieldPackage, defaultValidatorPackage, defaultValue, displayName, emptyValue, getter, group, ifRequiredMessage, initialized, isDebugEnabled, isMultiValued, key, log, mapToObject, message, name, onError, parser, required, retrievable, setFlag, setter, validated, validator, validFlag
 
Constructor Summary
FileItemField(XmlField field, Group group)
          Constructor.
 
Method Summary
protected  void doSetValue()
          Sets the value of the field from data in the parser.
protected  java.lang.String getDefaultValidator()
          A suitable validator.
 Field init(ValueParser vp)
          Method called when this field (the group it belongs to) is pulled from the pool.
 void setDefaultValue(java.lang.String prop)
          It is not possible to set the default value for this field type.
 void setEmptyValue(java.lang.String prop)
          It is not possible to set the empty value for this field type.
 boolean validate()
          Compares request data with constraints and sets the valid flag.
 
Methods inherited from class org.apache.turbine.services.intake.model.Field
dispose, doSetValue, getDefault, getDefaultValue, getDisplayName, getDisplaySize, getEmptyValue, getGroup, getHTMLString, getInitialValue, getKey, getLocale, getMaxSize, getMessage, getName, getProperty, getSafeEmptyValue, getStringValue, getTestValue, getValidator, getValue, getValueIfAbsent, init, isMultiValued, isRequired, isSet, isValid, isValidated, removeFromRequest, setDisplayName, setMessage, setProperty, setRequired, setRequired, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileItemField

public FileItemField(XmlField field,
                     Group group)
              throws IntakeException
Constructor.

Parameters:
field - xml field definition object
group - xml group definition object
Throws:
IntakeException - thrown by superclass
Method Detail

setDefaultValue

public void setDefaultValue(java.lang.String prop)
It is not possible to set the default value for this field type. Calling this method with a non-null parameter will result in a TurbineRuntimeException

Specified by:
setDefaultValue in class Field
Parameters:
prop - Parameter for the default values
Throws:
TurbineRuntimeException

setEmptyValue

public void setEmptyValue(java.lang.String prop)
It is not possible to set the empty value for this field type. Calling this method with a non-null parameter will result in a TurbineRuntimeException

Specified by:
setEmptyValue in class Field
Parameters:
prop - Parameter for the empty values
Throws:
TurbineRuntimeException

getDefaultValidator

protected java.lang.String getDefaultValidator()
A suitable validator.

Overrides:
getDefaultValidator in class Field
Returns:
A suitable validator

init

public Field init(ValueParser vp)
           throws IntakeException
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.

Overrides:
init in class Field
Parameters:
vp - a ValueParser value
Returns:
a Field value
Throws:
IntakeException - if an error occurs

validate

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

Overrides:
validate in class Field
Returns:
the valid flag

doSetValue

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

Specified by:
doSetValue in class Field


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.