private void addClassAttributes(Method method, JoinPoint joinPoint, Map<String, Object> attributes) { Class<?> declaringClass = method.getDeclaringClass(); if (method.isAnnotationPresent(TrackableAttribute.class) && Trackable.class.isAssignableFrom(declaringClass)) { Trackable trackable = (Trackable) joinPoint.getThis(); if (trackable.getTrackableAttributes() != null) { attributes.putAll(trackable.getTrackableAttributes()); } } while (declaringClass != null) { addFixedAttribute(declaringClass.getAnnotation(FixedAttribute.class), attributes); addFixedAttributes(declaringClass.getAnnotation(FixedAttributes.class), attributes); declaringClass = declaringClass.getEnclosingClass(); } declaringClass = joinPoint.getThis().getClass(); addFixedAttribute(declaringClass.getAnnotation(FixedAttribute.class), attributes); addFixedAttributes(declaringClass.getAnnotation(FixedAttributes.class), attributes); }
if (value instanceof Trackable) { Trackable trackable = (Trackable) value; Map<String, Object> trackableValues = trackable.getTrackableAttributes(); if (trackableValues != null) { attributes.putAll(trackable.getTrackableAttributes());