View Javadoc
1   package com.exsoinn.util.epf;
2   
3   /**
4    * Thrown when the {@link SearchPath} provided does not exactly match the {@link Context} being searched. More specifically,
5    * if a node in the {@link SearchPath} is not found in the area of the {@link Context} object currently being search, then this
6    * {@code Exception} is used to describe that scenario.
7    *
8    * Created by QuijadaJ on 7/29/2017.
9    */
10  public class IncompatibleSearchPathException extends Exception {
11      private final SearchPath searchPath;
12      private final String node;
13      private final Context context;
14  
15      public IncompatibleSearchPathException(SearchPath pSearchPath, String pNode, Context pCtx) {
16          super("Did not find expected path node '" + pNode
17                  + "' in the current part of the element currently being processed/searched. Check that the "
18                  + "search path is correct: " + pSearchPath.toString()
19                  + ". Element is " + pCtx.stringRepresentation());
20          searchPath = pSearchPath;
21          node = pNode;
22          context = pCtx;
23      }
24  
25      /*
26       * Getters
27       */
28      public SearchPath getSearchPath() {
29          return searchPath;
30      }
31  
32      public String getNode() {
33          return node;
34      }
35  
36      public Context getContext() {
37          return context;
38      }
39  }