Package anvil.codec

Examples of anvil.codec.Method


 
 
  protected void compileEqualsMethod(ByteCompiler context, CompilableFunction function)
  {
    ClassRoom clazz = context.getClassRoom();
    Method method = clazz.createMethod("equals", "(Ljava/lang/Object;)Z", Code.ACC_PUBLIC);
    Code code = method.getCode();
    ConstantPool pool = code.getPool();
    context.pushCode(code);
    code.addLocal();
    code.aload(1);
    code.instance_of(context.TYPE_ANY);
View Full Code Here


  {
    ClassRoom clazz = context.getClassRoom();
    String name = getDescriptor();
    Field typefield = clazz.createField(name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("M_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    Method method = clazz.createMethod(name, getSignature(), ACC_PUBLIC);
    compileBody(context, method, typefield);
  }
View Full Code Here

  public void compileConstructor(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    ConstantPool pool = clazz.getPool();
    Method constructor = clazz.createConstructor("()V", ACC_PUBLIC);
    _constructor = constructor;
    Code code = constructor.getCode();

    StringBuffer clsid = new StringBuffer();
    clsid.append("$Id: ");
    clsid.append(_address.getPathinfo());
    clsid.append(" 1.0 ");
    LocalizationPreferences prefs = _address.getZone().getLocalizationPreferences();
    Calendar cal = Calendar.getInstance(prefs.getTimezoneInstance(), prefs.getLocaleInstance());
    anvil.util.Conversions.toString(clsid, cal);
    Field clsidfield = clazz.createField("_id", "Ljava/lang/String;", ACC_PUBLIC|ACC_STATIC|ACC_FINAL);
    clsidfield.setConstantValue(pool.addString(clsid.toString()));

    context.pushCode(code);
    code.self();
    code.invokespecial(pool.addMethodRef("anvil/script/compiler/CompiledModule",
      "<init>", "()V"));
    context.popCode();
   
    Method versionmethod = clazz.createMethod("getVersion", "()I", ACC_PUBLIC);
    code = versionmethod.getCode();
    context.pushCode(code);
    code.iconst(_envelope.getVersion());
    code.ireturn();

    clazz.createField("_module", "Lanvil/script/compiler/CompiledModule;", ACC_PUBLIC|ACC_STATIC);
View Full Code Here

   
 
  public void compileInit(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    Method method = clazz.createMethod("init", "(Lanvil/script/Context;)V", ACC_PUBLIC|ACC_FINAL|ACC_SYNCHRONIZED);
    Code code = method.getCode();
    context.pushCode(code);
    code.addLocal();
    if (_init != null) {
      _init.compile(context);
    }
View Full Code Here

TOP

Related Classes of anvil.codec.Method

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.