View Javadoc

1   /*
2    * $Id: MockDefinitions.java 537196 2007-05-11 14:07:35Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  
23  package org.apache.tiles.definition;
24  
25  import java.util.Locale;
26  import java.util.Map;
27  
28  import org.apache.tiles.Definition;
29  
30  /***
31   *
32   * @version $Rev: 537196 $ $Date: 2007-05-11 16:07:35 +0200 (Fri, 11 May 2007) $
33   */
34  public class MockDefinitions implements Definitions {
35  
36      /***
37       * Hokey way to verify that this was created.
38       */
39      private static int instanceCount = 0;
40  
41      /***
42       * Hokey way to verify that this class was created.
43       *
44       * @return The number of created instances.
45       */
46      public static int getInstanceCount() {
47          return instanceCount;
48      }
49  
50      /*** Creates a new instance of MockDefinitions. */
51      public MockDefinitions() {
52          instanceCount++;
53      }
54  
55      /***
56       * Returns a Definition object that matches the given name.
57       *
58       * @param name The name of the Definition to return.
59       * @return the Definition matching the given name or null if none
60       *  is found.
61       */
62      public Definition getDefinition(String name) {
63          return null;
64      }
65  
66      /***
67       * Adds new locale-specific Definition objects to the internal
68       * collection and resolves inheritance attraibutes.
69       *
70       * @param defsMap The new definitions to add.
71       * @param locale The locale to add the definitions to.
72       */
73      public void addDefinitions(Map<String, Definition> defsMap,
74              java.util.Locale locale) {
75      }
76  
77      /***
78       * Returns a Definition object that matches the given name and locale.
79       *
80       * @param name The name of the Definition to return.
81       * @param locale The locale to use to resolve the definition.
82       * @return the Definition matching the given name or null if none
83       *  is found.
84       */
85      public Definition getDefinition(String name, java.util.Locale locale) {
86          return null;
87      }
88  
89      /***
90       * Adds new Definition objects to the internal collection and
91       * resolves inheritance attraibutes.
92       *
93       * @param defsMap The new definitions to add.
94       */
95      public void addDefinitions(Map<String, Definition> defsMap) {
96      }
97  
98      /*** {@inheritDoc} */
99      public void resolveInheritances() throws NoSuchDefinitionException {
100     }
101 
102     /*** {@inheritDoc} */
103     public void resolveInheritances(Locale locale) throws NoSuchDefinitionException {
104     }
105 
106     /***
107      * Clears definitions.
108      */
109     public void reset() {
110     }
111 
112     /*** {@inheritDoc} */
113     public Map<String, Definition> getBaseDefinitions() {
114         return null;
115     }
116 
117 }