1 package org.apache.dvsl;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.util.List;
23 import java.util.Map;
24
25
26 /**
27 * wrapper interface for nodes exposed in the
28 * template. Isolates the in-VSL DOM from that
29 * of the underlying implementation
30 *
31 * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
32 */
33 public interface DVSLNode
34 {
35 /**
36 * returns the name of the node
37 */
38 public String name();
39
40 /**
41 * returns the 'value' of the node
42 */
43 public String value();
44
45 /**
46 * returns the value of the XPAth
47 * expression
48 */
49 public Object valueOf( String xpath );
50
51 /**
52 * returns attribute
53 */
54 public String attrib( String attribute );
55
56 /**
57 * returns a list of nodes that satisfy
58 * the xpath
59 */
60 public List selectNodes( String xpath );
61
62 /**
63 * returns a single node that satisfies
64 * the xpath
65 */
66 public DVSLNode selectSingleNode( String xpath );
67 public DVSLNode get( String xpath );
68
69 /**
70 * renders a deep copy of the XML tree
71 * below the current node to the output
72 */
73 public String copy();
74
75 /**
76 * renders a deep copy of the nodes in
77 * the list ot the output
78 */
79 public String copy( List nodeList );
80
81 /**
82 * returns a list of all children of the current
83 * node
84 */
85 public List children();
86
87
88 /**
89 * returns the 'value' of the node
90 */
91 public String toString();
92
93
94 /* ====================== */
95
96 /**
97 * returns the object corresponding to the node
98 * in the implementaion that we are using.
99 * use only with the greatest of care
100 */
101
102 Object getNodeImpl();
103
104 Map getAttribMap();
105 }
106