Top Description Inners Fields Constructors Methods
org.springframework.cglib.proxy

public abstract Class Mixin

extends Object
Class Inheritance
Annotations
@SuppressWarnings:rawtypes, unchecked
Imports
java.security.ProtectionDomain, java.util.ArrayList, .Collections, .HashMap, .Iterator, .Map, org.springframework.asm.ClassVisitor, org.springframework.cglib.core.AbstractClassGenerator, .ClassesKey, .KeyFactory, .ReflectUtils

Mixin allows multiple objects to be combined into a single larger object. The methods in the generated object simply call the original methods in the underlying "delegate" objects.
Author
Chris Nokleberg
Version
$Id: Mixin.java,v 1.7 2005/09/27 11:42:27 baliuka Exp $

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
pack-priv static interface
private static class

Field Summary

Modifier and TypeField and Description
private static final Mixin.MixinKey
private static final Map<K, V>
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Mixin
create(Object[] delegates)

Helper method to create an interface mixin.

public static Mixin
create(Class<T>[] interfaces, Object[] delegates)

Helper method to create an interface mixin.

public static Mixin
createBean(Object[] beans)

public static Mixin
createBean(ClassLoader loader, Object[] beans)

Helper method to create a bean mixin.

public static Class<T>[]
getClasses(Object[] delegates)

public abstract Mixin
newInstance(Object[] delegates)

private static Mixin.Route
route(Object[] delegates)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

KEY_FACTORYback to summary
private static final Mixin.MixinKey KEY_FACTORY
ROUTE_CACHEback to summary
private static final Map<K, V> ROUTE_CACHE
STYLE_BEANSback to summary
public static final int STYLE_BEANS
STYLE_EVERYTHINGback to summary
public static final int STYLE_EVERYTHING
STYLE_INTERFACESback to summary
public static final int STYLE_INTERFACES

Constructor Detail

Mixinback to summary
public Mixin()

Method Detail

createback to summary
public static Mixin create(Object[] delegates)

Helper method to create an interface mixin. For finer control over the generated instance, use a new instance of Mixin instead of this static method. TODO

createback to summary
public static Mixin create(Class<T>[] interfaces, Object[] delegates)

Helper method to create an interface mixin. For finer control over the generated instance, use a new instance of Mixin instead of this static method. TODO

createBeanback to summary
public static Mixin createBean(Object[] beans)
createBeanback to summary
public static Mixin createBean(ClassLoader loader, Object[] beans)

Helper method to create a bean mixin. For finer control over the generated instance, use a new instance of Mixin instead of this static method. TODO

getClassesback to summary
public static Class<T>[] getClasses(Object[] delegates)
newInstanceback to summary
public abstract Mixin newInstance(Object[] delegates)
routeback to summary
private static Mixin.Route route(Object[] delegates)
org.springframework.cglib.proxy back to summary

public Class Mixin.Generator

extends AbstractClassGenerator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Class<T>[]
private Object[]
private int[]
private static final AbstractClassGenerator.Source
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Mixin
protected Object
public void
protected ClassLoader
protected ProtectionDomain
getProtectionDomain()

Overrides org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Returns the protection domain to use when defining the class.
protected Object
public void
setClasses(Class<T>[] classes)

public void
setDelegates(Object[] delegates)

public void
setStyle(int style)

Inherited from org.springframework.cglib.core.AbstractClassGenerator:
creategenerategetAttemptLoadgetClassLoadergetClassNamegetCurrentgetNamingPolicygetStrategygetUseCachesetAttemptLoadsetClassLoadersetContextClasssetNamePrefixsetNamingPolicysetStrategysetUseCacheunwrapCachedValuewrapCachedClass

Field Detail

classesback to summary
private Class<T>[] classes
delegatesback to summary
private Object[] delegates
routeback to summary
private int[] route
SOURCEback to summary
private static final AbstractClassGenerator.Source SOURCE
styleback to summary
private int style

Constructor Detail

Generatorback to summary
public Generator()

Method Detail

createback to summary
public Mixin create()
firstInstanceback to summary
protected Object firstInstance(Class<T> type)

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.firstInstance.

Annotations
@Override
generateClassback to summary
public void generateClass(ClassVisitor v)

Implements org.springframework.cglib.core.ClassGenerator.generateClass.

Annotations
@Override
getDefaultClassLoaderback to summary
protected ClassLoader getDefaultClassLoader()

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.getDefaultClassLoader.

Annotations
@Override
getProtectionDomainback to summary
protected ProtectionDomain getProtectionDomain()

Overrides org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Doc from org.springframework.cglib.core.AbstractClassGenerator.getProtectionDomain.

Returns the protection domain to use when defining the class.

Default implementation returns null for using a default protection domain. Sub-classes may override to use a more specific protection domain.

Returns:ProtectionDomain

the protection domain (null for using a default)

Annotations
@Override
nextInstanceback to summary
protected Object nextInstance(Object instance)

Implements abstract org.springframework.cglib.core.AbstractClassGenerator.nextInstance.

Annotations
@Override
setClassesback to summary
public void setClasses(Class<T>[] classes)
setDelegatesback to summary
public void setDelegates(Object[] delegates)
setStyleback to summary
public void setStyle(int style)
org.springframework.cglib.proxy back to summary

pack-priv Interface Mixin.MixinKey


Method Summary

Modifier and TypeMethod and Description
public Object
newInstance(int style, String[] classes, int[] route)

Method Detail

newInstanceback to summary
public Object newInstance(int style, String[] classes, int[] route)
org.springframework.cglib.proxy back to summary

private Class Mixin.Route

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Class<T>[]
private int[]

Constructor Summary

AccessConstructor and Description
pack-priv
Route(Object[] delegates)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classesback to summary
private Class<T>[] classes
routeback to summary
private int[] route

Constructor Detail

Routeback to summary
pack-priv Route(Object[] delegates)