Here you can find the source of genPointcutDetails(Pointcut pcd)
public static String genPointcutDetails(Pointcut pcd)
//package com.java2s; /******************************************************************** * Copyright (c) 2006 Contributors. All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://eclipse.org/legal/epl-v10.html * //from ww w . ja v a 2s.c o m * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ import org.aspectj.weaver.patterns.AndPointcut; import org.aspectj.weaver.patterns.OrPointcut; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.ReferencePointcut; public class Main { public static final String POINTCUT_ANONYMOUS = "<anonymous pointcut>"; public static final String DOUBLE_DOTS = ".."; /** * Generates the pointcut details for the given pointcut, for example an anonymous pointcut will return '<anonymous pointcut>' * and a named pointcut called p() will return 'p()..' */ public static String genPointcutDetails(Pointcut pcd) { StringBuffer details = new StringBuffer(); if (pcd instanceof ReferencePointcut) { ReferencePointcut rp = (ReferencePointcut) pcd; details.append(rp.name).append(DOUBLE_DOTS); } else if (pcd instanceof AndPointcut) { AndPointcut ap = (AndPointcut) pcd; if (ap.getLeft() instanceof ReferencePointcut) { details.append(ap.getLeft().toString()).append(DOUBLE_DOTS); } else { details.append(POINTCUT_ANONYMOUS).append(DOUBLE_DOTS); } } else if (pcd instanceof OrPointcut) { OrPointcut op = (OrPointcut) pcd; if (op.getLeft() instanceof ReferencePointcut) { details.append(op.getLeft().toString()).append(DOUBLE_DOTS); } else { details.append(POINTCUT_ANONYMOUS).append(DOUBLE_DOTS); } } else { details.append(POINTCUT_ANONYMOUS); } return details.toString(); } }