1 7 8 package java.beans; 9 10 import java.lang.ref.Reference ; 11 12 19 20 public class BeanDescriptor extends FeatureDescriptor { 21 22 private Reference beanClassRef; 23 private Reference customizerClassRef; 24 25 31 public BeanDescriptor(Class <?> beanClass) { 32 this(beanClass, null); 33 } 34 35 43 public BeanDescriptor(Class <?> beanClass, Class <?> customizerClass) { 44 beanClassRef = createReference(beanClass); 45 customizerClassRef = createReference(customizerClass); 46 47 String name = beanClass.getName(); 48 while (name.indexOf('.') >= 0) { 49 name = name.substring(name.indexOf('.')+1); 50 } 51 setName(name); 52 } 53 54 59 public Class <?> getBeanClass() { 60 return (Class )getObject(beanClassRef); 61 } 62 63 69 public Class <?> getCustomizerClass() { 70 return (Class )getObject(customizerClassRef); 71 } 72 73 77 BeanDescriptor(BeanDescriptor old) { 78 super(old); 79 beanClassRef = old.beanClassRef; 80 customizerClassRef = old.customizerClassRef; 81 } 82 } 83 | Popular Tags |