View Javadoc
1   /**
2    * Copyright (C) 2014-2016 Philip Helger (www.helger.com)
3    * philip[at]helger[dot]com
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    *         http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package com.helger.schematron.pure.validation;
18  
19  import javax.annotation.Nonnull;
20  import javax.annotation.Nullable;
21  import javax.annotation.concurrent.NotThreadSafe;
22  
23  import org.w3c.dom.Node;
24  
25  import com.helger.commons.state.EContinue;
26  import com.helger.schematron.pure.model.PSAssertReport;
27  import com.helger.schematron.pure.model.PSPattern;
28  import com.helger.schematron.pure.model.PSPhase;
29  import com.helger.schematron.pure.model.PSRule;
30  import com.helger.schematron.pure.model.PSSchema;
31  
32  /**
33   * The empty default implementation of {@link IPSValidationHandler}. This class
34   * may serve as the basis for your implementations.
35   * 
36   * @author Philip Helger
37   */
38  @NotThreadSafe
39  public class PSValidationHandlerDefault implements IPSValidationHandler
40  {
41    public void onStart (@Nonnull final PSSchema aSchema, @Nullable final PSPhase aActivePhase) throws SchematronValidationException
42    {
43      // empty
44    }
45  
46    public void onPattern (@Nonnull final PSPattern aPattern) throws SchematronValidationException
47    {
48      // empty
49    }
50  
51    public void onRule (@Nonnull final PSRule aRule, @Nonnull final String sContext) throws SchematronValidationException
52    {
53      // empty
54    }
55  
56    @Nonnull
57    public EContinue onFailedAssert (@Nonnull final PSAssertReport aAssertReport,
58                                     @Nonnull final String sTestExpression,
59                                     @Nonnull final Node aRuleMatchingNode,
60                                     final int nNodeIndex,
61                                     @Nullable final Object aContext) throws SchematronValidationException
62    {
63      return EContinue.CONTINUE;
64    }
65  
66    @Nonnull
67    public EContinue onSuccessfulReport (@Nonnull final PSAssertReport aAssertReport,
68                                         @Nonnull final String sTestExpression,
69                                         @Nonnull final Node aRuleMatchingNode,
70                                         final int nNodeIndex,
71                                         @Nullable final Object aContext) throws SchematronValidationException
72    {
73      return EContinue.CONTINUE;
74    }
75  
76    public void onEnd (@Nonnull final PSSchema aSchema, @Nullable final PSPhase aActivePhase) throws SchematronValidationException
77    {
78      // empty
79    }
80  }