Class PropertiesChecker


  • public final class PropertiesChecker
    extends Object
    Class to check properties according to some situations.
    Author:
    DLiauchuk
    • 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 in DefaultPropertyDefinitions.
        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.
      • isPropertySuitableForTableType

        public static boolean isPropertySuitableForTableType​(String propertyName,
                                                             String tableType)
        Checks if properties can be defined for given type of table.
        Returns:
        TRUE if given property can be set for given type of table.