KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > templates > AVTPartSimple


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 /*
17  * $Id: AVTPartSimple.java,v 1.15 2004/02/16 20:32:33 minchau Exp $
18  */

19 package org.apache.xalan.templates;
20
21 import org.apache.xml.utils.FastStringBuffer;
22 import org.apache.xpath.XPathContext;
23
24 /**
25  * Simple string part of a complex AVT.
26  * @xsl.usage internal
27  */

28 public class AVTPartSimple extends AVTPart
29 {
30
31   /**
32    * Simple string value;
33    * @serial
34    */

35   private String JavaDoc m_val;
36
37   /**
38    * Construct a simple AVT part.
39    * @param val A pure string section of an AVT.
40    */

41   public AVTPartSimple(String JavaDoc val)
42   {
43     m_val = val;
44   }
45
46   /**
47    * Get the AVT part as the original string.
48    *
49    * @return the AVT part as the original string.
50    */

51   public String JavaDoc getSimpleString()
52   {
53     return m_val;
54   }
55   
56   /**
57    * This function is used to fixup variables from QNames to stack frame
58    * indexes at stylesheet build time.
59    * @param vars List of QNames that correspond to variables. This list
60    * should be searched backwards for the first qualified name that
61    * corresponds to the variable reference qname. The position of the
62    * QName in the vector from the start of the vector will be its position
63    * in the stack frame (but variables above the globalsTop value will need
64    * to be offset to the current stack frame).
65    */

66   public void fixupVariables(java.util.Vector JavaDoc vars, int globalsSize)
67   {
68     // no-op
69
}
70
71
72   /**
73    * Write the value into the buffer.
74    *
75    * @param xctxt An XPathContext object, providing infomation specific
76    * to this invocation and this thread. Maintains SAX state, variables,
77    * error handler and so on, so the transformation/XPath object itself
78    * can be simultaneously invoked from multiple threads.
79    * @param buf Buffer to write into.
80    * @param context The current source tree context.
81    * @param nsNode The current namespace context (stylesheet tree context).
82    * @param NodeList The current Context Node List.
83    */

84   public void evaluate(XPathContext xctxt, FastStringBuffer buf,
85                        int context,
86                        org.apache.xml.utils.PrefixResolver nsNode)
87   {
88     buf.append(m_val);
89   }
90   /**
91    * @see XSLTVisitable#callVisitors(XSLTVisitor)
92    */

93   public void callVisitors(XSLTVisitor visitor)
94   {
95     // Don't do anything for the subpart for right now.
96
}
97
98 }
99
Popular Tags