KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tomcat > util > digester > AbstractObjectCreationFactory


1 /* $Id: AbstractObjectCreationFactory.java 467222 2006-10-24 03:17:11Z markt $
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.tomcat.util.digester;
19
20
21 import org.xml.sax.Attributes JavaDoc;
22
23
24 /**
25  * <p>Abstract base class for <code>ObjectCreationFactory</code>
26  * implementations.</p>
27  */

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

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

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

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

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

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

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