public class TdbFieldTemplate
extends java.lang.Object
Constructor and Description |
---|
TdbFieldTemplate(java.lang.String name)
Constructor, create a simple template field
|
TdbFieldTemplate(java.lang.String name,
boolean focusOrExtract,
boolean summary,
int hint)
Deprecated.
This method will removed in the next major release.
|
TdbFieldTemplate(java.lang.String fieldName,
java.lang.String baseName)
Constructor, create a simple template field
|
TdbFieldTemplate(java.lang.String name,
TdbFieldFetchType mode,
int hint)
Constructor, create a fully specified template field.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Reset the template to a default state
|
java.lang.String |
getAfterHits()
Retrieve the string that is to be inserted after query hits when deserializing
a record using the TdbRecord class.
|
java.lang.String |
getBaseName()
Retrieve the name of the base referenced by this template
|
java.lang.String |
getBeforeHits()
Retrieve the string that is to be inserted before query hits when deserializing
a record using the TdbRecord class.
|
TdbFieldFetchType |
getFetchType()
Return an indication of what to fetch from the field.
|
boolean |
getFieldContent()
Get whether the field's content should be retrieved.
|
TdbFieldFetchOption |
getFieldFetchOption()
Returns the fetch option for the field.
|
java.lang.String |
getName()
Retrieve the name of the field referenced by this template
|
int |
getSizeHint()
Retrieve any size hint that has been established for the retrieval template
|
boolean |
isFocused()
Deprecated.
This method will removed in the next major release.
|
boolean |
isSummarized()
Deprecated.
This method will removed in the next major release.
|
void |
setAfterHits(java.lang.String after)
Establish the suffix string that will be inserted after query hits when
deserializing using the TdbRecord class.
|
void |
setBaseName(java.lang.String baseName)
Set the name of the base to be referenced by this template
|
void |
setBeforeHits(java.lang.String before)
Establish the prefix string that will be inserted before query hits when
deserializing using the TdbRecord class.
|
void |
setFetchType(TdbFieldFetchType mode)
Specify what to fetch from the field.
|
void |
setFieldContent(boolean fetchContent)
Set whether the field's content should be retrieved.
|
void |
setFieldFetchOption(TdbFieldFetchOption option)
Assign the fetch option for the field.
|
void |
setFocused(boolean focus)
Deprecated.
This method will removed in the next major release.
|
void |
setName(java.lang.String name)
Set the name of the field to be referenced by this template
|
void |
setSizeHint(int hint)
Set the size hint for the retrieval template
|
void |
setSummarized(boolean summ)
Deprecated.
This method will removed in the next major release.
|
void |
setSurroundHits(java.lang.String markup)
Set the symmetric string that should be inserted both before and
after query hits when retrieving field values from a query result.
|
public TdbFieldTemplate(java.lang.String name, TdbFieldFetchType mode, int hint)
name
- Name of field to be retrievedmode
- Specifies what to fetch from the field. Only used for TEXT fields - ignored for all other field types.hint
- If mode specifies to summarize, extract or focus from a TEXT field, this is a size hint for how much information
the application wishes to retrieve.@Deprecated public TdbFieldTemplate(java.lang.String name, boolean focusOrExtract, boolean summary, int hint)
The focusOrExtract parameter controls the so-called Keyword-In-Context (KWIC) feature of TRIP. Similar to a TRIPclassic-style SHOW FOCUS, the KWIC will retrieve hits with some surrounding text. However, an important difference is that if a keyword-in-context extract is requested from a field without any hits, text will still be extracted from the field. In this case, up to approximately hint characters will be extracted from the first paragraph of the field.
name
- Name of field to be retrievedfocusOrExtract
- Should the field be focused on search hits?summary
- Should the field be summarized?hint
- If summarized or focused, this is a size hint for how much information
the application wishes to retrievepublic TdbFieldTemplate(java.lang.String name)
name
- Name of the field to retrievepublic TdbFieldTemplate(java.lang.String fieldName, java.lang.String baseName)
fieldName
- Name of the field to retrievebaseName
- Name of the base where the field is definedpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The field namepublic java.lang.String getBaseName()
public void setBaseName(java.lang.String baseName)
baseName
- The base namepublic TdbFieldFetchType getFetchType()
public void setFetchType(TdbFieldFetchType mode)
mode
- Specifies what to fetch from the field. Only used for TEXT fields - ignored for all other field types.@Deprecated public boolean isFocused()
This controls the so-called Keyword-In-Context (KWIC) feature of TRIP. Similar to a TRIPclassic-style SHOW FOCUS, the KWIC will retrieve hits with some surrounding text. However, an important difference is that if a keyword-in-context extract is requested from a field without any hits, text will still be extracted from the field. In this case, up to approximately hint characters will be extracted from the first paragraph of the field.
@Deprecated public void setFocused(boolean focus)
This controls the so-called Keyword-In-Context (KWIC) feature of TRIP. Similar to a TRIPclassic-style SHOW FOCUS, the KWIC will retrieve hits with some surrounding text. However, an important difference is that if a keyword-in-context extract is requested from a field without any hits, text will still be extracted from the field. In this case, up to approximately hint characters will be extracted from the first paragraph of the field.
focus
- If true, any retrieval requests made using this template will use
hit term in context retrieval@Deprecated public boolean isSummarized()
@Deprecated public void setSummarized(boolean summ)
summ
- If true, any retrieval requests made using this template will use
summarization on the field's contentpublic int getSizeHint()
public void setSizeHint(int hint)
hint
- If the field is either to be focused or summarized, the size hint is
used by the server to establish a minimum number of characters to retrieve.public java.lang.String getBeforeHits()
public void setBeforeHits(java.lang.String before)
before
- The prefix stringpublic java.lang.String getAfterHits()
public void setAfterHits(java.lang.String after)
after
- The suffix stringpublic void setSurroundHits(java.lang.String markup)
markup
- The string that will be used to both prefix and suffix query hitspublic boolean getFieldContent()
public void setFieldContent(boolean fetchContent)
In order to only get the size of the data in the field, set this property to false. You will be able to access the size via the TdbField.getFieldSize() method, even if the TdbField object in question does not contain the actual value.
This property is ignored unless the TRIPsystem version used is 6.2-0 or later.
Setting this property to false also causes the any previously specified summary, focus (KWIC) or extract to be disabled. Assigning false to this property is equal to assigning TdbFieldFetchType.NoValue to the FetchType property (the setFetchType setter method).
fetchContent
- Pass false to disable retrieval of field content.public TdbFieldFetchOption getFieldFetchOption()
public void setFieldFetchOption(TdbFieldFetchOption option)
option
- The fetch option to setpublic void clear()