KickJava   Java API By Example, From Geeks To Geeks.

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


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: AVTPart.java,v 1.15 2004/02/16 20:32:32 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  * Class to hold a part, either a string or XPath,
26  * of an Attribute Value Template.
27  * @xsl.usage internal
28  */

29 public abstract class AVTPart implements java.io.Serializable JavaDoc, XSLTVisitable
30 {
31
32   /**
33    * Construct a part.
34    */

35   public AVTPart(){}
36
37   /**
38    * Get the AVT part as the original string.
39    *
40    * @return the AVT part as the original string.
41    */

42   public abstract String JavaDoc getSimpleString();
43
44   /**
45    * Write the evaluated value into the given
46    * string buffer.
47    *
48    * @param xctxt The XPath context to use to evaluate this AVT.
49    * @param buf Buffer to write into.
50    * @param context The current source tree context.
51    * @param nsNode The current namespace context (stylesheet tree context).
52    * @param NodeList The current Context Node List.
53    *
54    * @throws javax.xml.transform.TransformerException
55    */

56   public abstract void evaluate(
57     XPathContext xctxt, FastStringBuffer buf, int context,
58       org.apache.xml.utils.PrefixResolver nsNode)
59         throws javax.xml.transform.TransformerException JavaDoc;
60
61   /**
62    * Set the XPath support.
63    *
64    * @param support XPathContext to set.
65    */

66   public void setXPathSupport(XPathContext support){}
67   
68   /**
69    * Tell if this expression or it's subexpressions can traverse outside
70    * the current subtree.
71    *
72    * @return true if traversal outside the context node's subtree can occur.
73    */

74    public boolean canTraverseOutsideSubtree()
75    {
76     return false;
77    }
78    
79   /**
80    * This function is used to fixup variables from QNames to stack frame
81    * indexes at stylesheet build time.
82    * @param vars List of QNames that correspond to variables. This list
83    * should be searched backwards for the first qualified name that
84    * corresponds to the variable reference qname. The position of the
85    * QName in the vector from the start of the vector will be its position
86    * in the stack frame (but variables above the globalsTop value will need
87    * to be offset to the current stack frame).
88    */

89   public abstract void fixupVariables(java.util.Vector JavaDoc vars, int globalsSize);
90
91
92 }
93
Popular Tags