Package com.tietoenator.trip.jxp.data
Class TdbTextField
java.lang.Object
com.tietoenator.trip.jxp.data.TdbField
com.tietoenator.trip.jxp.data.TdbTextField
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
Container and manipulation logic for a TExt field
-
Constructor Summary
ConstructorsConstructorDescriptionTdbTextField
(TdbFieldTemplate tmpl) Constructor, creates a blank instance based on the template providedTdbTextField
(String name) Constructor, creates a blank instance based on the name provided -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendText
(String val) Text-specific function to append to the current value of a text field.void
appendValue
(String val) Append the provided paragraph text to the field's value
This method cannot be used after any calls have been made to setText() or appendText() as the field is no longer defined in terms of paragraphs at that point.void
appendValues
(Collection<String> values) Append several paragraphs to this text field.void
clear()
Clear any existing state the field might haveint
Retrieve the size of the value in the field.getText()
Get the complete content of the field.Provides access to an object that allows control and enabling of text extraction operations on this TExt field.getType()
Retrieve the field typegetValue
(int index) Retrieve the value of the n'th paragraph.int
Retrieve the number of paragraphs in the field.void
insertValue
(int index, String value) Inserts a new paragraph into the field.void
insertValues
(int index, Collection<String> values) Inserts several new paragraphs into the field.boolean
Returns the change status for the field.boolean
Returns true if this TdbTextField contains a value produced by an output format and thereby doesn't correspond to an actual database field.boolean
Returns true if this TdbTextField contains a partial value.Retrieve the display form of the field, with the paragraphs being elements within the collection returned.void
removeValue
(int index) Removes a paragraph from the field.void
Text-specific function to set the initial value of a text field to that provided.void
Set the value of a specific paragraph to that provided.toString()
Retrieves a two newline-delimited string representation of the display content of the fieldvalues()
Retrieve the current content of the field -- refer to TdbField.Values for more detail.Methods inherited from class com.tietoenator.trip.jxp.data.TdbField
getName, getOwnerComponent
-
Constructor Details
-
TdbTextField
Constructor, creates a blank instance based on the template provided- Parameters:
tmpl
- Field template
-
TdbTextField
Constructor, creates a blank instance based on the name provided- Parameters:
name
- Name of field
-
-
Method Details
-
isFormatted
public boolean isFormatted()Returns true if this TdbTextField contains a value produced by an output format and thereby doesn't correspond to an actual database field.- Returns:
- True if the value is generated by an output format.
-
isPartial
public boolean isPartial()Returns true if this TdbTextField contains a partial value.- Specified by:
isPartial
in classTdbField
- Returns:
- True if the value is partial
Partial values are typically produced when requesting a hit-focused so-called "teaser" value, e.g. for display in result lists.
Partial values should be considered read-only, even if the current user has write access to the field. Writing back a partial value will overwrite the existing full value, causing what amounts to data corruption.
-
isChanged
public boolean isChanged()Returns the change status for the field. -
originalValues
Retrieve the display form of the field, with the paragraphs being elements within the collection returned.- Specified by:
originalValues
in classTdbField
- Returns:
- Collection of field display values
-
values
Retrieve the current content of the field -- refer to TdbField.Values for more detail. If the field has been modified using setText() or appendText() this property retrieves an array collection a single item, that item being the current value of the field. If those methods have not been used, the array retrieved holds a value for each paragraph in the field. -
getText
Get the complete content of the field.
If the field has just been retrieved from the server, and is therefore divided neatly into paragraph values, this property uses default paragraph separation rules to contruct the text (i.e. two newline equivalents). This may or may not match the database rules in question, and so care should be exercised by calling applications.- Returns:
- The value of the complete field
-
getType
Retrieve the field type -
getTextExtractionInfo
Provides access to an object that allows control and enabling of text extraction operations on this TExt field. -
clear
public void clear()Clear any existing state the field might have -
getFieldSize
public int getFieldSize()Retrieve the size of the value in the field.- Specified by:
getFieldSize
in classTdbField
- Returns:
- Total size of the contents of the field.
- See Also:
-
getValue
Retrieve the value of the n'th paragraph.
Note that if the field has been updated using the setText() or AppendText() methods, there is no concept of paragraph break maintained on the client, therefore any setting of index will result in the same string being returned, i.e. the entire text content of the field. This method really only has value, therefore, immediately after retrieving a record from the server.- Specified by:
getValue
in classTdbField
- Parameters:
index
- The index of the paragraph to retrieve- Returns:
- The value of the paragraph, or the value of the entire field if the field has been modified using the setText() or appendText() methods.
- Throws:
TdbException
-
setValue
Set the value of a specific paragraph to that provided.
This method provides a structured means of updating a text field's current content. This is only valid before any call is made to either setText() or appendText, after which the field's value is not defined in terms of paragraphs.- Specified by:
setValue
in classTdbField
- Parameters:
index
- The offset of the paragraph to updateval
- The value to establish as the paragraph's value- Throws:
TdbException
-
appendValue
Append the provided paragraph text to the field's value
This method cannot be used after any calls have been made to setText() or appendText() as the field is no longer defined in terms of paragraphs at that point.- Specified by:
appendValue
in classTdbField
- Parameters:
val
- The paragraph value to append to the field- Throws:
TdbException
-
appendValues
Append several paragraphs to this text field.
This method cannot be used after any calls have been made to setText() or appendText() as the field is no longer defined in terms of paragraphs at that point.- Specified by:
appendValues
in classTdbField
- Parameters:
values
- The paragraph values to append to the field- Throws:
TdbException
-
getValueCount
Retrieve the number of paragraphs in the field.
If the field has been modified using setText() or appendText(), this method always returns 1, since in that case the field holds a single value and is no longer defined in terms of paragraphs. If those methods have not been used, this method returns a count of paragraphs.- Specified by:
getValueCount
in classTdbField
- Returns:
- Paragraph count
- Throws:
TdbException
-
insertValue
Inserts a new paragraph into the field.- Specified by:
insertValue
in classTdbField
- Parameters:
index
- Zero-based index at which to insert the new paragraph.value
- The value to insert into the field.- Throws:
TdbException
-
insertValues
Inserts several new paragraphs into the field.- Specified by:
insertValues
in classTdbField
- Parameters:
index
- Zero-based index at which to insert the new paragraphs.values
- The values to insert into the field.- Throws:
TdbException
-
removeValue
Removes a paragraph from the field.
This method cannot be used after any calls have been made to setText() or appendText() as the field is no longer defined in terms of paragraphs at that point.- Specified by:
removeValue
in classTdbField
- Parameters:
index
- Zero-based index of paragraph to remove.- Throws:
TdbException
-
setText
Text-specific function to set the initial value of a text field to that provided.
Text fields do not lend themselves to simple manipulation by value offset. Using this method and the appendText() method, however, applications can simply store the whole value of a text field without needing to worry about paragraph boundaries in any specific manner. The text as provided (complete with line breaks, etc.) is stored "as is" and is only ever parsed for lexical structure by the server, using the rules established in the database design. Applications can therefore provide the entire content of the field using a single call to this method, or could choose to provide field content in arbitrary chunks using both this method and appendText()- Parameters:
val
- The value the field should initially take
-
appendText
Text-specific function to append to the current value of a text field.
Text fields do not lend themselves to simple manipulation by value offset. Using this method and the setText() method, however, applications can simply store the whole value of a text field without needing to worry about paragraph boundaries in any specific manner. The text as provided (complete with line breaks, etc.) is appended "as is" and is only ever parsed for lexical structure by the server, using the rules established in the database design. Applications can therefore provide the entire content of the field using a single call to setText(), or can choose to provide field content in arbitrary chunks using both setText() and this method. Calling applications must use care when calling this method, ensuring that line breaks are provided where needed, as the string provided here is appended immediately to the end of whatever text has previously been provided. No intermediate white space is infered by this method itself.- Parameters:
val
- The value to append to the field's current value
-
toString
Retrieves a two newline-delimited string representation of the display content of the field
-