Package net.sf.basedb.util.formatter
Class PropertyFilterFormatter
java.lang.Object
net.sf.basedb.util.formatter.PropertyFilterFormatter
- All Implemented Interfaces:
Formatter<PropertyFilter>
public class PropertyFilterFormatter extends Object implements Formatter<PropertyFilter>
Formatter for PropertyFilter items. This will create a more readable representation
of the property filter than the
PropertyFilter.toString()
method. It knows
about some special properties and load the names of annotation types, item subtypes, etc
instead of just displaying their ID values.- Since:
- 3.5
- Author:
- Nicklas
-
Field Summary
Fields Modifier and Type Field Description private Formatter<Date>
dateFormatter
private DbControl
dc
private boolean
tagElements
-
Constructor Summary
Constructors Constructor Description PropertyFilterFormatter(DbControl dc, Formatter<Date> dateFormatter)
Create a new formatter.PropertyFilterFormatter(DbControl dc, Formatter<Date> dateFormatter, boolean tagElements)
Create a new formatter with option to create HTML-like tags around elements. -
Method Summary
Modifier and Type Method Description private void
appendListOfValues(StringBuilder sb, String value, String quote)
String
format(PropertyFilter filter)
Format a value by converting it to a string.private String
function(String function)
private String
missing(String missing, String title)
private String
name(String name)
private String
nameOfItem(DbControl dc, Item itemType, int id, boolean quote)
private String
operator(String op)
PropertyFilter
parseString(String value)
Parse a string and return a value of the correct type.private String
value(String value)
-
Field Details
-
dc
-
dateFormatter
-
tagElements
private final boolean tagElements
-
-
Constructor Details
-
PropertyFilterFormatter
Create a new formatter. -
PropertyFilterFormatter
Create a new formatter with option to create HTML-like tags around elements. The following tags are used: <value>, <name>, <operator>, <function>- Since:
- 3.13.1
-
-
Method Details
-
format
Description copied from interface:Formatter
Format a value by converting it to a string.- Specified by:
format
in interfaceFormatter<PropertyFilter>
- Parameters:
filter
- The value to format- Returns:
- A formatted string
-
parseString
Description copied from interface:Formatter
Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.- Specified by:
parseString
in interfaceFormatter<PropertyFilter>
- Parameters:
value
- The string to parse- Returns:
- An object
- Throws:
UnsupportedOperationException
- Always
-
nameOfItem
-
appendListOfValues
-
value
-
name
-
operator
-
function
-
missing
-