KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > digester > AbstractObjectCreationFactory


1 /* $Id: AbstractObjectCreationFactory.java 155412 2005-02-26 12:58:36Z dirkv $
2  *
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * 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.digester;
18
19
20 import org.xml.sax.Attributes JavaDoc;
21
22
23 /**
24  * <p>Abstract base class for <code>ObjectCreationFactory</code>
25  * implementations.</p>
26  */

27 abstract public class AbstractObjectCreationFactory implements ObjectCreationFactory {
28
29
30     // ----------------------------------------------------- Instance Variables
31

32
33     /**
34      * The associated <code>Digester</code> instance that was set up by
35      * {@link FactoryCreateRule} upon initialization.
36      */

37     protected Digester digester = null;
38
39
40     // --------------------------------------------------------- Public Methods
41

42
43     /**
44      * <p>Factory method called by {@link FactoryCreateRule} to supply an
45      * object based on the element's attributes.
46      *
47      * @param attributes the element's attributes
48      *
49      * @throws Exception any exception thrown will be propagated upwards
50      */

51     public abstract Object JavaDoc createObject(Attributes JavaDoc attributes) throws Exception JavaDoc;
52
53
54     /**
55      * <p>Returns the {@link Digester} that was set by the
56      * {@link FactoryCreateRule} upon initialization.
57      */

58     public Digester getDigester() {
59
60         return (this.digester);
61
62     }
63
64
65     /**
66      * <p>Set the {@link Digester} to allow the implementation to do logging,
67      * classloading based on the digester's classloader, etc.
68      *
69      * @param digester parent Digester object
70      */

71     public void setDigester(Digester digester) {
72
73         this.digester = digester;
74
75     }
76
77
78 }
79
Popular Tags