net.sf.joost.stx
Class FunctionTable

java.lang.Object
  extended bynet.sf.joost.stx.FunctionTable
All Implemented Interfaces:
Constants

public final class FunctionTable
extends Object
implements Constants

Wrapper class for all STXPath function implementations.

Version:
$Revision: 2.29 $ $Date: 2005/01/23 19:47:28 $
Author:
Oliver Becker

Nested Class Summary
static class FunctionTable.Avg
          The avg function.
static class FunctionTable.BooleanConv
          The boolean function.
static class FunctionTable.Ceiling
          The ceiling function.
static class FunctionTable.Concat
          The concat function.
static class FunctionTable.Contains
          The contains function.
static class FunctionTable.Count
          The count function.
static class FunctionTable.Empty
          The empty function.
static class FunctionTable.EndsWith
          The ends-with function.
static class FunctionTable.EscapeUri
          The escape-uri function.
static class FunctionTable.Exists
          The exists function.
static class FunctionTable.ExtensionFunction
          An instance of this class represents a Java extension function.
static class FunctionTable.ExtSequence
          The sequence extension function.
static class FunctionTable.False
          The false function.
static class FunctionTable.FilterAvailable
          The filter-available function.
static class FunctionTable.Floor
          The floor function.
static class FunctionTable.GetInScopePrefixes
          The get-in-scope-prefixes function.
static class FunctionTable.GetNamespaceUriForPrefix
          The get-namespace-uri-for-prefix function.
static class FunctionTable.HasChildNodes
          The has-child-nodes function.
static class FunctionTable.IndexOf
          The index-of function.
static class FunctionTable.InsertBefore
          The insert-before function.
static interface FunctionTable.Instance
          Type for all functions
static class FunctionTable.ItemAt
          The item-at function.
static class FunctionTable.LocalName
          The local-name function.
static class FunctionTable.Max
          The max function.
static class FunctionTable.Min
          The min function.
static class FunctionTable.Name
          The name function.
static class FunctionTable.NamespaceURI
          The namespace-uri function.
static class FunctionTable.NodeKind
          The node-kind function.
static class FunctionTable.NormalizeSpace
          The normalize-space function.
static class FunctionTable.Not
          The not function.
static class FunctionTable.NumberConv
          The number function.
static class FunctionTable.Position
          The position function.
static class FunctionTable.RegexGroup
          The regex-group function.
static class FunctionTable.Remove
          The remove function.
static class FunctionTable.Round
          The round function.
static class FunctionTable.StartsWith
          The starts-with function.
static class FunctionTable.StringConv
          The string function.
static class FunctionTable.StringJoin
          The string-join function.
static class FunctionTable.StringLength
          The string-length function.
static class FunctionTable.StringPad
          The string-pad function.
static class FunctionTable.Subsequence
          The subsequence function.
static class FunctionTable.Substring
          The substring function.
static class FunctionTable.SubstringAfter
          The substring-after function.
static class FunctionTable.SubstringBefore
          The substring-before function.
static class FunctionTable.Sum
          The sum function.
static class FunctionTable.Translate
          The translate function.
static class FunctionTable.True
          The true function.
 
Field Summary
private static String FNSP
           
private static Hashtable functionHash
          Contains one instance for each function.
private static String JENSP
           
 
Fields inherited from interface net.sf.joost.Constants
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS
 
Constructor Summary
FunctionTable()
           
 
Method Summary
static FunctionTable.Instance getFunction(String uri, String lName, String qName, Tree args, ParseContext pContext)
          Looks for a function implementation.
private static Value getOptionalValue(Context context, int top, Tree args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FNSP

private static String FNSP

JENSP

private static String JENSP

functionHash

private static Hashtable functionHash
Contains one instance for each function.

Constructor Detail

FunctionTable

public FunctionTable()
Method Detail

getFunction

public static FunctionTable.Instance getFunction(String uri,
                                                 String lName,
                                                 String qName,
                                                 Tree args,
                                                 ParseContext pContext)
                                          throws SAXParseException
Looks for a function implementation.

Parameters:
uri - URI of the expanded function name
lName - local function name
args - parameters (needed here just for counting)
pContext - the parse context
Returns:
the implementation instance for this function
Throws:
SAXParseException - if the function wasn't found or the number of parameters is wrong

getOptionalValue

private static Value getOptionalValue(Context context,
                                      int top,
                                      Tree args)
                               throws SAXException
Returns:
a value for an optional function argument. Either the argument was present, or the current item will be used.
Throws:
SAXException - from evaluating args