if( !compositeMethodsModel.isImplemented( method )
&& !Proxy.class.equals( method.getDeclaringClass().getSuperclass() )
&& !Proxy.class.equals( method.getDeclaringClass() )
&& !Modifier.isStatic( method.getModifiers() ) )
{
MixinModel mixinModel = implementMethod( method, mixinClasses );
ConcernsModel concernsModel = concernsFor(
method,
mixinModel.mixinClass(),
Iterables.<Class<?>>flatten( concernDeclarations( mixinModel.mixinClass() ),
concernClasses )
);
SideEffectsModel sideEffectsModel = sideEffectsFor(
method,
mixinModel.mixinClass(),
Iterables.<Class<?>>flatten( sideEffectDeclarations( mixinModel.mixinClass() ),
sideEffectClasses )
);
method.setAccessible( true );
ConstraintsModel constraints = constraintsFor(
method,
Iterables.<Class<? extends Constraint<?, ?>>>flatten( constraintDeclarations( mixinModel.mixinClass() ),
constraintClasses )
);
CompositeMethodModel methodComposite = new CompositeMethodModel(
method,
constraints,
concernsModel,
sideEffectsModel,
mixinsModel
);
// Implement @This references
Iterable<Class<?>> map = map( new DependencyModel.InjectionTypeFunction(),
filter( new DependencyModel.ScopeSpecification( This.class ),
methodComposite.dependencies() ) );
Iterable<Class<?>> map1 = map( new DependencyModel.InjectionTypeFunction(),
filter( new DependencyModel.ScopeSpecification( This.class ),
mixinModel.dependencies() ) );
@SuppressWarnings( "unchecked" )
Iterable<Class<?>> filter = filter(
not( in( Initializable.class, Lifecycle.class, InvocationHandler.class ) ),
map( Classes.RAW_CLASS, interfacesOf( mixinModel.mixinClass() ) )
);
Iterable<? extends Class<?>> flatten = flatten( map, map1, filter );
addAll( thisDependencies, flatten );
compositeMethodsModel.addMethod( methodComposite );