Package javassist

Examples of javassist.ClassMap


    // For LRC we just use the standard Java Proxies
    private JdbcJavaProxyFactory lrcProxyFactory;

    JdbcJavassistProxyFactory() {
        classMap = new ClassMap();
        ClassPool defaultPool = ClassPool.getDefault();
        classPool = new ClassPool(defaultPool);
        classPool.insertClassPath(new ClassClassPath(this.getClass()));
        classPool.childFirstLookup = true;
View Full Code Here


    // For LRC we just use the standard Java Proxies
    private JdbcJavaProxyFactory lrcProxyFactory;

    JdbcJavassistProxyFactory() {
        classMap = new ClassMap();
        ClassPool defaultPool = ClassPool.getDefault();
        classPool = new ClassPool(defaultPool);
        classPool.insertClassPath(new ClassClassPath(this.getClass()));
        classPool.childFirstLookup = true;
View Full Code Here

      PatchLog.severe("Missing required attributes for replaceMethod");
    }
  }

  private void replaceMethod(CtMethod oldMethod, CtMethod newMethod) throws CannotCompileException, BadBytecode {
    ClassMap classMap = new ClassMap();
    classMap.put(newMethod.getDeclaringClass().getName(), oldMethod.getDeclaringClass().getName());
    oldMethod.setBody(newMethod, classMap);
    oldMethod.getMethodInfo().rebuildStackMap(classPool);
    oldMethod.getMethodInfo().rebuildStackMapForME(classPool);
  }
View Full Code Here

  )
  public void addAll(CtClass ctClass, Map<String, String> attributes) throws NotFoundException, CannotCompileException, BadBytecode {
    String fromClass = attributes.get("fromClass");
    CtClass from = classPool.get(fromClass);
    transformClassStaticMethods(from, ctClass.getName());
    ClassMap classMap = new ClassMap();
    classMap.put(fromClass, ctClass.getName());
    for (CtField ctField : from.getDeclaredFields()) {
      if (!ctField.getName().isEmpty() && ctField.getName().charAt(ctField.getName().length() - 1) == '_') {
        ctField.setName(ctField.getName().substring(0, ctField.getName().length() - 1));
      }
      CtClass expectedType = ctField.getType();
View Full Code Here

public class ClassRenamer
{
  public static void renameClasses( CtClass c, Map<ClassEntry,ClassEntry> map )
  {
    // build the map used by javassist
    ClassMap nameMap = new ClassMap();
    for( Map.Entry<ClassEntry,ClassEntry> entry : map.entrySet() )
    {
      nameMap.put( entry.getKey().getName(), entry.getValue().getName() );
    }
   
    c.replaceClassName( nameMap );
   
    // replace simple names in the InnerClasses attribute too
View Full Code Here

 
  public static Set<ClassEntry> getAllClassEntries( final CtClass c )
  {
    // get the classes that javassist knows about
    final Set<ClassEntry> entries = Sets.newHashSet();
    ClassMap map = new ClassMap( )
    {
      @Override
      public Object get( Object obj )
      {
        if( obj instanceof String )
View Full Code Here

TOP

Related Classes of javassist.ClassMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.