1 21 package oracle.toplink.essentials.internal.weaving; 23 24 26 import oracle.toplink.libraries.asm.Type; 28 29 import oracle.toplink.essentials.internal.descriptors.InstanceVariableAttributeAccessor; 30 31 import oracle.toplink.essentials.mappings.OneToOneMapping; 32 33 39 40 public class AttributeDetails { 41 42 protected String attributeName; 44 45 protected String referenceClass; 46 47 protected boolean weaveValueHolders = false; 48 49 protected OneToOneMapping mapping = null; 50 51 protected String getterMethodName = null; 52 protected String setterMethodName = null; 53 54 protected boolean collectionMapping = false; 56 57 protected boolean isMappedWithAttributeAccess = false; 58 59 protected boolean attributeOnSuperClass = false; 60 61 public AttributeDetails(String attributeName) { 62 this.attributeName = attributeName; 63 } 64 65 public String getAttributeName() { 66 return this.attributeName; 67 } 68 69 public OneToOneMapping getMapping(){ 70 return mapping; 71 } 72 73 public String getGetterMethodName(){ 74 return getterMethodName; 75 } 76 77 public String getSetterMethodName(){ 78 return setterMethodName; 79 } 80 81 public String getReferenceClass() { 82 return referenceClass; 83 } 84 85 public void setAttributeOnSuperClass(boolean onSuperClass){ 86 attributeOnSuperClass = onSuperClass; 87 } 88 89 public boolean isAttributeOnSuperClass(){ 90 return attributeOnSuperClass; 91 } 92 93 public boolean weaveValueHolders() { 94 return weaveValueHolders; 95 } 96 public void weaveVH(boolean weaveValueHolders, OneToOneMapping mapping) { 97 this.weaveValueHolders = weaveValueHolders; 98 this.mapping = mapping; 99 this.getterMethodName = mapping.getGetMethodName(); 100 this.setterMethodName = mapping.getSetMethodName(); 101 } 102 103 public boolean isCollectionMapping() { 104 return collectionMapping; 105 } 106 public void setCollectionMapping(boolean collectionMapping) { 107 this.collectionMapping = collectionMapping; 108 } 109 110 public void setIsMappedWithAttributeAccess(boolean isMappedWithAttributeAccess){ 111 this.isMappedWithAttributeAccess = isMappedWithAttributeAccess; 112 } 113 114 public boolean isMappedWithAttributeAccess(){ 115 return isMappedWithAttributeAccess; 116 } 117 118 public String toString() { 119 StringBuffer sb = new StringBuffer (attributeName); 120 if (referenceClass != null) { 121 sb.append("["); 122 sb.append(referenceClass); 123 sb.append("]"); 124 } 125 sb.append(" weaveVH: "); 126 if (weaveValueHolders()) { 127 sb.append("true"); 128 } 129 else { 130 sb.append("false"); 131 } 132 sb.append(" CM: "); 133 if (isCollectionMapping()) { 134 sb.append("true"); 135 } 136 else { 137 sb.append("false"); 138 } 139 return sb.toString(); 140 } 141 142 } 143 | Popular Tags |