001/* 002 * Copyright 2002-2017 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.aop.config; 018 019import org.springframework.beans.factory.config.BeanDefinition; 020import org.springframework.beans.factory.config.BeanReference; 021import org.springframework.beans.factory.parsing.CompositeComponentDefinition; 022import org.springframework.lang.Nullable; 023 024/** 025 * {@link org.springframework.beans.factory.parsing.ComponentDefinition} 026 * that holds an aspect definition, including its nested pointcuts. 027 * 028 * @author Rob Harrop 029 * @author Juergen Hoeller 030 * @since 2.0 031 * @see #getNestedComponents() 032 * @see PointcutComponentDefinition 033 */ 034public class AspectComponentDefinition extends CompositeComponentDefinition { 035 036 private final BeanDefinition[] beanDefinitions; 037 038 private final BeanReference[] beanReferences; 039 040 041 public AspectComponentDefinition(String aspectName, @Nullable BeanDefinition[] beanDefinitions, 042 @Nullable BeanReference[] beanReferences, @Nullable Object source) { 043 044 super(aspectName, source); 045 this.beanDefinitions = (beanDefinitions != null ? beanDefinitions : new BeanDefinition[0]); 046 this.beanReferences = (beanReferences != null ? beanReferences : new BeanReference[0]); 047 } 048 049 050 @Override 051 public BeanDefinition[] getBeanDefinitions() { 052 return this.beanDefinitions; 053 } 054 055 @Override 056 public BeanReference[] getBeanReferences() { 057 return this.beanReferences; 058 } 059 060}