Source Code Cross Referenced for UseAttributeSets.java in  » XML » XPath-Saxon » net » sf » saxon » instruct » 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 » XPath Saxon » net.sf.saxon.instruct 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sf.saxon.instruct;
002:
003:        import net.sf.saxon.expr.*;
004:        import net.sf.saxon.om.NamePool;
005:        import net.sf.saxon.pattern.NodeKindTest;
006:        import net.sf.saxon.trans.XPathException;
007:        import net.sf.saxon.type.ItemType;
008:        import net.sf.saxon.type.TypeHierarchy;
009:
010:        import java.io.PrintStream;
011:
012:        /**
013:         * This instruction corresponds to a use-attribute-sets attribute on a literal result element, xsl:element,
014:         * or xsl:copy.
015:         */
016:        public class UseAttributeSets extends Instruction {
017:
018:            private AttributeSet[] attributeSets;
019:
020:            public UseAttributeSets(AttributeSet[] sets) {
021:                attributeSets = sets;
022:            }
023:
024:            /**
025:             * Simplify an expression. This performs any static optimization (by rewriting the expression
026:             * as a different expression). The default implementation does nothing.
027:             *
028:             * @return the simplified expression
029:             * @throws net.sf.saxon.trans.XPathException
030:             *          if an error is discovered during expression
031:             *          rewriting
032:             */
033:
034:            public Expression simplify(StaticContext env) throws XPathException {
035:                return this ;
036:            }
037:
038:            /**
039:             * Perform optimisation of an expression and its subexpressions.
040:             * <p/>
041:             * <p>This method is called after all references to functions and variables have been resolved
042:             * to the declaration of the function or variable, and after all type checking has been done.</p>
043:             *
044:             * @param opt             the optimizer in use. This provides access to supporting functions; it also allows
045:             *                        different optimization strategies to be used in different circumstances.
046:             * @param env             the static context of the expression
047:             * @param contextItemType the static type of "." at the point where this expression is invoked.
048:             *                        The parameter is set to null if it is known statically that the context item will be undefined.
049:             *                        If the type of the context item is not known statically, the argument is set to
050:             *                        {@link net.sf.saxon.type.Type#ITEM_TYPE}
051:             * @return the original expression, rewritten if appropriate to optimize execution
052:             * @throws net.sf.saxon.trans.StaticError if an error is discovered during this phase
053:             *                                        (typically a type error)
054:             */
055:
056:            public Expression optimize(Optimizer opt, StaticContext env,
057:                    ItemType contextItemType) throws XPathException {
058:                return this ;
059:            }
060:
061:            /**
062:             * Perform type checking of an expression and its subexpressions.
063:             * <p/>
064:             * <p>This checks statically that the operands of the expression have
065:             * the correct type; if necessary it generates code to do run-time type checking or type
066:             * conversion. A static type error is reported only if execution cannot possibly succeed, that
067:             * is, if a run-time type error is inevitable. The call may return a modified form of the expression.</p>
068:             * <p/>
069:             * <p>This method is called after all references to functions and variables have been resolved
070:             * to the declaration of the function or variable. However, the types of such functions and
071:             * variables may not be accurately known if they have not been explicitly declared.</p>
072:             *
073:             * @param env             the static context of the expression
074:             * @param contextItemType the static type of "." at the point where this expression is invoked.
075:             *                        The parameter is set to null if it is known statically that the context item will be undefined.
076:             *                        If the type of the context item is not known statically, the argument is set to
077:             *                        {@link net.sf.saxon.type.Type#ITEM_TYPE}
078:             * @return the original expression, rewritten to perform necessary
079:             *         run-time type checks, and to perform other type-related
080:             *         optimizations
081:             * @throws net.sf.saxon.trans.StaticError if an error is discovered during this phase
082:             *                                        (typically a type error)
083:             */
084:
085:            public Expression typeCheck(StaticContext env,
086:                    ItemType contextItemType) throws XPathException {
087:                return this ;
088:            }
089:
090:            /**
091:             * Get the item type of the items returned by evaluating this instruction
092:             *
093:             * @return the static item type of the instruction
094:             * @param th
095:             */
096:
097:            public ItemType getItemType(TypeHierarchy th) {
098:                return NodeKindTest.ATTRIBUTE;
099:            }
100:
101:            /**
102:             * ProcessLeavingTail: called to do the real work of this instruction. This method
103:             * must be implemented in each subclass. The results of the instruction are written
104:             * to the current Receiver, which can be obtained via the Controller.
105:             *
106:             * @param context The dynamic context of the transformation, giving access to the current node,
107:             *                the current variables, etc.
108:             * @return null if the instruction has completed execution; or a TailCall indicating
109:             *         a function call or template call that is delegated to the caller, to be made after the stack has
110:             *         been unwound so as to save stack space.
111:             */
112:
113:            public TailCall processLeavingTail(XPathContext context)
114:                    throws XPathException {
115:                AttributeSet.expand(attributeSets, context);
116:                return null;
117:            }
118:
119:            /**
120:             * Diagnostic print of expression structure. The expression is written to the System.err
121:             * output stream
122:             *
123:             * @param level indentation level for this expression
124:             * @param pool  NamePool used to expand any names appearing in the expression
125:             * @param out   Output destination
126:             */
127:
128:            public void display(int level, NamePool pool, PrintStream out) {
129:                out
130:                        .println(ExpressionTool.indent(level)
131:                                + "use attribute sets");
132:            }
133:        }
134:
135:        //
136:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
137:        // you may not use this file except in compliance with the License. You may obtain a copy of the
138:        // License at http://www.mozilla.org/MPL/
139:        //
140:        // Software distributed under the License is distributed on an "AS IS" basis,
141:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
142:        // See the License for the specific language governing rights and limitations under the License.
143:        //
144:        // The Original Code is: all this file.
145:        //
146:        // The Initial Developer of the Original Code is Michael H. Kay.
147:        //
148:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
149:        //
150:        // Contributor(s): none.
151:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.