* @return the aspect meta-data
*/
public AspectDefinition parse(final Class klass) {
if (klass == null) throw new IllegalArgumentException("class to parse can not be null");
AspectAttribute aspectAttr = getAspectAttribute(klass);
String className = klass.getName();
String aspectName = aspectAttr.getName();
if (aspectName == null) {
aspectName = className; // if no name is specified use the full class name of the aspect as name
}
// create the aspect definition
AspectDefinition aspectDef = new AspectDefinition(
aspectName,
className,
aspectAttr.getDeploymentModel()
);
parseFieldAttributes(klass, aspectDef);
parseMethodAttributes(klass, className, aspectName, aspectDef);
parseClassAttributes(klass, aspectDef);
return aspectDef;