⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getresponse.java

📁 A framework written in Java for implementing high-level and dynamic languages, compiling them into J
💻 JAVA
字号:
// Copyright (c) 2001  Per M.A. Bothner and Brainfood Inc.// This is free software;  for terms and warranty disclaimer see ./COPYING.package gnu.kawa.servlet;import gnu.lists.*;import gnu.mapping.*;import gnu.bytecode.*;import gnu.expr.*;/** A 0-argument function that returns the current ServletResponse. */public class GetResponse extends MethodProc implements Inlineable{  public static final GetResponse getResponse = new GetResponse();  public static javax.servlet.http.HttpServletResponse getResponse(CallContext ctx)  {    return ((ServletCallContext) ctx).response;  }  public int numArgs() { return 0; }  public void apply (CallContext ctx)  {    ctx.lastArg();    ctx.consumer.writeObject(((ServletCallContext) ctx).response);  }  public void compile (ApplyExp exp, Compilation comp, Target target)  {    Expression[] args = exp.getArgs();    if (args.length != 0 || ! comp.curLambda.isHandlingTailCalls())      {	ApplyExp.compile(exp, comp, target);	return;      }    CodeAttr code = comp.getCode();    comp.loadCallContext();    code.emitInvokeStatic(typeGetResponse.getDeclaredMethod("getResponse", 1));    target.compileFromStack(comp, typeHttpServletResponse);  }  public Type getReturnType (Expression[] args)  {    return typeHttpServletResponse;  }  public static final ClassType typeGetResponse    = ClassType.make("gnu.kawa.servlet.GetResponse");  public static final ClassType typeHttpServletResponse  = ClassType.make("javax.servlet.http.HttpServletResponse");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -