/************************************************
 * Copyright (c) Shen Li. All rights reserved.  *
 * http://joyaop.sourceforge.net                *
 * -------------------------------------------- *
 * Distributable under LGPL license.            *
 * See terms of license at gnu.org.             *
 ************************************************/
package net.sf.joyaop.impl;

import net.sf.joyaop.framework.MixinAspect;
import net.sf.joyaop.framework.AspectizedClass;

/**
 * @author Shen Li
 */
public class MixinAspectImpl extends RuntimeAspectImpl implements MixinAspect {
    private Class interfaceClass;

    public MixinAspectImpl() {
        setScope(INSTANCE_SCOPE);
    }

    public void weave(AspectizedClass aspectizedClass) {
        if (getPointcut().matches(aspectizedClass.getOriginalClass())) {
            aspectizedClass.addMixin(this);
        }
    }

    public Class getInterfaceClass() {
        return interfaceClass;
    }

    public void setInterfaceClass(Class interfaceClass) {
        this.interfaceClass = interfaceClass;
    }
}