org.jboss.joinpoint.plugins.config
Class Config

java.lang.Object
  extended byorg.jboss.joinpoint.plugins.config.Config

public class Config
extends Object

Config utilities.

Version:
$Revision: 1.9 $
Author:
Adrian Brock

Field Summary
protected static org.jboss.logging.Logger log
          The log
 
Constructor Summary
Config()
           
 
Method Summary
static void configure(Object object, JoinpointFactory jpf, String name, Object value)
          Configure a field
static boolean equals(String[] typeNames, TypeInfo[] typeInfos)
          Test whether type names are equal to type infos
static ConstructorInfo findConstructorInfo(ClassInfo classInfo, String[] paramTypes)
          Find constructor info
static FieldInfo findFieldInfo(ClassInfo classInfo, String name)
          Find field info
static MethodInfo findMethodInfo(ClassInfo classInfo, String name, String[] paramTypes)
          Find method info
static ConstructorJoinpoint getConstructorJoinpoint(JoinpointFactory jpf, String[] paramTypes, Object[] params, Map metadata)
          Get a constructor Joinpoint
static FieldGetJoinpoint getFieldGetJoinpoint(Object object, JoinpointFactory jpf, String name)
          Get a field get joinpoint
static FieldSetJoinpoint getFieldSetJoinpoint(Object object, JoinpointFactory jpf, String name, Object value)
          Get a field set joinpoint
static MethodJoinpoint getMethodJoinpoint(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params)
          Get a method joinpoint
static Object instantiate(JoinpointFactory jpf, String[] paramTypes, Object[] params, Map metadata)
          Instantiate an object
static Object invoke(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params)
          Invoke a method
static void unconfigure(Object object, JoinpointFactory jpf, String name)
          Unconfigure a field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.jboss.logging.Logger log
The log

Constructor Detail

Config

public Config()
Method Detail

instantiate

public static Object instantiate(JoinpointFactory jpf,
                                 String[] paramTypes,
                                 Object[] params,
                                 Map metadata)
                          throws Throwable
Instantiate an object

Parameters:
jpf - the join point factory
paramTypes - the parameter types
params - the parameters
metadata - TODO more undocumented rubbish
Returns:
the instantiated object
Throws:
Throwable - for any error

configure

public static void configure(Object object,
                             JoinpointFactory jpf,
                             String name,
                             Object value)
                      throws Throwable
Configure a field

Parameters:
object - the object to configure
jpf - the join point factory
name - the name of the field
value - the value
Throws:
Throwable - for any error

unconfigure

public static void unconfigure(Object object,
                               JoinpointFactory jpf,
                               String name)
                        throws Throwable
Unconfigure a field

Parameters:
object - the object to unconfigure
jpf - the join point factory
name - the name of the field
Throws:
Throwable - for any error

invoke

public static Object invoke(Object object,
                            JoinpointFactory jpf,
                            String name,
                            String[] paramTypes,
                            Object[] params)
                     throws Throwable
Invoke a method

Parameters:
object - the object to invoke
jpf - the join point factory
name - the name of the method
paramTypes - the parameter types
params - the parameters
Returns:
the result of the invocation
Throws:
Throwable - for any error

getConstructorJoinpoint

public static ConstructorJoinpoint getConstructorJoinpoint(JoinpointFactory jpf,
                                                           String[] paramTypes,
                                                           Object[] params,
                                                           Map metadata)
                                                    throws Throwable
Get a constructor Joinpoint

Parameters:
jpf - the join point factory
paramTypes - the parameter types
params - the parameters
metadata -
Returns:
the Joinpoint
Throws:
Throwable - for any error

getFieldGetJoinpoint

public static FieldGetJoinpoint getFieldGetJoinpoint(Object object,
                                                     JoinpointFactory jpf,
                                                     String name)
                                              throws Throwable
Get a field get joinpoint

Parameters:
object - the object to configure
jpf - the join point factory
name - the name of the field
Returns:
the Joinpoint
Throws:
Throwable - for any error

getFieldSetJoinpoint

public static FieldSetJoinpoint getFieldSetJoinpoint(Object object,
                                                     JoinpointFactory jpf,
                                                     String name,
                                                     Object value)
                                              throws Throwable
Get a field set joinpoint

Parameters:
object - the object to configure
jpf - the join point factory
name - the name of the field
value - the value
Returns:
the Joinpoint
Throws:
Throwable - for any error

getMethodJoinpoint

public static MethodJoinpoint getMethodJoinpoint(Object object,
                                                 JoinpointFactory jpf,
                                                 String name,
                                                 String[] paramTypes,
                                                 Object[] params)
                                          throws Throwable
Get a method joinpoint

Parameters:
object - the object to invoke
jpf - the join point factory
name - the name of the method
paramTypes - the parameter types
params - the parameters
Returns:
the join point
Throws:
Throwable - for any error

findConstructorInfo

public static ConstructorInfo findConstructorInfo(ClassInfo classInfo,
                                                  String[] paramTypes)
                                           throws JoinpointException
Find constructor info

Parameters:
classInfo - the class info
paramTypes - the parameter types
Returns:
the constructor info
Throws:
JoinpointException - when no such constructor

findFieldInfo

public static FieldInfo findFieldInfo(ClassInfo classInfo,
                                      String name)
                               throws JoinpointException
Find field info

Parameters:
classInfo - the class info
name - the field name
Returns:
the field info
Throws:
JoinpointException - when no such field

findMethodInfo

public static MethodInfo findMethodInfo(ClassInfo classInfo,
                                        String name,
                                        String[] paramTypes)
                                 throws JoinpointException
Find method info

Parameters:
classInfo - the class info
name - the method name
paramTypes - the parameter types
Returns:
the method info
Throws:
JoinpointException - when no such method

equals

public static boolean equals(String[] typeNames,
                             TypeInfo[] typeInfos)
Test whether type names are equal to type infos

Parameters:
typeNames - the type names
typeInfos - the type infos
Returns:
true when they are equal


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.