1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.webbeans.config.inheritance; 18 19 import java.lang.annotation.Annotation; 20 import java.util.HashSet; 21 import java.util.Set; 22 23 24 import org.apache.webbeans.component.AbstractBean; 25 26 /** 27 * Defines the bean inherited meta-datas. 28 */ 29 abstract class AbstractBeanInheritedMetaData<T> implements IBeanInheritedMetaData 30 { 31 /**Component that inherits the meta-datas*/ 32 protected AbstractBean<T> component; 33 34 /**Inherited class*/ 35 protected Class<?> inheritedClazz; 36 37 /**Inherited qualifiers*/ 38 protected Set<Annotation> inheritedQualifiers = new HashSet<Annotation>(); 39 40 /**Inherited stereotypes*/ 41 protected Set<Annotation> inheritedStereoTypes = new HashSet<Annotation>(); 42 43 /**Inherited interceptor bindings*/ 44 protected Set<Annotation> inheritedInterceptorBindings = new HashSet<Annotation>(); 45 46 /**Inherited scope type*/ 47 protected Annotation inheritedScopeType = null; 48 49 /**Inherited deployment type*/ 50 protected Annotation inheritedDeploymentType = null; 51 52 /** 53 * Create a new bean inherited data. 54 * 55 * @param component webbeans component 56 * @param inheritedClazz inherited class 57 */ 58 protected AbstractBeanInheritedMetaData(AbstractBean<T> component, Class<?> inheritedClazz) 59 { 60 this.component = component; 61 this.inheritedClazz = inheritedClazz; 62 63 setInheritedQualifiers(); 64 setInheritedDeploymentType(); 65 setInheritedInterceptorBindings(); 66 setInheritedScopeType(); 67 setInheritedStereoTypes(); 68 } 69 70 71 public Set<Annotation> getInheritedQualifiers() 72 { 73 return this.inheritedQualifiers; 74 } 75 76 public Set<Annotation> getInheritedStereoTypes() 77 { 78 return this.inheritedStereoTypes; 79 } 80 81 public Set<Annotation> getInheritedInterceptorBindings() 82 { 83 return this.inheritedInterceptorBindings; 84 } 85 86 public Annotation getInheritedScopeType() 87 { 88 return this.inheritedScopeType; 89 } 90 91 public Annotation getInheritedDeploymentType() 92 { 93 return this.inheritedDeploymentType; 94 } 95 96 protected AbstractBean<T> getComponent() 97 { 98 return this.component; 99 } 100 101 protected Class<?> getInheritedClazz() 102 { 103 return this.inheritedClazz; 104 } 105 106 107 /** 108 * @param inheritedBindingTypes the inheritedBindingTypes to set 109 */ 110 abstract protected void setInheritedQualifiers(); 111 112 /** 113 * @param inheritedStereoTypes the inheritedStereoTypes to set 114 */ 115 abstract protected void setInheritedStereoTypes(); 116 117 /** 118 * @param inheritedInterceptorBindings the inheritedInterceptorBindingTypes to set 119 */ 120 abstract protected void setInheritedInterceptorBindings(); 121 122 /** 123 * @param inheritedScopeType the inheritedScopeType to set 124 */ 125 abstract protected void setInheritedScopeType(); 126 127 /** 128 * @param inheritedDeploymentType the inheritedDeploymentType to set 129 */ 130 abstract protected void setInheritedDeploymentType(); 131 132 133 }