01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.xml.impl;
17:
18: import org.geotools.xml.Binding;
19: import org.geotools.xml.ComplexBinding;
20: import org.geotools.xml.ElementInstance;
21: import org.geotools.xml.Node;
22: import org.geotools.xml.impl.BindingWalker.Visitor;
23: import org.picocontainer.MutablePicoContainer;
24:
25: public class ContextInitializer implements Visitor {
26: ElementInstance childInstance;
27: Node node;
28: MutablePicoContainer context;
29:
30: public ContextInitializer(ElementInstance childInstance, Node node,
31: MutablePicoContainer context) {
32: this .childInstance = childInstance;
33: this .node = node;
34: this .context = context;
35: }
36:
37: public void visit(Binding binding) {
38: if (binding instanceof ComplexBinding) {
39: ComplexBinding cStrategy = (ComplexBinding) binding;
40: cStrategy.initializeChildContext(childInstance, node,
41: context);
42: }
43: }
44: }
|