All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.linkare.zas.aspectj.accessinfo.EnclosingStaticPart Maven / Gradle / Ivy

Go to download

The AspectJ based implementation of the Zas project. This is the new version of the implementation of Zas which, initially, started as a M.Sc. thesis project by Paulo Zenida at ISCTE.

The newest version!
package com.linkare.zas.aspectj.accessinfo;

import com.linkare.zas.api.ISignature;
import com.linkare.zas.api.ISourceLocation;
import com.linkare.zas.api.JoinPointKind;
import com.linkare.zas.api.IJoinPoint.IEnclosingStaticPart;

/**
 * The AspectJ implementation of the interface IEnclosingStaticPart.
 * 
 * @author Paulo Zenida
 * 
 */
public class EnclosingStaticPart implements IEnclosingStaticPart {

    private org.aspectj.lang.JoinPoint.StaticPart delegate = null;

    private ISourceLocation sourceLocation;

    private ISignature signature;

    /**
     * 
     * @param delegate
     *            The delegate to set.
     */
    public EnclosingStaticPart(org.aspectj.lang.JoinPoint.StaticPart delegate) {
	super();
	this.delegate = delegate;
    }

    public JoinPointKind getKind() {
	return JoinPointKind.fromDescription(delegate.getKind());
    }

    public ISignature getSignature() {
	if (signature == null) {
	    if (getKind().isMethod()) {
		signature = new MethodSignature((org.aspectj.lang.reflect.MethodSignature) delegate.getSignature());
	    } else if (getKind().isConstructor()) {
		signature = new ConstructorSignature((org.aspectj.lang.reflect.ConstructorSignature) delegate.getSignature());
	    } else if (getKind().isField()) {
		signature = new FieldSignature((org.aspectj.lang.reflect.FieldSignature) delegate.getSignature());
	    } else {
		signature = new Signature(delegate.getSignature());
	    }
	}
	return signature;
    }

    public ISourceLocation getSourceLocation() {
	if (sourceLocation == null) {
	    sourceLocation = new SourceLocation(delegate.getSourceLocation());
	}
	return sourceLocation;
    }

    public String toLongString() {
	return delegate.toLongString();
    }

    public String toShortString() {
	return delegate.toShortString();
    }

    public String toString() {
	return delegate.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy