public class ProxyGeneratorAdapter extends org.objectweb.asm.ClassVisitor
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor and description |
---|
ProxyGeneratorAdapter
(Map<Object, Object> closureMap, Class superClass, Class[] interfaces, ClassLoader proxyLoader, boolean emptyBody, Class delegateClass) Construct a proxy generator. |
Type | Name and description |
---|---|
GroovyObject |
delegatingProxy(Object delegate, Map<Object, Object> map, Object... constructorArgs) |
static Closure |
ensureClosure(Object o) Ensures that the provided object is wrapped into a closure if it's not a closure. |
protected org.objectweb.asm.MethodVisitor |
makeDelegateCall(String name, String desc, String signature, String[] exceptions, int accessFlags) Generate a call to the delegate object. |
protected org.objectweb.asm.MethodVisitor |
makeDelegateToClosureCall(String name, String desc, String signature, String[] exceptions, int accessFlags) |
GroovyObject |
proxy(Map<Object, Object> map, Object... constructorArgs) |
void |
visit(int version, int access, String name, String signature, String superName, String[] interfaces) |
org.objectweb.asm.MethodVisitor |
visitMethod(int access, String name, String desc, String signature, String[] exceptions) |
Methods inherited from class | Name |
---|---|
class org.objectweb.asm.ClassVisitor |
org.objectweb.asm.ClassVisitor#visitMethod(int, java.lang.String, java.lang.String, java.lang.String, [Ljava.lang.String;), org.objectweb.asm.ClassVisitor#visitAnnotation(java.lang.String, boolean), org.objectweb.asm.ClassVisitor#visitEnd(), org.objectweb.asm.ClassVisitor#visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object), org.objectweb.asm.ClassVisitor#visitAttribute(org.objectweb.asm.Attribute), org.objectweb.asm.ClassVisitor#visitInnerClass(java.lang.String, java.lang.String, java.lang.String, int), org.objectweb.asm.ClassVisitor#visitOuterClass(java.lang.String, java.lang.String, java.lang.String), org.objectweb.asm.ClassVisitor#visitSource(java.lang.String, java.lang.String), org.objectweb.asm.ClassVisitor#visitTypeAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean), org.objectweb.asm.ClassVisitor#visit(int, int, java.lang.String, java.lang.String, java.lang.String, [Ljava.lang.String;), org.objectweb.asm.ClassVisitor#wait(long, int), org.objectweb.asm.ClassVisitor#wait(long), org.objectweb.asm.ClassVisitor#wait(), org.objectweb.asm.ClassVisitor#equals(java.lang.Object), org.objectweb.asm.ClassVisitor#toString(), org.objectweb.asm.ClassVisitor#hashCode(), org.objectweb.asm.ClassVisitor#getClass(), org.objectweb.asm.ClassVisitor#notify(), org.objectweb.asm.ClassVisitor#notifyAll() |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Construct a proxy generator. This generator is used when we need to create a proxy object for a class or an interface given a map of closures.
closureMap
- the delegates implementationssuperClass
- corresponding to the superclass class visitorinterfaces
- extra interfaces the proxy should implementproxyLoader
- the class loader which should be used to load the generated proxydelegateClass
- if not null, generate a delegate field with the corresponding classemptyBody
- if set to true, the unimplemented abstract methods will receive an empty body instead of
throwing an UnsupportedOperationException.Ensures that the provided object is wrapped into a closure if it's not a closure. Do not trust IDEs, this method is used in bytecode.
Generate a call to the delegate object.
Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.