View Javadoc
1   /*
2    * Copyright 2006 Werner Guttmann
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11   * or implied. See the License for the specific language governing permissions and limitations under
12   * the License.
13   */
14  package org.exolab.castor.builder.conflictresolution;
15  
16  import org.exolab.castor.builder.SingleClassGenerator;
17  
18  /**
19   * Abtract base class for all {@link ClassNameCRStrategy} implementations.
20   */
21  public abstract class BaseClassNameCRStrategy implements ClassNameCRStrategy {
22  
23    /**
24     * The calling {@link SingleClassGenerator} instance.
25     */
26    private SingleClassGenerator _generator;
27  
28    /**
29     * Sets the current caller of this strategy implementation. This can be used to change the state
30     * of the calling object as a result of a strategy implementation.
31     *
32     * @param generator the current caller of this strategy implementation.
33     * @see org.exolab.castor.builder.conflictresolution.ClassNameCRStrategy
34     *      #setSingleClassGenerator(org.exolab.castor.builder.SingleClassGenerator)
35     */
36    public final void setSingleClassGenerator(final SingleClassGenerator generator) {
37      this._generator = generator;
38    }
39  
40    /**
41     * Returns the current caller of this strategy implementation. This can be used to change the
42     * state of the calling object as a result of a strategy implementation.
43     *
44     * @return the current caller of this strategy implementation.
45     */
46    protected final SingleClassGenerator getSingleClassGenerator() {
47      return this._generator;
48    }
49  
50  }