01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.commons.betwixt.io.read;
18:
19: /**
20: * A Chain of bean creators.
21: *
22: * @author Robert Burrell Donkin
23: * @since 0.5
24: */
25: public abstract class BeanCreationChain {
26:
27: //-------------------------------------------------------- Class Methods
28:
29: /**
30: * Creates the default <code>BeanCreationChain</code> used when reading beans.
31: * @return a <code>BeanCreationList</code> with the default creators loader in order, not null
32: */
33: public static final BeanCreationChain createDefaultChain() {
34: // this delegates to the list but this is the canonical version
35: // the implementation may change later
36: return BeanCreationList.createStandardChain();
37: }
38:
39: //-------------------------------------------------------- Instance Methods
40:
41: /**
42: * Create a bean for the given mapping in the given context.
43: *
44: * @param elementMapping specifies the mapping between the type and element.
45: * <strong>Note</strong> it is recommended that classes do not store a permenant
46: * reference to this object since these objects may later be reused.
47: * Not null
48: * @param context the context in which this creation happens, not null
49: * @return the bean, possibly null
50: */
51: public abstract Object create(ElementMapping elementMapping,
52: ReadContext context);
53:
54: }
|