1 /*
2 * Copyright 2006-2016 The JGUIraffe Team.
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 package net.sf.jguiraffe.gui.builder;
17
18 import java.util.Set;
19
20 import net.sf.jguiraffe.di.BeanStore;
21 import net.sf.jguiraffe.di.ClassLoaderProvider;
22 import net.sf.jguiraffe.di.InvocationHelper;
23
24 /**
25 * <p>
26 * Definition of an interface for accessing the results of a {@link BeanBuilder}.
27 * </p>
28 * <p>
29 * A <em>bean builder</em> processes a script with bean definitions, creates
30 * {@link net.sf.jguiraffe.di.BeanProvider BeanProvider} objects from them and
31 * stores these providers in {@link BeanStore} objects. An arbitrary number of
32 * <code>BeanStore</code> objects may be created during a builder operation,
33 * which can be organized in a hierarchical structure.
34 * </p>
35 * <p>
36 * This interface allows access to the <code>BeanStore</code> objects created by
37 * the bean builder. They can be listed or queried by name. A client can thus
38 * obtain exactly the store objects it needs. Further, there is some information
39 * available about helper objects that have been used during processing of the
40 * builder script.
41 * </p>
42 *
43 * @author Oliver Heger
44 * @version $Id: BeanBuilderResult.java 205 2012-01-29 18:29:57Z oheger $
45 */
46 public interface BeanBuilderResult
47 {
48 /**
49 * Returns a set with the names of the existing bean stores.
50 *
51 * @return a set with the names of the bean stores
52 */
53 Set<String> getBeanStoreNames();
54
55 /**
56 * Returns the <code>BeanStore</code> with the given name. The name can be
57 * <b>null</b>, then the root <code>BeanStore</code> of the builder
58 * operation is returned.
59 *
60 * @param name the name of the desired <code>BeanStore</code>
61 * @return the <code>BeanStore</code> with this name
62 * @throws java.util.NoSuchElementException if there is no such
63 * <code>BeanStore</code>
64 */
65 BeanStore getBeanStore(String name);
66
67 /**
68 * Returns the {@link ClassLoaderProvider} that was used by the builder
69 * during script processing.
70 *
71 * @return the {@link ClassLoaderProvider}
72 */
73 ClassLoaderProvider getClassLoaderProvider();
74
75 /**
76 * Returns the {@link InvocationHelper} object that was used by builder
77 * during script processing. This object also contains the
78 * {@link net.sf.jguiraffe.di.ConversionHelper ConversionHelper} with all
79 * registered type converters. So this information may be of interest for a
80 * client. It is also required for releasing a builder result.
81 *
82 * @return the {@link InvocationHelper} used by the builder
83 */
84 InvocationHelper getInvocationHelper();
85 }