1/*
2 * Copyright (C) 2010 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.google.clearsilver.jsilver.data;
18
19import com.google.clearsilver.jsilver.exceptions.JSilverBadSyntaxException;
20import com.google.clearsilver.jsilver.resourceloader.ResourceLoader;
21
22import java.io.IOException;
23
24/**
25 * Loads data from resources.
26 */
27public interface DataFactory {
28
29  /**
30   * Create new Data instance, ready to be populated.
31   */
32  Data createData();
33
34  /**
35   * Loads data in Hierarchical Data Format (HDF) into an existing Data object.
36   */
37  void loadData(final String dataFileName, ResourceLoader resourceLoader, Data output)
38      throws JSilverBadSyntaxException, IOException;
39
40  /**
41   * Loads data in Hierarchical Data Format (HDF) into a new Data object.
42   */
43  Data loadData(String dataFileName, ResourceLoader resourceLoader) throws IOException;
44
45  /**
46   * Returns the Parser used by this factory to parse the HDF content.
47   *
48   * @return
49   */
50  Parser getParser();
51}
52