<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Tue Sep 18 10:25:45 GMT+01:00 2001 --> <TITLE> : Class Pattern </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_top"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/icl/saxon/pattern/NoNodeTest.html"><B>PREV CLASS</B></A> <A HREF="../../../../com/icl/saxon/pattern/UnionPattern.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Pattern.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.icl.saxon.pattern</FONT> <BR> Class Pattern</H2> <PRE> java.lang.Object | +--<B>com.icl.saxon.pattern.Pattern</B> </PRE> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../com/icl/saxon/pattern/IDPattern.html">IDPattern</A>, <A HREF="../../../../com/icl/saxon/pattern/KeyPattern.html">KeyPattern</A>, <A HREF="../../../../com/icl/saxon/pattern/LocationPathPattern.html">LocationPathPattern</A>, <A HREF="../../../../com/icl/saxon/pattern/NodeTest.html">NodeTest</A>, <A HREF="../../../../com/icl/saxon/pattern/UnionPattern.html">UnionPattern</A></DD> </DL> <HR> <DL> <DT>public abstract class <B>Pattern</B><DT>extends java.lang.Object</DL> <P> A Pattern represents the result of parsing an XSLT pattern string. <br> Patterns are created by calling the static method Pattern.make(string). <br> The pattern is used to test a particular node by calling match(). <P> <HR> <P> <!-- ======== INNER CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#originalText">originalText</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#staticContext">staticContext</A></B></CODE> <BR> </TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#Pattern()">Pattern</A></B>()</CODE> <BR> </TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#getDefaultPriority()">getDefaultPriority</A></B>()</CODE> <BR> Determine the default priority to use if this pattern appears as a match pattern for a template with no explicit priority attribute.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#getFingerprint()">getFingerprint</A></B>()</CODE> <BR> Determine the name fingerprint of nodes to which this pattern applies.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#getLineNumber()">getLineNumber</A></B>()</CODE> <BR> Get the line number on which the pattern was defined</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#getNodeType()">getNodeType</A></B>()</CODE> <BR> Determine the types of nodes to which this pattern applies.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#getStaticContext()">getStaticContext</A></B>()</CODE> <BR> Determine the static context used when the pattern was parsed</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#getSystemId()">getSystemId</A></B>()</CODE> <BR> Get the system id of the entity in which the pattern occurred</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../com/icl/saxon/pattern/Pattern.html">Pattern</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#make(java.lang.String, com.icl.saxon.expr.StaticContext)">make</A></B>(java.lang.String pattern, <A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A> env)</CODE> <BR> Static method to make a Pattern by parsing a String.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>abstract boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#matches(com.icl.saxon.om.NodeInfo, com.icl.saxon.Context)">matches</A></B>(<A HREF="../../../../com/icl/saxon/om/NodeInfo.html">NodeInfo</A> node, <A HREF="../../../../com/icl/saxon/Context.html">Context</A> context)</CODE> <BR> Determine whether this Pattern matches the given Node</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#setOriginalText(java.lang.String)">setOriginalText</A></B>(java.lang.String text)</CODE> <BR> Set the original text of the pattern for use in diagnostics</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#setStaticContext(com.icl.saxon.expr.StaticContext)">setStaticContext</A></B>(<A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A> sc)</CODE> <BR> Set the static context used when the pattern was parsed</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/icl/saxon/pattern/Pattern.html">Pattern</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#simplify()">simplify</A></B>()</CODE> <BR> Simplify the pattern by applying any context-independent optimisations.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/pattern/Pattern.html#toString()">toString</A></B>()</CODE> <BR> Get the original pattern text</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.Object</B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Field Detail</B></FONT></TD> </TR> </TABLE> <A NAME="staticContext"><!-- --></A><H3> staticContext</H3> <PRE> protected <A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A> <B>staticContext</B></PRE> <DL> </DL> <HR> <A NAME="originalText"><!-- --></A><H3> originalText</H3> <PRE> protected java.lang.String <B>originalText</B></PRE> <DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="Pattern()"><!-- --></A><H3> Pattern</H3> <PRE> public <B>Pattern</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="make(java.lang.String, com.icl.saxon.expr.StaticContext)"><!-- --></A><H3> make</H3> <PRE> public static <A HREF="../../../../com/icl/saxon/pattern/Pattern.html">Pattern</A> <B>make</B>(java.lang.String pattern, <A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A> env) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html">XPathException</A></PRE> <DL> <DD>Static method to make a Pattern by parsing a String. <br><DD><DL> <DT><B>Parameters:</B><DD><CODE>pattern</CODE> - The pattern text as a String<DD><CODE>env</CODE> - An object defining the compile-time context for the expression<DT><B>Returns:</B><DD>The pattern object</DL> </DD> </DL> <HR> <A NAME="setOriginalText(java.lang.String)"><!-- --></A><H3> setOriginalText</H3> <PRE> public void <B>setOriginalText</B>(java.lang.String text)</PRE> <DL> <DD>Set the original text of the pattern for use in diagnostics</DL> <HR> <A NAME="simplify()"><!-- --></A><H3> simplify</H3> <PRE> public <A HREF="../../../../com/icl/saxon/pattern/Pattern.html">Pattern</A> <B>simplify</B>() throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html">XPathException</A></PRE> <DL> <DD>Simplify the pattern by applying any context-independent optimisations. Default implementation does nothing.<DD><DL> <DT><B>Returns:</B><DD>the optimised Pattern</DL> </DD> </DL> <HR> <A NAME="setStaticContext(com.icl.saxon.expr.StaticContext)"><!-- --></A><H3> setStaticContext</H3> <PRE> public final void <B>setStaticContext</B>(<A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A> sc)</PRE> <DL> <DD>Set the static context used when the pattern was parsed</DL> <HR> <A NAME="getStaticContext()"><!-- --></A><H3> getStaticContext</H3> <PRE> public <A HREF="../../../../com/icl/saxon/expr/StaticContext.html">StaticContext</A> <B>getStaticContext</B>()</PRE> <DL> <DD>Determine the static context used when the pattern was parsed</DL> <HR> <A NAME="matches(com.icl.saxon.om.NodeInfo, com.icl.saxon.Context)"><!-- --></A><H3> matches</H3> <PRE> public abstract boolean <B>matches</B>(<A HREF="../../../../com/icl/saxon/om/NodeInfo.html">NodeInfo</A> node, <A HREF="../../../../com/icl/saxon/Context.html">Context</A> context) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html">XPathException</A></PRE> <DL> <DD>Determine whether this Pattern matches the given Node<DD><DL> <DT><B>Parameters:</B><DD><CODE>node</CODE> - The NodeInfo representing the Element or other node to be tested against the Pattern<DD><CODE>context</CODE> - The context in which the match is to take place. Only relevant if the pattern uses variables.<DT><B>Returns:</B><DD>true if the node matches the Pattern, false otherwise</DL> </DD> </DL> <HR> <A NAME="getNodeType()"><!-- --></A><H3> getNodeType</H3> <PRE> public short <B>getNodeType</B>()</PRE> <DL> <DD>Determine the types of nodes to which this pattern applies. Used for optimisation. For patterns that match nodes of several types, return NodeInfo.NODE<DD><DL> <DT><B>Returns:</B><DD>the type of node matched by this pattern. e.g. NodeInfo.ELEMENT or NodeInfo.TEXT</DL> </DD> </DL> <HR> <A NAME="getFingerprint()"><!-- --></A><H3> getFingerprint</H3> <PRE> public int <B>getFingerprint</B>()</PRE> <DL> <DD>Determine the name fingerprint of nodes to which this pattern applies. Used for optimisation.<DD><DL> <DT><B>Returns:</B><DD>A fingerprint that the nodes must match, or null Otherwise return null.</DL> </DD> </DL> <HR> <A NAME="getDefaultPriority()"><!-- --></A><H3> getDefaultPriority</H3> <PRE> public double <B>getDefaultPriority</B>()</PRE> <DL> <DD>Determine the default priority to use if this pattern appears as a match pattern for a template with no explicit priority attribute.</DL> <HR> <A NAME="getSystemId()"><!-- --></A><H3> getSystemId</H3> <PRE> public java.lang.String <B>getSystemId</B>()</PRE> <DL> <DD>Get the system id of the entity in which the pattern occurred</DL> <HR> <A NAME="getLineNumber()"><!-- --></A><H3> getLineNumber</H3> <PRE> public int <B>getLineNumber</B>()</PRE> <DL> <DD>Get the line number on which the pattern was defined</DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public java.lang.String <B>toString</B>()</PRE> <DL> <DD>Get the original pattern text<DD><DL> <DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/icl/saxon/pattern/NoNodeTest.html"><B>PREV CLASS</B></A> <A HREF="../../../../com/icl/saxon/pattern/UnionPattern.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Pattern.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> </BODY> </HTML>