/* * Copyright 2008 Wishnu Prasetya. * * This file is part of T2. * T2 is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License (GPL) as published by the * Free Software Foundation; either version 3 of the License, or any * later version. * * T2 is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * A copy of the GNU General Public License can be found in T2 distribution. * If it is missing, see http://www.gnu.org/licenses. */ package t2ext.trace.utils; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import Sequenic.T2.Pool; import Sequenic.T2.Seq.CALL_METHOD; import Sequenic.T2.Seq.TraceStep; /** * @author Maaike Gerritsen */ public class TraceStepAnalysis { private TraceStep _traceStep; private boolean _callMethod; private Method _method; private List _pathIds; private List _specPathIds; private Pool _pool; private Object _targetObject; private String _methodName; private List _fields; public TraceStepAnalysis(TraceStep step){ _traceStep = step; if(_traceStep instanceof CALL_METHOD){ // System.out.println("method name: "+step.getName()); _callMethod = true; CALL_METHOD methodStep = (CALL_METHOD) _traceStep; _method = methodStep.method; } _pathIds = new ArrayList(); _specPathIds = new ArrayList(); } public void setModidfiedFields(List fields){ _fields = fields; } public List getFields(){ return _fields; } public List getSpecPathIds(){ return _specPathIds; } public void setSpecPathIds(List list){ _specPathIds = new ArrayList(list); } public void setPoolAndObject(Pool pool, int objectIndex){ _pool = pool; _targetObject = _pool.get(objectIndex); } public TraceStep getTraceStep() { return _traceStep; } public Method getMethod() { return _method; } public boolean isCallMethod(){ return _callMethod; } public List getPathIds() { return _pathIds; } public void setPathIds(List ids){ _pathIds = ids; } public Pool getPool() { return _pool; } public Object getTargetObject() { return _targetObject; } public String getMethodName() { return _methodName; } public void setMethodName(String methodName) { _methodName = methodName; } }