Class CriteriaBuilderHelper
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.config.ui.editors.CriteriaBuilderHelper
-
public class CriteriaBuilderHelper extends Object
This class is used to construct a criteria model based on the OpenNMS' model classes.- Author:
- Christian Pape
-
-
Constructor Summary
Constructors Constructor Description CriteriaBuilderHelper(Class<?> entityType, Class<?>... aliasTypes)Constructor used to instantiate new objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stringdecode(String string)voiddump()Dumps all the entities data to System.out.static Stringencode(String string)Set<String>getEntities()Returns the entities used in this instance.Class<?>getTypeOfProperty(String property)Returns the type of a given property.voidparseConfiguration(CriteriaBuilder criteriaBuilder, String configurationString)This method parses a criteria configuration and adds the given restrictions to theCriteriaBuilderinstance.ObjectparseCriteriaValue(Class<?> clazz, String value)This method is used for parsing a criteria value.voidsetCriteriaParser(Class<?> clazz, CriteriaParser<?> criteriaParser)Sets aCriteriaParserfor a given class.
-
-
-
Method Detail
-
parseCriteriaValue
public Object parseCriteriaValue(Class<?> clazz, String value)
This method is used for parsing a criteria value.- Parameters:
clazz- the type classvalue- the value to be parsed- Returns:
- a new instance representing the value
-
getTypeOfProperty
public Class<?> getTypeOfProperty(String property)
Returns the type of a given property.- Parameters:
property- the property to search for- Returns:
- the associated type
-
setCriteriaParser
public void setCriteriaParser(Class<?> clazz, CriteriaParser<?> criteriaParser)
Sets aCriteriaParserfor a given class.- Parameters:
clazz- the class to be usedcriteriaParser- theCriteriaParserto handle data for the class
-
parseConfiguration
public void parseConfiguration(CriteriaBuilder criteriaBuilder, String configurationString)
This method parses a criteria configuration and adds the given restrictions to theCriteriaBuilderinstance.- Parameters:
criteriaBuilder- theCriteriaBuilderto be usedconfigurationString- the criteria configuration string
-
dump
public void dump()
Dumps all the entities data to System.out.
-
-