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

public class TdbTextField extends TdbField
Container and manipulation logic for a TExt field
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor, creates a blank instance based on the template provided
    Constructor, creates a blank instance based on the name provided
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Text-specific function to append to the current value of a text field.
    void
    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
    Append several paragraphs to this text field.
    void
    Clear any existing state the field might have
    int
    Retrieve the size of the value in the field.
    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.
    Retrieve the field type
    getValue(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
    setValue(int index, String val)
    Set the value of a specific paragraph to that provided.
    Retrieves a two newline-delimited string representation of the display content of the field
    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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TdbTextField

      public TdbTextField(TdbFieldTemplate tmpl)
      Constructor, creates a blank instance based on the template provided
      Parameters:
      tmpl - Field template
    • TdbTextField

      public TdbTextField(String name)
      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 class TdbField
      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.
      Overrides:
      isChanged in class TdbField
      Returns:
      True if the field has uncommitted changes, otherwise false.
      Since:
      8.0-4
    • originalValues

      public List<String> originalValues()
      Retrieve the display form of the field, with the paragraphs being elements within the collection returned.
      Specified by:
      originalValues in class TdbField
      Returns:
      Collection of field display values
    • values

      public List<String> 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.
      Specified by:
      values in class TdbField
      Returns:
      Collection of field values
      See Also:
    • getText

      public String 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

      public TdbFieldType getType()
      Retrieve the field type
      Specified by:
      getType in class TdbField
      Returns:
      TextField
    • getTextExtractionInfo

      public TdbTextExtractionInfo 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
      Specified by:
      clear in class TdbField
    • getFieldSize

      public int getFieldSize()
      Retrieve the size of the value in the field.
      Specified by:
      getFieldSize in class TdbField
      Returns:
      Total size of the contents of the field.
      See Also:
    • getValue

      public String getValue(int index) throws TdbException
      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 class TdbField
      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

      public void setValue(int index, String val) throws TdbException
      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 class TdbField
      Parameters:
      index - The offset of the paragraph to update
      val - The value to establish as the paragraph's value
      Throws:
      TdbException
    • appendValue

      public void appendValue(String val) throws TdbException
      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 class TdbField
      Parameters:
      val - The paragraph value to append to the field
      Throws:
      TdbException
    • appendValues

      public void appendValues(Collection<String> values) throws TdbException
      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 class TdbField
      Parameters:
      values - The paragraph values to append to the field
      Throws:
      TdbException
    • getValueCount

      public int getValueCount() throws TdbException
      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 class TdbField
      Returns:
      Paragraph count
      Throws:
      TdbException
    • insertValue

      public void insertValue(int index, String value) throws TdbException
      Inserts a new paragraph into the field.
      Specified by:
      insertValue in class TdbField
      Parameters:
      index - Zero-based index at which to insert the new paragraph.
      value - The value to insert into the field.
      Throws:
      TdbException
    • insertValues

      public void insertValues(int index, Collection<String> values) throws TdbException
      Inserts several new paragraphs into the field.
      Specified by:
      insertValues in class TdbField
      Parameters:
      index - Zero-based index at which to insert the new paragraphs.
      values - The values to insert into the field.
      Throws:
      TdbException
    • removeValue

      public void removeValue(int index) throws TdbException
      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 class TdbField
      Parameters:
      index - Zero-based index of paragraph to remove.
      Throws:
      TdbException
    • setText

      public void setText(String val)
      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

      public void appendText(String val)
      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

      public String toString()
      Retrieves a two newline-delimited string representation of the display content of the field
      Specified by:
      toString in class TdbField
      Returns:
      Field content