/** * Build a {@link org.springframework.aop.aspectj.DeclareParentsAdvisor} * for the given introduction field. * <p>Resulting Advisors will need to be evaluated for targets. * @param introductionField the field to introspect * @return {@code null} if not an Advisor */ private Advisor getDeclareParentsAdvisor(Field introductionField) { DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class); if (declareParents == null) { // Not an introduction field return null; } if (DeclareParents.class.equals(declareParents.defaultImpl())) { // This is what comes back if it wasn't set. This seems bizarre... // TODO this restriction possibly should be relaxed throw new IllegalStateException("defaultImpl must be set on DeclareParents"); } return new DeclareParentsAdvisor( introductionField.getType(), declareParents.value(), declareParents.defaultImpl()); }
/** * Build a {@link org.springframework.aop.aspectj.DeclareParentsAdvisor} * for the given introduction field. * <p>Resulting Advisors will need to be evaluated for targets. * @param introductionField the field to introspect * @return {@code null} if not an Advisor */ private Advisor getDeclareParentsAdvisor(Field introductionField) { DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class); if (declareParents == null) { // Not an introduction field return null; } if (DeclareParents.class == declareParents.defaultImpl()) { // This is what comes back if it wasn't set. This seems bizarre... // TODO this restriction possibly should be relaxed throw new IllegalStateException("defaultImpl must be set on DeclareParents"); } return new DeclareParentsAdvisor( introductionField.getType(), declareParents.value(), declareParents.defaultImpl()); }