1 /*
2 * $Id: DefinitionsReader.java 829574 2009-10-25 14:15:31Z 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 package org.apache.tiles.definition;
23
24 import java.util.Map;
25
26 import org.apache.tiles.Definition;
27
28 /**
29 * Interface for reading <code>{@link Definition}</code> from a source.
30 * <p/>
31 * <p>This interface provides a standard way to read
32 * <code>{@link Definition}</code> objects from a source. Implementations
33 * should define what the source is, whether it be a persistent store such as a
34 * configuration file or database, or something like a web service. The
35 * DefinitionsReader is responsible for reading from a single location. It does
36 * not perform any internationalization duties or inheritance of Definitions.
37 * It only reads from the source and returns a Map of objects read.</p>
38 *
39 * @version $Rev: 829574 $ $Date: 2009-10-26 01:15:31 +1100 (Mon, 26 Oct 2009) $
40 */
41 public interface DefinitionsReader {
42
43 /**
44 * Reads <code>{@link Definition}</code> objects from a source.
45 * <p/>
46 * Implementations should publish what type of source object is expected.
47 *
48 * @param source The source from which definitions will be read.
49 * @return a Map of <code>Definition</code> objects read from
50 * the source.
51 * @throws DefinitionsFactoryException if the source is invalid or
52 * an error occurs when reading definitions.
53 */
54 Map<String, Definition> read(Object source);
55
56 }