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 java.lang.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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
appendValue(java.lang.String val)
Append a new subfield or paragraph to the fieldabstract void
appendValues(java.util.Collection<java.lang.String> val)
Append several new subfields or paragraphs to the fieldabstract void
clear()
Clear any existing content from the fieldabstract int
getFieldSize()
Retrieve the size of the value in the field.java.lang.String
getName()
Get the name of the fieldTdbComponent
getOwnerComponent()
Get a reference to the component within which this field existsabstract TdbFieldType
getType()
Get the TRIP field type of the fieldabstract java.lang.String
getValue(int index)
Get the subfield or paragraph value at the defined indexabstract int
getValueCount()
Retrieve the count of the values in the field.abstract void
insertValue(int index, java.lang.String value)
Inserts a new subfield or paragraph into the field.abstract void
insertValues(int index, java.util.Collection<java.lang.String> values)
Inserts several new subfields or paragraphs into the field.boolean
isChanged()
Returns the change status for the field.abstract boolean
isPartial()
Returns true if this field contains a partial value.abstract java.util.List<java.lang.String>
originalValues()
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, java.lang.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 java.lang.String
toString()
Override the system-default behavior to provide a string representation of the field.abstract java.util.List<java.lang.String>
values()
Retrieve the current content of the field.
-
-
-
Method Detail
-
getName
public java.lang.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 java.util.List<java.lang.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 java.util.List<java.lang.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 java.lang.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, java.lang.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 modifyval
- Value to assign- Throws:
TdbException
-
appendValue
public abstract void appendValue(java.lang.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(java.util.Collection<java.lang.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, java.lang.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, java.util.Collection<java.lang.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 java.lang.String toString()
Override the system-default behavior to provide a string representation of the field.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Default string representation of the field
-
-