com.threerings.antidote.field.text
Class TextField

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.threerings.antidote.field.BaseComponent
              extended by com.threerings.antidote.field.BaseField
                  extended by com.threerings.antidote.field.text.TextField
All Implemented Interfaces:
Field, ReferenceField, RequiresValidation, Cloneable
Direct Known Subclasses:
Description, SingleLineTextField

public abstract class TextField
extends BaseField

An Ant Field which allows text input in the form <field>Text here</field>.


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
TextField()
           
 
Method Summary
 void addText(String text)
          Ant adder field: grabs the text between any two <field></field> elements.
protected  String getText()
          Returns the text supplied to the field.
protected  void scrubTextWhitespace()
          Provide concrete classes a convenience method to scrub whitespace from the text field.
protected  TextStatus validateTextNotEmpty()
          Provide concrete classes a method to validate that the text field was set and not blank.
protected  TextStatus validateTextWasSet()
          Provide concrete classes a method to validate that the text field was set.
 
Methods inherited from class com.threerings.antidote.field.BaseField
execute, init, reconfigure, setRefid
 
Methods inherited from class com.threerings.antidote.field.BaseComponent
appendViolation, appendViolationList, getReferencedField, isReference, registerField, reportConflictingProperties, reportUnsetDependentFields, reportUnsetDependentProperties, reportUnsetField, setReference, validate, validateChildFields, validateChildFields, validateField, validateOptionalProperties, validateProperties, validateProperties
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.antidote.field.Field
getFieldName, getLocation
 

Constructor Detail

TextField

public TextField()
Method Detail

addText

public void addText(String text)
Ant adder field: grabs the text between any two <field></field> elements.


getText

protected String getText()
Returns the text supplied to the field.


validateTextWasSet

protected TextStatus validateTextWasSet()
Provide concrete classes a method to validate that the text field was set. A violation will be appended to the field if the text is not set.

Returns:
the TextStatus status of the text.

validateTextNotEmpty

protected TextStatus validateTextNotEmpty()
Provide concrete classes a method to validate that the text field was set and not blank. The text data will first have any newline or tab characters removed before it is checked e.g. a field filled with only tabs and newlines will be considered empty. A violation will be appended to the field if the text is not set and blank.

Returns:
the TextStatus status of the text.

scrubTextWhitespace

protected void scrubTextWhitespace()
Provide concrete classes a convenience method to scrub whitespace from the text field.



Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.