01: package net.sf.saxon.trace;
02:
03: import net.sf.saxon.event.SaxonLocator;
04: import net.sf.saxon.om.NamespaceResolver;
05:
06: import java.util.Iterator;
07:
08: /**
09: * Information about an instruction in the stylesheet, made
10: * available at run-time to a TraceListener
11: */
12:
13: public interface InstructionInfo extends SaxonLocator {
14:
15: /**
16: * Get the type of construct. This will either be the fingerprint of a standard XSLT instruction name
17: * (values in {@link net.sf.saxon.style.StandardNames}: all less than 1024)
18: * or it will be a constant in class {@link Location}.
19: */
20:
21: public int getConstructType();
22:
23: /**
24: * Get a name identifying the object of the expression, for example a function name, template name,
25: * variable name, key name, element name, etc. This is used only where the name is known statically.
26: */
27:
28: public int getObjectNameCode();
29:
30: /**
31: * Get the system identifier (URI) of the source stylesheet or query module containing
32: * the instruction. This will generally be an absolute URI. If the system
33: * identifier is not known, the method may return null. In some cases, for example
34: * where XML external entities are used, the correct system identifier is not
35: * always retained.
36: */
37:
38: public String getSystemId();
39:
40: /**
41: * Get the line number of the instruction in the source stylesheet module.
42: * If this is not known, or if the instruction is an artificial one that does
43: * not relate to anything in the source code, the value returned may be -1.
44: */
45:
46: public int getLineNumber();
47:
48: /**
49: * Get the namespace context of the instruction. This will not always be available, in which
50: * case the method returns null.
51: */
52:
53: public NamespaceResolver getNamespaceResolver();
54:
55: /**
56: * Get the value of a particular property of the instruction. Properties
57: * of XSLT instructions are generally known by the name of the stylesheet attribute
58: * that defines them.
59: * @param name The name of the required property
60: * @return The value of the requested property, or null if the property is not available
61: */
62:
63: public Object getProperty(String name);
64:
65: /**
66: * Get an iterator over all the properties available. The values returned by the iterator
67: * will be of type String, and each string can be supplied as input to the getProperty()
68: * method to retrieve the value of the property. The iterator may return properties whose
69: * value is null.
70: */
71:
72: public Iterator getProperties();
73:
74: }
75:
76: //
77: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
78: // you may not use this file except in compliance with the License. You may obtain a copy of the
79: // License at http://www.mozilla.org/MPL/
80: //
81: // Software distributed under the License is distributed on an "AS IS" basis,
82: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
83: // See the License for the specific language governing rights and limitations under the License.
84: //
85: // The Original Code is: all this file.
86: //
87: // The Initial Developer of the Original Code is Michael H. Kay
88: //
89: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
90: //
91: // Contributor(s): none.
92: //
|