void on()

in domain/src/main/java/demoapp/dom/domain/objects/DomainObject/xxxDomainEvent/DomainObjectXxxDomainEventControlStrategy.java [73:96]


        void on(DomainObjectXxxDomainEventPage.DomainObjectXxxDomainEventMarker ev, ServiceRegistry serviceRegistry) {
            if (ev instanceof DomainObjectXxxDomainEventPage.ActionEvent) {
                val actionEvent = (DomainObjectXxxDomainEventPage.ActionEvent) ev;
                switch (actionEvent.getEventPhase()) {
                    case VALIDATE:
                        String argument = (String) actionEvent.getArguments().get(0);
                        if (!argument.toUpperCase().equals(argument)) {
                            actionEvent.invalidate("must be upper case");
                        }
                        break;
                }
            }
            if (ev instanceof DomainObjectXxxDomainEventPage.PropertyEvent) {
                val propertyEvent = (DomainObjectXxxDomainEventPage.PropertyEvent) ev;
                switch (propertyEvent.getEventPhase()) {
                    case VALIDATE:
                        Object newValue = propertyEvent.getNewValue();
                        if(!newValue.toString().toUpperCase().equals(newValue)) {
                            propertyEvent.invalidate("must be upper case");
                        }
                        break;
                }
            }
        }