Examples of ExprEditor


Examples of javassist.expr.ExprEditor

            final CtClass ctClass = klass.getCtClass();
            ClassInfo classInfo = JavassistClassInfo.getClassInfo(ctClass, context.getLoader());
            if (classFilter(definition, new ExpressionContext(PointcutType.CALL, classInfo, classInfo), ctClass)) {
                continue;
            }
            ctClass.instrument(new ExprEditor() {
                public void edit(MethodCall methodCall) throws CannotCompileException {
                    try {
                        CtBehavior where;
                        try {
                            where = methodCall.where();
View Full Code Here

Examples of javassist.expr.ExprEditor

            final ClassInfo classInfo = JavassistClassInfo.getClassInfo(ctClass, context.getLoader());
            if (classFilter(ctClass, new ExpressionContext(PointcutType.SET, classInfo, classInfo), definition)
                && classFilter(ctClass, new ExpressionContext(PointcutType.GET, classInfo, classInfo), definition)) {
                continue;
            }
            ctClass.instrument(new ExprEditor() {
                public void edit(FieldAccess fieldAccess) throws CannotCompileException {
                    try {
                        CtBehavior where = null;
                        try {
                            where = fieldAccess.where();
View Full Code Here

Examples of javassist.expr.ExprEditor

        for (CtClass nc : nestedClasses)
        {
            add(nc.getName());
        }

        ctClass.instrument(new ExprEditor()
        {
            public void edit(ConstructorCall c) throws CannotCompileException
            {
                if (c.getMethodName().equals("this"))
                    return;
View Full Code Here

Examples of javassist.expr.ExprEditor

        if (_fieldReadTransforms == null) _fieldReadTransforms = newMap();

        if (_fieldWriteTransforms == null) _fieldWriteTransforms = newMap();

        ExprEditor editor = new ExprEditor()
        {
            @Override
            public void edit(FieldAccess access) throws CannotCompileException
            {
                // Ignore any methods to were added as part of the transformation.
View Full Code Here

Examples of javassist.expr.ExprEditor

        {
            putIfNotNull(fieldReadTransforms, tfi.name, tfi.readValueBody);
            putIfNotNull(fieldWriteTransforms, tfi.name, tfi.writeValueBody);
        }

        ExprEditor editor = new ExprEditor()
        {
            private final Set<CtBehavior> addedMethods = CollectionFactory.newSet();

            {
                for (TransformMethodImpl tmi : methods.values())
View Full Code Here

Examples of javassist.expr.ExprEditor

        if (fieldReadTransforms == null) fieldReadTransforms = CollectionFactory.newMap();

        if (fieldWriteTransforms == null) fieldWriteTransforms = CollectionFactory.newMap();

        ExprEditor editor = new ExprEditor()
        {
            @Override
            public void edit(FieldAccess access) throws CannotCompileException
            {
                CtBehavior where = access.where();
View Full Code Here

Examples of javassist.expr.ExprEditor

        if (_fieldReadTransforms == null) _fieldReadTransforms = newMap();

        if (_fieldWriteTransforms == null) _fieldWriteTransforms = newMap();

        ExprEditor editor = new ExprEditor()
        {
            @Override
            public void edit(FieldAccess access) throws CannotCompileException
            {
                CtBehavior where = access.where();
View Full Code Here

Examples of javassist.expr.ExprEditor

        {
            putIfNotNull(fieldReadTransforms, tfi.name, tfi.readValueBody);
            putIfNotNull(fieldWriteTransforms, tfi.name, tfi.writeValueBody);
        }

        ExprEditor editor = new ExprEditor()
        {
            private final Set<CtBehavior> addedMethods = CollectionFactory.newSet();

            {
                for (TransformMethodImpl tmi : methods.values())
View Full Code Here

Examples of javassist.expr.ExprEditor

        if (_fieldReadTransforms == null) _fieldReadTransforms = newMap();

        if (_fieldWriteTransforms == null) _fieldWriteTransforms = newMap();

        ExprEditor editor = new ExprEditor()
        {
            @Override
            public void edit(FieldAccess access) throws CannotCompileException
            {
                // Ignore any methods to were added as part of the transformation.
View Full Code Here

Examples of javassist.expr.ExprEditor

    }

    public void testJIRA152() throws Exception {
        CtClass cc = ClassPool.getDefault().get("test4.JIRA152");
        CtMethod mth = cc.getDeclaredMethod("buildColumnOverride");
        mth.instrument(new ExprEditor() {
            public void edit(MethodCall c) throws CannotCompileException {
                c.replace("try{ $_ = $proceed($$); } catch (Throwable t) { throw t; }");
            }
        });
        mth.getMethodInfo().rebuildStackMap(ClassPool.getDefault());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.