Source Code Cross Referenced for InstructionDetails.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.om.NamespaceResolver;
004:        import net.sf.saxon.trace.InstructionInfo;
005:        import net.sf.saxon.trace.InstructionInfoProvider;
006:        import net.sf.saxon.trace.Location;
007:
008:        import java.io.Serializable;
009:        import java.util.HashMap;
010:        import java.util.Iterator;
011:
012:        /**
013:         * Details about an instruction, used when reporting errors and when tracing
014:         */
015:
016:        public final class InstructionDetails implements  InstructionInfo,
017:                InstructionInfoProvider, Serializable {
018:
019:            private int constructType = Location.UNCLASSIFIED;
020:            private String systemId = null;
021:            private int lineNumber = -1;
022:            private int columnNumber = -1;
023:            private int objectNameCode = -1;
024:            private NamespaceResolver namespaceResolver;
025:            private HashMap properties = new HashMap(5);
026:
027:            public InstructionDetails() {
028:            }
029:
030:            /**
031:             * Set the type of construct
032:             */
033:
034:            public void setConstructType(int type) {
035:                constructType = type;
036:            }
037:
038:            /**
039:             * Get the construct type
040:             */
041:            public int getConstructType() {
042:                return constructType;
043:            }
044:
045:            /**
046:             * Set the namespace context for the instruction being traced. This is needed if the
047:             * tracelistener wants to evaluate XPath expressions in the context of the current instruction
048:             */
049:
050:            public void setNamespaceResolver(NamespaceResolver resolver) {
051:                namespaceResolver = resolver;
052:            }
053:
054:            /**
055:             * Get the namespace resolver to supply the namespace context of the instruction
056:             * that is being traced
057:             */
058:
059:            public NamespaceResolver getNamespaceResolver() {
060:                return namespaceResolver;
061:            }
062:
063:            /**
064:             * Set the URI of the module containing the instruction
065:             * @param systemId the module's URI
066:             */
067:
068:            public void setSystemId(String systemId) {
069:                this .systemId = systemId;
070:            }
071:
072:            /**
073:             * Get the URI of the module containing the instruction
074:             * @return the module's URI
075:             */
076:
077:            public String getSystemId() {
078:                return systemId;
079:            }
080:
081:            /**
082:             * Set the line number of the instruction within the module
083:             * @param lineNumber the line number
084:             */
085:
086:            public void setLineNumber(int lineNumber) {
087:                this .lineNumber = lineNumber;
088:            }
089:
090:            /**
091:             * Get the line number of the instruction within its module
092:             * @return the line number
093:             */
094:
095:            public int getLineNumber() {
096:                return lineNumber;
097:            }
098:
099:            /**
100:             * Set a name identifying the object of the expression, for example a function name, template name,
101:             * variable name, key name, element name, etc. This is used only where the name is known statically.
102:             */
103:
104:            public void setObjectNameCode(int nameCode) {
105:                objectNameCode = nameCode;
106:            }
107:
108:            /**
109:             * Get a name identifying the object of the expression, for example a function name, template name,
110:             * variable name, key name, element name, etc. This is used only where the name is known statically.
111:             */
112:
113:            public int getObjectNameCode() {
114:                return objectNameCode;
115:            }
116:
117:            /**
118:             * Set a named property of the instruction
119:             */
120:
121:            public void setProperty(String name, Object value) {
122:                properties.put(name, value);
123:            }
124:
125:            /**
126:             * Get a named property of the instruction
127:             */
128:
129:            public Object getProperty(String name) {
130:                return properties.get(name);
131:            }
132:
133:            /**
134:             * Get an iterator over all the properties available. The values returned by the iterator
135:             * will be of type String, and each string can be supplied as input to the getProperty()
136:             * method to retrieve the value of the property.
137:             */
138:
139:            public Iterator getProperties() {
140:                return properties.keySet().iterator();
141:            }
142:
143:            /**
144:             * Get the public ID of the module containing the instruction. This method
145:             * is provided to satisfy the SourceLocator interface. However, the public ID is
146:             * not maintained by Saxon, and the method always returns null
147:             * @return null
148:             */
149:
150:            public String getPublicId() {
151:                return null;
152:            }
153:
154:            /**
155:             * Set the column number
156:             */
157:
158:            public void setColumnNumber(int column) {
159:                columnNumber = column;
160:            }
161:
162:            /**
163:             * Get the column number identifying the position of the instruction.
164:             * @return -1 if column number is not known
165:             */
166:
167:            public int getColumnNumber() {
168:                return columnNumber;
169:            }
170:
171:            /**
172:             * Get a description of the instruction
173:             */
174:
175:            //    public String getDescription(NamePool pool) {
176:            //        switch (constructType) {
177:            //            case Location.INSTRUCTION:
178:            //                return pool.getDisplayName(instructionNameCode);
179:            //            case Location.LITERAL_RESULT_ELEMENT:
180:            //                return "element constructor <" + pool.getDisplayName(objectNameCode) + ">";
181:            //            case Location.LITERAL_RESULT_ATTRIBUTE:
182:            //                return "attribute constructor " + pool.getDisplayName(objectNameCode) + "=\"{...}\"";
183:            //            default:
184:            //                return "" + constructType;
185:            //        }
186:            //    }
187:            /**
188:             * Get the InstructionInfo details about the construct. This is to satisfy the InstructionInfoProvider
189:             * interface.
190:             */
191:
192:            public InstructionInfo getInstructionInfo() {
193:                return this ;
194:            }
195:
196:            public String getSystemId(int locationId) {
197:                return getSystemId();
198:            }
199:
200:            public int getLineNumber(int locationId) {
201:                return getLineNumber();
202:            }
203:        }
204:
205:        //
206:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
207:        // you may not use this file except in compliance with the License. You may obtain a copy of the
208:        // License at http://www.mozilla.org/MPL/
209:        //
210:        // Software distributed under the License is distributed on an "AS IS" basis,
211:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
212:        // See the License for the specific language governing rights and limitations under the License.
213:        //
214:        // The Original Code is: all this file.
215:        //
216:        // The Initial Developer of the Original Code is Michael H. Kay.
217:        //
218:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
219:        //
220:        // Contributor(s):
221:        // Portions marked "e.g." are from Edwin Glaser (edwin@pannenleiter.de)
222:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.