Class TextRenderer<T>
- java.lang.Object
-
- com.googlecode.wicket.jquery.core.renderer.TextRenderer<T>
-
- Type Parameters:
T- the model object type
- All Implemented Interfaces:
ITextRenderer<T>,Serializable,IClusterable
- Direct Known Subclasses:
JsonRenderer
public class TextRenderer<T> extends Object implements ITextRenderer<T>
Provides the defaultITextRenderer- Author:
- Sebastien Briquet - sebfz1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEXT_FIELD
-
Constructor Summary
Constructors Constructor Description TextRenderer()ConstructorTextRenderer(String expression)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetExpression()Gets the expression supplied to the constructorList<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.
-
-
-
Field Detail
-
TEXT_FIELD
public static final String TEXT_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TextRenderer
public TextRenderer()
Constructor
-
TextRenderer
public TextRenderer(String expression)
Constructor- Parameters:
expression- the property expression that will be resolved for the bean supplied togetText(Object)
-
-
Method Detail
-
getExpression
public String getExpression()
Gets the expression supplied to the constructor- Returns:
- null if the default constructor has been used
-
getTextField
public String getTextField()
Description copied from interface:ITextRendererGets the field name that will represents the 'text' of an object.- Specified by:
getTextFieldin interfaceITextRenderer<T>- Returns:
- the name of the text field
-
getText
public String getText(T object)
Description copied from interface:ITextRendererGets the text representation of an object.- Specified by:
getTextin interfaceITextRenderer<T>- Parameters:
object- the T object- Returns:
- the text
-
getText
public String getText(T object, String expression)
Description copied from interface:ITextRendererGets the text representation of an object, for its given property.- Specified by:
getTextin interfaceITextRenderer<T>- Parameters:
object- the T objectexpression- the property expression- Returns:
- the text
-
getFields
public List<String> getFields()
Description copied from interface:ITextRendererGets 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)- Specified by:
getFieldsin interfaceITextRenderer<T>- Returns:
- the
Listof fields
-
render
public com.github.openjson.JSONObject render(T object)
Description copied from interface:ITextRendererRenders the object. This typically returns a JSON body (without brackets)- Specified by:
renderin interfaceITextRenderer<T>- Parameters:
object- the object to render- Returns:
- the rendered object
-
match
public boolean match(T object, String search, boolean sensitive)
Description copied from interface:ITextRendererIndicates whether a search criteria matches the text representation of the supplied object- Specified by:
matchin interfaceITextRenderer<T>- Parameters:
object- the T objectsearch- the criteriasensitive- whether the search is case sensitive or not- Returns:
trueorfalse
-
-