Package net.sf.basedb.util.formatter
Class PropertyFilterFormatter
java.lang.Object
net.sf.basedb.util.formatter.PropertyFilterFormatter
- All Implemented Interfaces:
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
-
Constructor Summary
ConstructorDescriptionPropertyFilterFormatter
(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 TypeMethodDescriptionprivate void
appendListOfValues
(StringBuilder sb, String value, String quote) format
(PropertyFilter filter) Format a value by converting it to a string.private String
private <T extends Nameable>
Tprivate String
private String
private String
nameOfItem
(DbControl dc, Item itemType, int id, boolean quote) private String
parseString
(String value) Parse a string and return a value of the correct type.private String
-
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
-
item
-
nameOfItem
-
appendListOfValues
-
value
-
name
-
operator
-
function
-
missing
-