01: /*
02: * Copyright 1999-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.jxpath.ri.model;
17:
18: import java.util.Locale;
19:
20: import org.apache.commons.jxpath.ri.QName;
21:
22: /**
23: * Creates NodePointers for objects of a certain type.
24: * NodePointerFactories are ordered according to the values returned
25: * by the "getOrder" method and always queried in that order.
26: *
27: * @author Dmitri Plotnikov
28: * @version $Revision: 1.7 $ $Date: 2004/02/29 14:17:45 $
29: */
30: public interface NodePointerFactory {
31:
32: /**
33: * The factory order number determines its position between other factories.
34: */
35: int getOrder();
36:
37: /**
38: * Create a NodePointer for the supplied object. The node will represent
39: * the "root" object for a path.
40: *
41: * @return null if this factory does not recognize objects of the supplied
42: * type.
43: */
44: NodePointer createNodePointer(QName name, Object object,
45: Locale locale);
46:
47: /**
48: * Create a NodePointer for the supplied child object.
49: * <p>
50: * @return null if this factory does not recognize objects of the supplied
51: * type.
52: */
53: NodePointer createNodePointer(NodePointer parent, QName name,
54: Object object);
55: }
|