Package net.sourceforge.javautil.bytecode.api

Source Code of net.sourceforge.javautil.bytecode.api.BytecodeReferenceableAbstract

package net.sourceforge.javautil.bytecode.api;

import net.sourceforge.javautil.bytecode.api.type.method.BytecodeContextMethod;
import net.sourceforge.javautil.bytecode.api.type.method.invocation.MethodInvocation;

/**
* The base for most referenceables.
*
* @author elponderador
* @author $Author$
* @version $Id$
*/
public abstract class BytecodeReferenceableAbstract<C extends BytecodeContextMethod> implements IBytecodeReferenceable<C> {

  protected final TypeDescriptor descriptor;

  public BytecodeReferenceableAbstract(TypeDescriptor descriptor) {
    this.descriptor = descriptor;
  }

  public TypeDescriptor getType() { return this.descriptor; }

  public IBytecodeResolvable getType(C ctx) { return ctx.getResolutionPool().resolve(descriptor.getClassName()); }

  public MethodInvocation createInvocation(C context, String name, IBytecodeReferenceable... parameters) {
    return new MethodInvocation(this, this.getType(context).findMethod(context.getResolutionPool(), name, context.getTypes(parameters)), parameters);
  }
 
}
TOP

Related Classes of net.sourceforge.javautil.bytecode.api.BytecodeReferenceableAbstract

TOP
Copyright © 2018 www.massapi.com. 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.