Package net.sourceforge.javautil.bytecode.api

Examples of net.sourceforge.javautil.bytecode.api.TypeMemberAccess


   * @param type The type of the field
   * @param initialValue The initial value
   * @return The delcaration for the field
   */
  public IBytecodeField addStaticField (String name, Class type, Scope scope, boolean isFinal, IBytecodeReferenceable defaultValue) {
    this.fields.put(name, new BytecodeFieldDeclaration(name, new TypeMemberAccess(scope, false, true, isFinal), this, TypeDescriptor.getFor(type)));

    if (defaultValue != null)
      this.defaultStaticValues.put(name, defaultValue);
   
    return this.fields.get(name);
View Full Code Here


    }
   
    final BytecodeEmbedded cinit = this.getClassInitializer();
   
    if (cinit != null || this.defaultStaticValues.size() > 0) {
      BytecodeMethodConcrete clinit = new BytecodeMethodConcrete(this, "<clinit>", new TypeMemberAccess(Scope.Private, false, true, true),
        new MethodDescriptor(false, void.class, new Class[0], new Class[0]));
     
      clinit.setMethodBody(new BytecodeBlock() {
       
        @Override protected void writeInstructions(BytecodeContextMethod context) {
View Full Code Here

* @version $Id$
*/
public class JavaClassAbstract<C extends BytecodeContextType> extends JavaClass<C> {

  public JavaClassAbstract(BytecodeCompiler compiler, String name, Scope scope, boolean isStatic, boolean isFinal) {
    super(compiler, name, new TypeMemberAccess(scope, true, isStatic, isFinal));
  }
View Full Code Here

   * @param returnType The return type, or null if void
   * @param parameterTypes The types of parameters the method accepts
   * @return The abstract method
   */
  public BytecodeMethodAbstract addMethod (String name, boolean varArgs, Scope scope, String returnType, String... parameterTypes) {
    this.methods.add(new BytecodeMethodAbstract(this, name, new TypeMemberAccess(scope, true, false, false),
      new MethodDescriptor(varArgs, returnType, parameterTypes)));
    return (BytecodeMethodAbstract) this.methods.get(methods.size()-1);
  }
View Full Code Here

* @version $Id$
*/
public class JavaClassConcrete<C extends BytecodeContextType> extends JavaClass<C> {

  public JavaClassConcrete(BytecodeCompiler compiler, String name, Scope scope, boolean isStatic, boolean isFinal) {
    super(compiler, name, new TypeMemberAccess(scope, false, isStatic, isFinal));
  }
View Full Code Here

* @version $Id$
*/
public class JavaInterface<C extends BytecodeContextType> extends AbstractType<C> {

  public JavaInterface(BytecodeCompiler compiler, String name, Scope scope, boolean isStatic, boolean isFinal) {
    super(compiler, name, new TypeMemberAccess(scope, true, isStatic, isFinal), ClassType.Interface);
  }
View Full Code Here

   * @param returnType The return type, or null if void
   * @param parameterTypes The types of parameters the method accepts
   * @return The abstract method
   */
  public BytecodeMethodAbstract addMethod (String name, boolean varArgs, String returnType, String... parameterTypes) {
    this.methods.add(new BytecodeMethodAbstract(this, name, new TypeMemberAccess(Scope.Public, true, false, false),
      new MethodDescriptor(varArgs, returnType, null, parameterTypes)));
    return (BytecodeMethodAbstract) this.methods.get(methods.size()-1);
  }
View Full Code Here

   * @param isFinal True if the field is final, otherwise false
   * @return The new field declaration
   */
  public IBytecodeField addInstanceField (String name, TypeDescriptor type, Scope scope, boolean isFinal) {
    this.fields.put(name, new BytecodeFieldDeclaration(
      name, new TypeMemberAccess(scope, false, false, isFinal), this, type)
    );
    return this.fields.get(name);
  }
View Full Code Here

   * @param varArgs True if the last argument is an array and can be used as var args
   * @param parameters The parameters for the constructor
   * @return The new constructor
   */
  public BytecodeConstructorBase addConstructor (Scope scope, boolean varArgs, TypeDescriptor... parameters) {
    this.constructors.add(new BytecodeConstructorBase(this, new TypeMemberAccess(scope, false, false, false),
      varArgs, parameters));
    return this.constructors.get(constructors.size()-1);
  }
View Full Code Here

   * @param isFinal True if the method is final, otherwise false
   * @param descriptor The descriptor for the method return type and parameters
   * @return The new method
   */
  public BytecodeMethodConcrete addMethod (String name, Scope scope, boolean isStatic, boolean isFinal, MethodDescriptor descriptor) {
    return this.addMethod(name, new TypeMemberAccess(scope, false, isStatic, isFinal), descriptor);
  }
View Full Code Here

TOP

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

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.