Class PropertiesChecker
- java.lang.Object
-
- org.openl.rules.table.properties.inherit.PropertiesChecker
-
public final class PropertiesChecker extends Object
Class to check properties according to some situations.- Author:
- DLiauchuk
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckProperties(IBindingContext bindingContext, Set<String> propertyNamesToCheck, TableSyntaxNode tableSyntaxNode, InheritanceLevel level)We need to check loaded properties that all values are appropriate for this table.static booleanisPropertySuitableForLevel(InheritanceLevel currentLevel, String propertyName)Checks if property with given name is suitable for given level.static booleanisPropertySuitableForTableType(String propertyName, String tableType)Checks if properties can be defined for given type of table.
-
-
-
Method Detail
-
checkProperties
public static void checkProperties(IBindingContext bindingContext, Set<String> propertyNamesToCheck, TableSyntaxNode tableSyntaxNode, InheritanceLevel level)
We need to check loaded properties that all values are appropriate for this table. If there is any problem an error should be thrown. Now we check 3 situations:
1) properties can be defined on TABLE level;
2) properties can be defined for current type of table; 3) deprecated properties;- Parameters:
propertyNamesToCheck- properties names that are physically defined in table. TODO: Refactor with strategy pattern
-
isPropertySuitableForLevel
public static boolean isPropertySuitableForLevel(InheritanceLevel currentLevel, String propertyName)
Checks if property with given name is suitable for given level. Checks according to the property definitions inDefaultPropertyDefinitions.- Parameters:
currentLevel- current level of current property.propertyName- name of the property to check.- Returns:
- true if property with income name can be defined in income level.
-
-