1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.businessobject;
17
18 import java.util.LinkedHashMap;
19
20 import org.kuali.ole.sys.dataaccess.FieldMetaData;
21 import org.kuali.rice.kns.datadictionary.BusinessObjectEntry;
22 import org.kuali.rice.krad.bo.TransientBusinessObjectBase;
23 import org.kuali.rice.krad.datadictionary.AttributeDefinition;
24
25 public class DataMappingFieldDefinition extends TransientBusinessObjectBase {
26 private String namespaceCode;
27 private String componentClass;
28 private String propertyName;
29 private String tableName;
30 private String fieldName;
31 private FunctionalFieldDescription functionalFieldDescription;
32
33 private BusinessObjectEntry businessObjectEntry;
34 private AttributeDefinition attributeDefinition;
35 private FieldMetaData fieldMetaData;
36 private String propertyType;
37 private String referenceComponentLabel;
38
39 public DataMappingFieldDefinition() {
40 }
41
42 public DataMappingFieldDefinition(FunctionalFieldDescription functionalFieldDescription, BusinessObjectEntry businessObjectEntry, AttributeDefinition attributeDefinition, FieldMetaData fieldMetaData, String propertyType, String referenceComponentLabel) {
43 setNamespaceCode(functionalFieldDescription.getNamespaceCode());
44 setComponentClass(functionalFieldDescription.getComponentClass());
45 setPropertyName(functionalFieldDescription.getPropertyName());
46 setTableName(fieldMetaData.getTableName());
47 setFieldName(fieldMetaData.getColumnName());
48 setFunctionalFieldDescription(functionalFieldDescription);
49 this.businessObjectEntry = businessObjectEntry;
50 this.attributeDefinition = attributeDefinition;
51 this.fieldMetaData = fieldMetaData;
52 this.propertyType = propertyType;
53 this.referenceComponentLabel = referenceComponentLabel;
54 }
55
56 public String getDatabaseDataType() {
57 return fieldMetaData.getDataType();
58 }
59
60 public String getApplicationDataType() {
61 return propertyType;
62 }
63
64 public int getDatabaseDefinedLength() {
65 return fieldMetaData.getLength();
66 }
67
68 public int getApplicationDefinedLength() {
69 return attributeDefinition.getMaxLength();
70 }
71
72 public int getDecimalPlaces() {
73 return fieldMetaData.getDecimalPlaces();
74 }
75
76 public String getReferenceComponent() {
77 return referenceComponentLabel;
78 }
79
80 public boolean isRequired() {
81 return attributeDefinition.isRequired();
82 }
83
84 public String getValidationPattern() {
85 return new StringBuffer(attributeDefinition.getValidationPattern().getClass().getSimpleName()).append(" (").append(attributeDefinition.getValidationPattern().getRegexPattern().toString()).append(")").toString();
86 }
87
88 public boolean isEncrypted() {
89 return fieldMetaData.isEncrypted();
90 }
91
92 public String getMaskPattern() {
93
94
95
96
97
98
99
100
101 return "Unknown MaskFormatter";
102
103 }
104
105 public String getNamespaceCode() {
106 return namespaceCode;
107 }
108
109 public void setNamespaceCode(String namespaceCode) {
110 this.namespaceCode = namespaceCode;
111 }
112
113 public String getComponentClass() {
114 return componentClass;
115 }
116
117 public void setComponentClass(String componentClass) {
118 this.componentClass = componentClass;
119 }
120
121 public String getPropertyName() {
122 return propertyName;
123 }
124
125 public void setPropertyName(String propertyName) {
126 this.propertyName = propertyName;
127 }
128
129 public String getTableName() {
130 return tableName;
131 }
132
133 public void setTableName(String tableName) {
134 this.tableName = tableName;
135 }
136
137 public String getFieldName() {
138 return fieldName;
139 }
140
141 public void setFieldName(String fieldName) {
142 this.fieldName = fieldName;
143 }
144
145 public FunctionalFieldDescription getFunctionalFieldDescription() {
146 return functionalFieldDescription;
147 }
148
149 public void setFunctionalFieldDescription(FunctionalFieldDescription functionalFieldDescription) {
150 this.functionalFieldDescription = functionalFieldDescription;
151 }
152
153
154 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
155 return new LinkedHashMap();
156 }
157 }