Interface ITextRenderer<T>
-
- Type Parameters:
T- the model object type
- All Superinterfaces:
IClusterable,Serializable
- All Known Subinterfaces:
IChoiceRenderer<T>
- All Known Implementing Classes:
JsonRenderer,TextRenderer
public interface ITextRenderer<T> extends IClusterable
Provides the ability to get a specific text (likely from a property) of a bean type, for rendering purpose- Author:
- Sebastien Briquet - sebfz1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>getFields()Gets the list of fields used by this renderer.StringgetText(T object)Gets the text representation of an object.StringgetText(T object, String expression)Gets the text representation of an object, for its given property.StringgetTextField()Gets the field name that will represents the 'text' of an object.booleanmatch(T object, String search, boolean sensitive)Indicates whether a search criteria matches the text representation of the supplied objectcom.github.openjson.JSONObjectrender(T object)Renders the object.
-
-
-
Method Detail
-
getTextField
String getTextField()
Gets the field name that will represents the 'text' of an object.- Returns:
- the name of the text field
-
getText
String getText(T object)
Gets the text representation of an object.- Parameters:
object- the T object- Returns:
- the text
-
getText
String getText(T object, String expression)
Gets the text representation of an object, for its given property.- Parameters:
object- the T objectexpression- the property expression- Returns:
- the text
-
getFields
List<String> getFields()
Gets the list of fields used by this renderer. This can be used to prevent duplication on rendering (if a template uses same fields for instance)- Returns:
- the
Listof fields
-
match
boolean match(T object, String search, boolean sensitive)
Indicates whether a search criteria matches the text representation of the supplied object- Parameters:
object- the T objectsearch- the criteriasensitive- whether the search is case sensitive or not- Returns:
trueorfalse
-
render
com.github.openjson.JSONObject render(T object)
Renders the object. This typically returns a JSON body (without brackets)- Parameters:
object- the object to render- Returns:
- the rendered object
-
-