Class ActionControllerEventRefValidator

java.lang.Object
ru.cg.webbpm.studio.subsystems.ui_scripting.validation.impl.ActionControllerEventRefValidator
All Implemented Interfaces:
PropertyValidator

@Component public class ActionControllerEventRefValidator extends Object implements PropertyValidator
Validates event refs for v2 controllers. More specifically: - checks that behavior and property name do exist - checks that specified property exists on behavior class - checks that specified property is of type IEvent
Author:
krylov
  • Constructor Details

    • ActionControllerEventRefValidator

      @Autowired public ActionControllerEventRefValidator(MetadataManager metadataManager)
  • Method Details

    • accept

      public boolean accept(PropertyValue propertyValue, PropertyType<?> propertyType, PropertyContext propertyContext)
      Specified by:
      accept in interface PropertyValidator
      Parameters:
      propertyValue - property to check
      propertyType - property type
      propertyContext - context of the property (e.g script or complex property)
      Returns:
      true if validator accepts given property TODO it's possible to depend on metadata and type here
    • validate

      public Set<String> validate(PropertyValue propertyValue, Object scriptContext, PropertyContext propertyContext)
      Description copied from interface: PropertyValidator
      Check if property is valid
      Specified by:
      validate in interface PropertyValidator
      Parameters:
      propertyValue - property to validate
      scriptContext - context of the script which property belongs to (e.g. page object or BPMN process)
      propertyContext - context of the property which property belongs to (e.g. Script or PropertyValue)
      Returns:
      Violation messages. If there are no violations returns empty set.