The visitor pattern 例子

本文详细介绍了Javassist作为一个Java字节码转换工具包的使用方法,包括其版权许可和软件分发原则。文章涵盖了从基本的访问模式到特定节点的遍历方法,为开发者提供了一套全面的API使用指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


/*
* Javassist, a Java-bytecode translator toolkit.
* Copyright (C) 1999-2007 Shigeru Chiba. All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. Alternatively, the contents of this file may be used under
* the terms of the GNU Lesser General Public License Version 2.1 or later.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*/

package javassist.compiler.ast;

import javassist.compiler.CompileError;

/**
* The visitor pattern.
*
* @see ast.ASTree#accept(Visitor)
*
*
*/
public class Visitor {
public void atASTList(ASTList n) throws CompileError {}
public void atPair(Pair n) throws CompileError {}

public void atFieldDecl(FieldDecl n) throws CompileError {}
public void atMethodDecl(MethodDecl n) throws CompileError {}
public void atStmnt(Stmnt n) throws CompileError {}
public void atDeclarator(Declarator n) throws CompileError {}

public void atAssignExpr(AssignExpr n) throws CompileError {}
public void atCondExpr(CondExpr n) throws CompileError {}
public void atBinExpr(BinExpr n) throws CompileError {}
public void atExpr(Expr n) throws CompileError {}
public void atCallExpr(CallExpr n) throws CompileError {}
public void atCastExpr(CastExpr n) throws CompileError {}
public void atInstanceOfExpr(InstanceOfExpr n) throws CompileError {}
public void atNewExpr(NewExpr n) throws CompileError {}

public void atSymbol(Symbol n) throws CompileError {}
public void atMember(Member n) throws CompileError {}
public void atVariable(Variable n) throws CompileError {}
public void atKeyword(Keyword n) throws CompileError {}
public void atStringL(StringL n) throws CompileError {}
public void atIntConst(IntConst n) throws CompileError {}
public void atDoubleConst(DoubleConst n) throws CompileError {}
public void atArrayInit(ArrayInit n) throws CompileError {}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值