Source Code Cross Referenced for XRTreeFragSelectWrapper.java in  » XML » xalan » org » apache » xpath » objects » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xalan » org.apache.xpath.objects 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: XRTreeFragSelectWrapper.java,v 1.13 2004/08/17 19:25:39 jycli Exp $
018:         */
019:        package org.apache.xpath.objects;
020:
021:        import org.apache.xalan.res.XSLMessages;
022:        import org.apache.xml.dtm.DTMIterator;
023:        import org.apache.xml.utils.XMLString;
024:        import org.apache.xpath.Expression;
025:        import org.apache.xpath.XPathContext;
026:        import org.apache.xpath.res.XPATHErrorResources;
027:
028:        /**
029:         * This class makes an select statement act like an result tree fragment.
030:         */
031:        public class XRTreeFragSelectWrapper extends XRTreeFrag implements 
032:                Cloneable {
033:            static final long serialVersionUID = -6526177905590461251L;
034:
035:            public XRTreeFragSelectWrapper(Expression expr) {
036:                super (expr);
037:            }
038:
039:            /**
040:             * This function is used to fixup variables from QNames to stack frame 
041:             * indexes at stylesheet build time.
042:             * @param vars List of QNames that correspond to variables.  This list 
043:             * should be searched backwards for the first qualified name that 
044:             * corresponds to the variable reference qname.  The position of the 
045:             * QName in the vector from the start of the vector will be its position 
046:             * in the stack frame (but variables above the globalsTop value will need 
047:             * to be offset to the current stack frame).
048:             */
049:            public void fixupVariables(java.util.Vector vars, int globalsSize) {
050:                ((Expression) m_obj).fixupVariables(vars, globalsSize);
051:            }
052:
053:            /**
054:             * For support of literal objects in xpaths.
055:             *
056:             * @param xctxt The XPath execution context.
057:             *
058:             * @return the result of executing the select expression
059:             *
060:             * @throws javax.xml.transform.TransformerException
061:             */
062:            public XObject execute(XPathContext xctxt)
063:                    throws javax.xml.transform.TransformerException {
064:                XObject m_selected;
065:                m_selected = ((Expression) m_obj).execute(xctxt);
066:                m_selected.allowDetachToRelease(m_allowRelease);
067:                if (m_selected.getType() == CLASS_STRING)
068:                    return m_selected;
069:                else
070:                    return new XString(m_selected.str());
071:            }
072:
073:            /**
074:             * Detaches the <code>DTMIterator</code> from the set which it iterated
075:             * over, releasing any computational resources and placing the iterator
076:             * in the INVALID state. After <code>detach</code> has been invoked,
077:             * calls to <code>nextNode</code> or <code>previousNode</code> will
078:             * raise a runtime exception.
079:             * 
080:             * In general, detach should only be called once on the object.
081:             */
082:            public void detach() {
083:                throw new RuntimeException(
084:                        XSLMessages
085:                                .createXPATHMessage(
086:                                        XPATHErrorResources.ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
087:                                        null)); //"detach() not supported by XRTreeFragSelectWrapper!");
088:            }
089:
090:            /**
091:             * Cast result object to a number.
092:             *
093:             * @return The result tree fragment as a number or NaN
094:             */
095:            public double num() throws javax.xml.transform.TransformerException {
096:
097:                throw new RuntimeException(
098:                        XSLMessages
099:                                .createXPATHMessage(
100:                                        XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
101:                                        null)); //"num() not supported by XRTreeFragSelectWrapper!");
102:            }
103:
104:            /**
105:             * Cast result object to an XMLString.
106:             *
107:             * @return The document fragment node data or the empty string. 
108:             */
109:            public XMLString xstr() {
110:                throw new RuntimeException(
111:                        XSLMessages
112:                                .createXPATHMessage(
113:                                        XPATHErrorResources.ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
114:                                        null)); //"xstr() not supported by XRTreeFragSelectWrapper!");
115:            }
116:
117:            /**
118:             * Cast result object to a string.
119:             *
120:             * @return The document fragment node data or the empty string. 
121:             */
122:            public String str() {
123:                throw new RuntimeException(
124:                        XSLMessages
125:                                .createXPATHMessage(
126:                                        XPATHErrorResources.ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
127:                                        null)); //"str() not supported by XRTreeFragSelectWrapper!");
128:            }
129:
130:            /**
131:             * Tell what kind of class this is.
132:             *
133:             * @return the string type
134:             */
135:            public int getType() {
136:                return CLASS_STRING;
137:            }
138:
139:            /**
140:             * Cast result object to a result tree fragment.
141:             *
142:             * @return The document fragment this wraps
143:             */
144:            public int rtf() {
145:                throw new RuntimeException(
146:                        XSLMessages
147:                                .createXPATHMessage(
148:                                        XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
149:                                        null)); //"rtf() not supported by XRTreeFragSelectWrapper!");
150:            }
151:
152:            /**
153:             * Cast result object to a DTMIterator.
154:             *
155:             * @return The document fragment as a DTMIterator
156:             */
157:            public DTMIterator asNodeIterator() {
158:                throw new RuntimeException(
159:                        XSLMessages
160:                                .createXPATHMessage(
161:                                        XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
162:                                        null)); //"asNodeIterator() not supported by XRTreeFragSelectWrapper!");
163:            }
164:
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.