com.threerings.antidote.field.text
Class TextField
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.threerings.antidote.field.BaseComponent
com.threerings.antidote.field.BaseField
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>.
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.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 |
TextField
public TextField()
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.