protected AbstractSearchConditionParser(Class<T> tclass, Map<String, String> contextProperties, Map<String, String> beanProperties) { this.conditionClass = tclass; this.contextProperties = contextProperties == null ? Collections.<String, String>emptyMap() : contextProperties; beanspector = SearchBean.class.isAssignableFrom(tclass) ? null : new Beanspector<T>(tclass); this.beanPropertiesMap = beanProperties; }
protected AbstractSearchConditionParser(Class<T> tclass, Map<String, String> contextProperties, Map<String, String> beanProperties) { this.conditionClass = tclass; this.contextProperties = contextProperties == null ? Collections.<String, String>emptyMap() : contextProperties; beanspector = SearchBean.class.isAssignableFrom(tclass) ? null : new Beanspector<T>(tclass); this.beanPropertiesMap = beanProperties; }
public PrimitiveSearchCondition(String propertyName, Object propertyValue, Type propertyType, ConditionType ct, T condition) { this.propertyName = propertyName; this.propertyValue = propertyValue; this.propertyType = propertyType; this.condition = condition; this.cType = ct; if (propertyName != null) { this.beanspector = SearchBean.class.isAssignableFrom(condition.getClass()) ? null : new Beanspector<T>(condition); } }
public PrimitiveSearchCondition(String propertyName, Object propertyValue, Type propertyType, ConditionType ct, T condition) { this.propertyName = propertyName; this.propertyValue = propertyValue; this.propertyType = propertyType; this.condition = condition; this.cType = ct; if (propertyName != null) { this.beanspector = SearchBean.class.isAssignableFrom(condition.getClass()) ? null : new Beanspector<T>(condition); } }
public PrimitiveSearchCondition(String propertyName, Object propertyValue, Type propertyType, ConditionType ct, T condition) { this.propertyName = propertyName; this.propertyValue = propertyValue; this.propertyType = propertyType; this.condition = condition; this.cType = ct; if (propertyName != null) { this.beanspector = SearchBean.class.isAssignableFrom(condition.getClass()) ? null : new Beanspector<T>(condition); } }
/** * Creates FIQL parser. * * @param tclass - class of T used to create condition objects in built syntax tree. Class T must have * accessible no-arg constructor and complementary setters to these used in FIQL expressions. * @param contextProperties */ public FiqlParser(Class<T> tclass, Map<String, String> contextProperties, Map<String, String> beanProperties) { beanspector = SearchBean.class.isAssignableFrom(tclass) ? null : new Beanspector<T>(tclass); conditionClass = tclass; this.contextProperties = contextProperties == null ? Collections.<String, String>emptyMap() : contextProperties; this.beanPropertiesMap = beanProperties; if (MessageUtils.isTrue(this.contextProperties.get(SUPPORT_SINGLE_EQUALS))) { operatorsMap = new HashMap<String, ConditionType>(operatorsMap); operatorsMap.put("=", ConditionType.EQUALS); comparatorsPattern = COMPARATORS_PATTERN_SINGLE_EQUALS; } }
/** * Creates cache of getters from template (condition) object and its values returned during one-pass * invocation. Method isMet() will use its keys to introspect getters of passed pojo object, and values * from map in comparison. * * @return template (condition) object getters mapped to their non-null values */ private Map<String, Object> getGettersAndValues() { if (!SearchBean.class.isAssignableFrom(condition.getClass())) { Map<String, Object> getters2values = new HashMap<>(); Beanspector<T> beanspector = new Beanspector<>(condition); for (String getter : beanspector.getGettersNames()) { Object value = getValue(beanspector, getter, condition); getters2values.put(getter, value); } //we do not need compare class objects getters2values.keySet().remove("class"); return getters2values; } return null; }
/** * Creates cache of getters from template (condition) object and its values returned during one-pass * invocation. Method isMet() will use its keys to introspect getters of passed pojo object, and values * from map in comparison. * * @return template (condition) object getters mapped to their non-null values */ private Map<String, Object> getGettersAndValues() { if (!SearchBean.class.isAssignableFrom(condition.getClass())) { Map<String, Object> getters2values = new HashMap<>(); Beanspector<T> beanspector = new Beanspector<>(condition); for (String getter : beanspector.getGettersNames()) { Object value = getValue(beanspector, getter, condition); getters2values.put(getter, value); } //we do not need compare class objects getters2values.keySet().remove("class"); return getters2values; } return null; }
/** * Creates cache of getters from template (condition) object and its values returned during one-pass * invocation. Method isMet() will use its keys to introspect getters of passed pojo object, and values * from map in comparison. * * @return template (condition) object getters mapped to their non-null values */ private Map<String, Object> getGettersAndValues() { if (!SearchBean.class.isAssignableFrom(condition.getClass())) { Map<String, Object> getters2values = new HashMap<String, Object>(); Beanspector<T> beanspector = new Beanspector<T>(condition); for (String getter : beanspector.getGettersNames()) { Object value = getValue(beanspector, getter, condition); getters2values.put(getter, value); } //we do not need compare class objects getters2values.keySet().remove("class"); return getters2values; } else { return null; } }