Class TdbField

java.lang.Object
com.tietoenator.trip.jxp.data.TdbField
All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
Direct Known Subclasses:
TdbStringField, TdbStructuredField, TdbTextField

public abstract class TdbField extends Object implements com.tietoenator.trip.jxp.internal.utils.DOMSink
Base abstraction that all strongly-typed field classes extend. Each extending type maintains two internal representations of the field's content: one for display, including whatever search term markup was defined by the field's retrieval template; the other being type-specific and representing the actual values within the field. To access the display form of the field, use the getOriginalValues() method. To access the type-specific form of the field, both for retrieval and for update, use the getValue(), setValue() and appendValue() methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Append a new subfield or paragraph to the field
    abstract void
    Append several new subfields or paragraphs to the field
    abstract void
    Clear any existing content from the field
    abstract int
    Retrieve the size of the value in the field.
    Get the name of the field
    Get a reference to the component within which this field exists
    abstract TdbFieldType
    Get the TRIP field type of the field
    abstract String
    getValue(int index)
    Get the subfield or paragraph value at the defined index
    abstract int
    Retrieve the count of the values in the field.
    abstract void
    insertValue(int index, String value)
    Inserts a new subfield or paragraph into the field.
    abstract void
    insertValues(int index, Collection<String> values)
    Inserts several new subfields or paragraphs into the field.
    boolean
    Returns the change status for the field.
    abstract boolean
    Returns true if this field contains a partial value.
    abstract List<String>
    Retrieve the display content of the field.
    abstract void
    removeValue(int index)
    Removes a subfield or paragraph from the field.
    abstract void
    setValue(int index, String val)
    Set the defined subfield or paragraph to the provided value
    Note that the index provided must lie within the current bounds of the field.
    abstract String
    Override the system-default behavior to provide a string representation of the field.
    abstract List<String>
    Retrieve the current content of the field.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.tietoenator.trip.jxp.internal.utils.DOMSink

    sinkNode
  • Method Details

    • getName

      public String getName()
      Get the name of the field
      Returns:
      The name of the field
    • isChanged

      public boolean isChanged()
      Returns the change status for the field.
      Returns:
      True if the field has uncommitted changes, otherwise false.
      Since:
      8.0-4
    • getType

      public abstract TdbFieldType getType()
      Get the TRIP field type of the field
      Returns:
      The field type
    • originalValues

      public abstract List<String> originalValues() throws TdbException
      Retrieve the display content of the field.
      This is a textual representation intended mostly for display purposes. Hit terms will be marked up in this representation using whatever markup the calling application has defined within the retrieval field template (if any).
      Returns:
      The collection of values that comprise the field's content
      Throws:
      TdbException
    • values

      public abstract List<String> values() throws TdbException
      Retrieve the current content of the field.
      This representation does not contain search term highlighting and reflects any updates made to the field since retrieval.
      Returns:
      The collection of values that comprise the field's content
      Throws:
      TdbException
    • getOwnerComponent

      public TdbComponent getOwnerComponent()
      Get a reference to the component within which this field exists
      Returns:
      The component within which the field exists
    • clear

      public abstract void clear()
      Clear any existing content from the field
    • getValue

      public abstract String getValue(int index) throws TdbException
      Get the subfield or paragraph value at the defined index
      Parameters:
      index - Zero-based index of item to retrieve
      Returns:
      Value of subfield or paragraph if available, null otherwise
      Throws:
      TdbException
    • getFieldSize

      public abstract int getFieldSize()
      Retrieve the size of the value in the field.

      The use of this property is only valid when connected to TRIPsystem version 6.2-0 or later.

      The value returned by this property is the total size of all subfields or paragraphs in the field. For STRING fields, this is simply the total size of the binary data stored in the field.

      This property reflects any updates made to the field since retrieval.

      Returns:
      Total size of the contents of the field.
    • isPartial

      public abstract boolean isPartial()
      Returns true if this field contains a partial value.

      Partial values are typically produced when requesting a hit-focused so-called "teaser" value from a TEXT or PHRASE field. E.g. for display in result lists.

      For STRING fields, the semantics of the Partial property is slightly different. For a TdbStringField to be considered partial, it must have been fetched with a field template assigned the TdbFieldFetchType.NoValue option.

      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.

      Returns:
      True if the value is partial
    • setValue

      public abstract void setValue(int index, String val) throws TdbException
      Set the defined subfield or paragraph to the provided value
      Note that the index provided must lie within the current bounds of the field. Attempt to set the value of a subfield / paragraph outside the bounds of the current field will cause an exception to be thrown.
      Parameters:
      index - Zero-based index of subfield or paragraph to modify
      val - Value to assign
      Throws:
      TdbException
    • appendValue

      public abstract void appendValue(String val) throws TdbException
      Append a new subfield or paragraph to the field
      Parameters:
      val - The value to append to the field
      Throws:
      TdbException
    • appendValues

      public abstract void appendValues(Collection<String> val) throws TdbException
      Append several new subfields or paragraphs to the field
      Parameters:
      val - The values to append to the field
      Throws:
      TdbException
    • insertValue

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

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

      public abstract void removeValue(int index) throws TdbException
      Removes a subfield or paragraph from the field.
      Parameters:
      index - Zero-based index from which to remove a subfield or paragraph.
      Throws:
      TdbException
    • getValueCount

      public abstract int getValueCount() throws TdbException
      Retrieve the count of the values in the field.
      Returns:
      Number of subfields or paragraphs in the field.
      Throws:
      TdbException
    • toString

      public abstract String toString()
      Override the system-default behavior to provide a string representation of the field.
      Overrides:
      toString in class Object
      Returns:
      Default string representation of the field