View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.creadur.whisker.model;
20  
21  /**
22   * Visits element in the model.
23   */
24  public abstract class Visitor {
25  
26      /**
27       * Tunes traversal, allowing public domain resources
28       * to be ignored.
29       * @return true when public domain resources should
30       * be traversed, false otherwise
31       */
32      public boolean traversePublicDomain() {
33          return true;
34      }
35  
36      /**
37       * Tunes traversal, allowing a shallow traversal
38       * without {@link WithLicense} elements.
39       *
40       * @return true when {@link WithLicense} elements
41       * should be stepped over, false when they should
42       * be included
43       */
44      public boolean traverseWithLicense() {
45          return true;
46      }
47  
48      /**
49       * Tunes traversal, allowing a moderate traversal
50       * without {@link ByOrganisation} elements.
51       * @return true when {@link ByOrganisation} elements
52       * should be stepped over, false when they should
53       * be included
54       */
55      public boolean traverseByOrganisation() {
56          return true;
57      }
58  
59      /**
60       * Tunes traversal, allowing {@link Resource}
61       * elements to be ignored.
62       * @return true when {@link Resource} elements
63       * should be stepped over, false when they should
64       * be included
65       */
66      public boolean traverseResource() {
67          return true;
68      }
69  
70      /**
71       * Visits {@link WithinDirectory}.
72       * @param directory not null
73       */
74      public void visit(final WithinDirectory directory) {
75      };
76  
77      /**
78       * Visits {@link WithLicense}.
79       * @param license not null
80       */
81      public void visit(final WithLicense license) {
82      };
83  
84      /**
85       * Visits {@link ByOrganisation}.
86       * @param byOrganisation not null
87       */
88      public void visit(final ByOrganisation byOrganisation) {
89      };
90  
91      /**
92       * Visits {@link Resource}.
93       * @param resource not null
94       */
95      public void visit(final Resource resource) {
96      };
97  }