litesoft
Diff Revisions
49
vs
223
for /trunk/Java/core/Anywhere/src/org/litesoft/bo/BoAttribute.java
|
@@ -4,6 +4,7 @@ |
4 |
4 |
|
import org.litesoft.core.simpletypes.*; |
5 |
5 |
|
import org.litesoft.core.simpletypes.currency.*; |
6 |
6 |
|
import org.litesoft.core.simpletypes.temporal.*; |
|
7 |
+ |
import org.litesoft.core.util.*; |
7 |
8 |
|
|
8 |
9 |
|
public interface BoAttribute extends java.io.Serializable |
9 |
10 |
|
{ |
|
@@ -28,6 +29,12 @@ |
28 |
29 |
|
} |
29 |
30 |
|
|
30 |
31 |
|
@Override |
|
32 |
+ |
public Object normalize( Object pValue, boolean pRequired ) |
|
33 |
+ |
{ |
|
34 |
+ |
return !UtilsCommon.isBooleanNotTrue( pValue ); |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
@Override |
31 |
38 |
|
public boolean dataNeedsQuoting() |
32 |
39 |
|
{ |
33 |
40 |
|
return false; |
|
@@ -62,6 +69,12 @@ |
62 |
69 |
|
} |
63 |
70 |
|
|
64 |
71 |
|
@Override |
|
72 |
+ |
public Object normalize( Object pValue, boolean pRequired ) |
|
73 |
+ |
{ |
|
74 |
+ |
return !pRequired ? pValue : !UtilsCommon.isBooleanNotTrue( pValue ); |
|
75 |
+ |
} |
|
76 |
+ |
|
|
77 |
+ |
@Override |
65 |
78 |
|
public boolean dataNeedsQuoting() |
66 |
79 |
|
{ |
67 |
80 |
|
return false; |
|
@@ -74,6 +87,12 @@ |
74 |
87 |
|
{ |
75 |
88 |
|
return String.class; |
76 |
89 |
|
} |
|
90 |
+ |
|
|
91 |
+ |
@Override |
|
92 |
+ |
public Object normalize( Object pValue, boolean pRequired ) |
|
93 |
+ |
{ |
|
94 |
+ |
return UtilsCommon.isEmptyString( pValue ) ? null : pValue; |
|
95 |
+ |
} |
77 |
96 |
|
}, |
78 |
97 |
|
Integer |
79 |
98 |
|
{ |
|
@@ -216,5 +235,10 @@ |
216 |
235 |
|
{ |
217 |
236 |
|
return false; |
218 |
237 |
|
} |
|
238 |
+ |
|
|
239 |
+ |
public Object normalize( Object pValue, boolean pRequired ) |
|
240 |
+ |
{ |
|
241 |
+ |
return pValue; |
|
242 |
+ |
} |
219 |
243 |
|
} |
220 |
244 |
|
} |