KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > explorer > parser > lib > AbstractNodeParser


1 /*====================================================================
2
3 Objectweb Explorer Framework
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy, Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26 package org.objectweb.util.explorer.parser.lib;
27
28 import org.objectweb.fractal.api.NoSuchInterfaceException;
29 import org.objectweb.util.explorer.core.code.api.CodeProvider;
30 import org.objectweb.util.explorer.core.common.lib.BindingFeature;
31 import org.objectweb.util.explorer.explorerConfig.Node;
32 import org.objectweb.util.explorer.parser.api.NodeParser;
33 import org.objectweb.util.explorer.property.api.PropertyFeeder;
34
35 /**
36  *
37  *
38  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jérôme Moroy</a>,
39  * <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>.
40  *
41  * @version 0.1
42  */

43 public abstract class AbstractNodeParser
44      extends BindingFeature
45   implements NodeParser
46 {
47
48     //==================================================================
49
//
50
// Internal States.
51
//
52
// ==================================================================
53

54     /** The feeder to use. */
55     protected PropertyFeeder feeder_ = null;
56
57     /** The code provider to use. */
58     protected CodeProvider codeProvider_ = null;
59     
60     // ==================================================================
61
//
62
// Constructors.
63
//
64
// ==================================================================
65

66     // ==================================================================
67
//
68
// Internal methods.
69
//
70
// ==================================================================
71

72     /**
73      * Provides the <code>PropertyFeeder</code> interface to use
74      * to feed the Explorer.
75      * @return The feeder to use.
76      */

77     protected PropertyFeeder getFeeder(){
78         if(feeder_==null) {
79             try {
80                 feeder_ = (PropertyFeeder)lookupFc(PropertyFeeder.PROPERTY_FEEDER);
81             } catch (NoSuchInterfaceException e) {
82                 getTrace().warn(PropertyFeeder.PROPERTY_FEEDER + ": Interface not found!");
83             }
84         }
85         return feeder_;
86     }
87
88     /**
89      * Provides the <code>CodeProvider</code> interface to use
90      * to obtain a code according to a given code description.
91      * @return The code provider to use.
92      */

93     protected CodeProvider getCodeProvider(){
94         if(codeProvider_==null) {
95             try {
96                 codeProvider_ = (CodeProvider)lookupFc(CodeProvider.CODE_PROVIDER);
97             } catch (NoSuchInterfaceException e) {
98                 getTrace().warn(CodeProvider.CODE_PROVIDER + ": Interface not found!");
99             }
100         }
101         return codeProvider_;
102     }
103     
104     // ==================================================================
105
//
106
// Public methods for BindingFeature abstract class.
107
//
108
// ==================================================================
109

110     /* (non-Javadoc)
111      * @see org.objectweb.util.explorer.core.common.lib.BindingFeature#clientFc()
112      */

113     public String JavaDoc[] clientFc() {
114         return new String JavaDoc[]{PropertyFeeder.PROPERTY_FEEDER, CodeProvider.CODE_PROVIDER};
115     }
116
117     // ==================================================================
118
//
119
// Public methods for NodeParser interface.
120
//
121
// ==================================================================
122

123     /* (non-Javadoc)
124      * @see org.objectweb.util.explorer.parser.api.NodeParser#parseNode(java.lang.Object, org.objectweb.util.explorer.explorerConfig.Node)
125      */

126     public abstract void parseNode(Object JavaDoc key, Node node);
127     
128 }
129
130
131
Popular Tags