NoOpValidationListener.java

  1. /*
  2.  * #%L
  3.  * wcm.io
  4.  * %%
  5.  * Copyright (C) 2019 wcm.io
  6.  * %%
  7.  * Licensed under the Apache License, Version 2.0 (the "License");
  8.  * you may not use this file except in compliance with the License.
  9.  * You may obtain a copy of the License at
  10.  *
  11.  *      http://www.apache.org/licenses/LICENSE-2.0
  12.  *
  13.  * Unless required by applicable law or agreed to in writing, software
  14.  * distributed under the License is distributed on an "AS IS" BASIS,
  15.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  * See the License for the specific language governing permissions and
  17.  * limitations under the License.
  18.  * #L%
  19.  */
  20. package io.wcm.qa.glnm.galen.validation;

  21. import com.galenframework.specs.Spec;
  22. import com.galenframework.specs.page.PageSection;
  23. import com.galenframework.suite.GalenPageAction;
  24. import com.galenframework.validation.PageValidation;
  25. import com.galenframework.validation.ValidationListener;
  26. import com.galenframework.validation.ValidationResult;

  27. class NoOpValidationListener implements ValidationListener {

  28.   /** {@inheritDoc} */
  29.   @Override
  30.   public void onAfterObject(PageValidation pageValidation, String objectName) {
  31.     // noop
  32.   }

  33.   /** {@inheritDoc} */
  34.   @Override
  35.   public void onAfterPageAction(GalenPageAction action) {
  36.     // noop
  37.   }

  38.   /** {@inheritDoc} */
  39.   @Override
  40.   public void onAfterSection(PageValidation pageValidation, PageSection pageSection) {
  41.     // noop
  42.   }

  43.   /** {@inheritDoc} */
  44.   @Override
  45.   public void onAfterSpecGroup(PageValidation pageValidation, String specGroupName) {
  46.     // noop
  47.   }

  48.   /** {@inheritDoc} */
  49.   @Override
  50.   public void onAfterSubLayout(PageValidation pageValidation, String objectName) {
  51.     // noop
  52.   }

  53.   /** {@inheritDoc} */
  54.   @Override
  55.   public void onBeforePageAction(GalenPageAction action) {
  56.     // noop
  57.   }

  58.   /** {@inheritDoc} */
  59.   @Override
  60.   public void onBeforeSection(PageValidation pageValidation, PageSection pageSection) {
  61.     // noop
  62.   }

  63.   /** {@inheritDoc} */
  64.   @Override
  65.   public void onBeforeSpec(PageValidation pageValidation, String objectName, Spec spec) {
  66.     // noop
  67.   }

  68.   /** {@inheritDoc} */
  69.   @Override
  70.   public void onGlobalError(Exception e) {
  71.     // noop
  72.   }

  73.   /** {@inheritDoc} */
  74.   @Override
  75.   public void onObject(PageValidation pageValidation, String objectName) {
  76.     // noop
  77.   }

  78.   /** {@inheritDoc} */
  79.   @Override
  80.   public void onSpecError(PageValidation pageValidation, String objectName, Spec spec, ValidationResult validationResult) {
  81.     // noop
  82.   }

  83.   /** {@inheritDoc} */
  84.   @Override
  85.   public void onSpecGroup(PageValidation pageValidation, String specGroupName) {
  86.     // noop
  87.   }

  88.   /** {@inheritDoc} */
  89.   @Override
  90.   public void onSpecSuccess(PageValidation pageValidation, String objectName, Spec spec, ValidationResult validationResult) {
  91.     // noop
  92.   }

  93.   /** {@inheritDoc} */
  94.   @Override
  95.   public void onSubLayout(PageValidation pageValidation, String objectName) {
  96.     // noop
  97.   }

  98.   /** {@inheritDoc} */
  99.   @Override
  100.   public String toString() {
  101.     return "NoOp Validation Listener";
  102.   }
  103. }