Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.apache.xalan.extensions
Class MethodResolver

    java.lang.Object
      |
      +--weblogic.apache.xalan.extensions.MethodResolver

public class MethodResolver
extends java.lang.Object

Utility class to help resolve method overloading with Xalan XSLT argument types.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Field Summary
`static int` | `DYNAMIC` Specifies a Dynamic method search.
`static int` | `INSTANCE_ONLY` Specifies a search for instance methods only.
`static int` | `STATIC_AND_INSTANCE` Specifies a search for both static and instance methods.
`static int` | `STATIC_ONLY` Specifies a search for static methods only.

Constructor Summary
`MethodResolver()`

Method Summary
`static void` | `convertParams(java.lang.Object[] argsIn, java.lang.Object[][] argsOut, java.lang.Class[] paramTypes, ExpressionContext exprContext)` Convert a set of parameters based on a set of paramTypes.
`static java.lang.reflect.Constructor` | `getConstructor(java.lang.Class classObj, java.lang.Object[] argsIn, java.lang.Object[][] argsOut, ExpressionContext exprContext)` Given a class, figure out the resolution of the Java Constructor from the XSLT argument types, and perform the conversion of the arguments.
`static java.lang.reflect.Method` | `getElementMethod(java.lang.Class classObj, java.lang.String name)` Given the name of a method, figure out the resolution of the Java Method
`static java.lang.reflect.Method` | `getMethod(java.lang.Class classObj, java.lang.String name, java.lang.Object[] argsIn, java.lang.Object[][] argsOut, ExpressionContext exprContext, int searchMethod)` Given the name of a method, figure out the resolution of the Java Method from the XSLT argument types, and perform the conversion of the arguments.
`static int` | `scoreMatch(java.lang.Class[] javaParamTypes, int javaParamsStart, java.lang.Object[] xsltArgs, int score)` Score the conversion of a set of XSLT arguments to a given set of Java parameters.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### STATIC_ONLY

    public static final int STATIC_ONLY

  Specifies a search for static methods only.

### INSTANCE_ONLY

    public static final int INSTANCE_ONLY

  Specifies a search for instance methods only.

### STATIC_AND_INSTANCE

    public static final int STATIC_AND_INSTANCE

  Specifies a search for both static and instance methods.

### DYNAMIC

    public static final int DYNAMIC

  Specifies a Dynamic method search. If the method being evaluated is a static method, all arguments are used. Otherwise, it is an instance method and only arguments beginning with the second argument are used.

Constructor Detail

### MethodResolver

    public MethodResolver()

Method Detail

### getConstructor

    public static java.lang.reflect.Constructor getConstructor(java.lang.Class classObj,
                                                               java.lang.Object[] argsIn,
                                                               java.lang.Object[][] argsOut,
                                                               ExpressionContext exprContext)
                                                        throws java.lang.NoSuchMethodException,
                                                               java.lang.SecurityException,
                                                               javax.xml.transform.TransformerException

  Given a class, figure out the resolution of the Java Constructor from the XSLT argument types, and perform the conversion of the arguments.

  Parameters:
    `classObj` - the Class of the object to be constructed.
    `argsIn` - An array of XSLT/XPath arguments.
    `argsOut` - An array of the exact size as argsIn, which will be populated with converted arguments if a suitable method is found.
  Returns:
    A constructor that will work with the argsOut array.
  Throws:
    javax.xml.transform.TransformerException - may be thrown for Xalan conversion exceptions.

### getMethod

    public static java.lang.reflect.Method getMethod(java.lang.Class classObj,
                                                     java.lang.String name,
                                                     java.lang.Object[] argsIn,
                                                     java.lang.Object[][] argsOut,
                                                     ExpressionContext exprContext,
                                                     int searchMethod)
                                              throws java.lang.NoSuchMethodException,
                                                     java.lang.SecurityException,
                                                     javax.xml.transform.TransformerException

  Given the name of a method, figure out the resolution of the Java Method from the XSLT argument types, and perform the conversion of the arguments.

  Parameters:
    `classObj` - The Class of the object that should have the method.
    `name` - The name of the method to be invoked.
    `argsIn` - An array of XSLT/XPath arguments.
    `argsOut` - An array of the exact size as argsIn, which will be populated with converted arguments if a suitable method is found.
  Returns:
    A method that will work with the argsOut array.
  Throws:
    javax.xml.transform.TransformerException - may be thrown for Xalan conversion exceptions.

### getElementMethod

    public static java.lang.reflect.Method getElementMethod(java.lang.Class classObj,
                                                            java.lang.String name)
                                                     throws java.lang.NoSuchMethodException,
                                                            java.lang.SecurityException,
                                                            javax.xml.transform.TransformerException

  Given the name of a method, figure out the resolution of the Java Method

  Parameters:
    `classObj` - The Class of the object that should have the method.
    `name` - The name of the method to be invoked.
  Returns:
    A method that will work to be called as an element.
  Throws:
    javax.xml.transform.TransformerException - may be thrown for Xalan conversion exceptions.

### convertParams

    public static void convertParams(java.lang.Object[] argsIn,
                                     java.lang.Object[][] argsOut,
                                     java.lang.Class[] paramTypes,
                                     ExpressionContext exprContext)
                              throws javax.xml.transform.TransformerException

  Convert a set of parameters based on a set of paramTypes.

  Parameters:
    `argsIn` - An array of XSLT/XPath arguments.
    `argsOut` - An array of the exact size as argsIn, which will be populated with converted arguments.
    `paramTypes` - An array of class objects, of the exact same size as argsIn and argsOut.
  Throws:
    javax.xml.transform.TransformerException - may be thrown for Xalan conversion exceptions.

### scoreMatch

    public static int scoreMatch(java.lang.Class[] javaParamTypes,
                                 int javaParamsStart,
                                 java.lang.Object[] xsltArgs,
                                 int score)

  Score the conversion of a set of XSLT arguments to a given set of Java parameters. If any invocations of this function for a method with the same name return the same positive value, then a conflict has occured, and an error should be signaled.

  Parameters:
    `javaParamTypes` - Must be filled with valid class names, and of the same length as xsltArgs.
    `xsltArgs` - Must be filled with valid object instances, and of the same length as javeParamTypes.
  Returns:
    -1 for no allowed conversion, or a positive score that is closer to zero for more preferred, or further from zero for less preferred.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs70
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference