litesoft
Diff Revisions
223
vs
243
for /trunk/Java/PoVoGenerator/Generator/src/org/litesoft/generator/GenerateVOGO.java
|
@@ -8,6 +8,8 @@ |
8 |
8 |
|
|
9 |
9 |
|
public class GenerateVOGO extends AbstractVOFileGenerator |
10 |
10 |
|
{ |
|
11 |
+ |
private String mVoAttributeGenericType = "XXX"; |
|
12 |
+ |
|
11 |
13 |
|
public GenerateVOGO( ErrorSinc pErrorSinc, ObjectMetaData pObjectMetaData, DerivedObjectTuple pDerivedFromObject, ObjectRef pObjectRef, ObjectRef pParentObjectRef ) |
12 |
14 |
|
{ |
13 |
15 |
|
super( pErrorSinc, pObjectMetaData, pDerivedFromObject, pObjectRef, "GO", pParentObjectRef ); |
|
@@ -30,16 +32,16 @@ |
30 |
32 |
|
if ( mIsParent ) |
31 |
33 |
|
{ |
32 |
34 |
|
zClassName += "<T extends " + mObjectName + "<T>>"; |
33 |
|
- |
zExtendsName += "<T>"; |
|
35 |
+ |
mVoAttributeGenericType = "T"; |
34 |
36 |
|
} |
35 |
37 |
|
else |
36 |
38 |
|
{ |
37 |
|
- |
zExtendsName += "<" + mObjectName + ">"; |
|
39 |
+ |
mVoAttributeGenericType = mObjectName; |
38 |
40 |
|
} |
39 |
41 |
|
|
40 |
42 |
|
addNotes( mObjectMetaData.getNotes() ); |
41 |
43 |
|
makeClassAbstract(); |
42 |
|
- |
addClassDefinition( zClassName, zExtendsName, mObjectName + "Names" ); |
|
44 |
+ |
addClassDefinition( zClassName, zExtendsName + "<" + mVoAttributeGenericType + ">", mObjectName + "Names" ); |
43 |
45 |
|
} |
44 |
46 |
|
|
45 |
47 |
|
@Override |
|
@@ -103,7 +105,7 @@ |
103 |
105 |
|
addBlankLine(); |
104 |
106 |
|
addNotes( zNotes ); |
105 |
107 |
|
addMethodPublic( "void", "set" + zName, zSimpleDataType + " p" + zName ); |
106 |
|
- |
addLine( "VoAttribute<" + mObjectName + "> zAttribute = getVoAttribute( a" + zName + " );" ); |
|
108 |
+ |
addLine( "VoAttribute<" + mVoAttributeGenericType + "> zAttribute = getVoAttribute( a" + zName + " );" ); |
107 |
109 |
|
addLine( "if ( verifyMutabilityOnChange( zAttribute, get" + zName + "(), p" + zName + " = zAttribute.normalize( p" + zName + ", zAttribute.isRequired() ) ) )" ); |
108 |
110 |
|
addBlockStart(); |
109 |
111 |
|
addLine( "LLset" + zName + "( p" + zName + " );" ); |
|
@@ -135,7 +137,7 @@ |
135 |
137 |
|
addLine( "@Override" ); |
136 |
138 |
|
} |
137 |
139 |
|
addMethodPublic( "void", "set" + zName, zSimpleDataType + " p" + zName ); |
138 |
|
- |
addLine( "VoAttribute<" + mObjectName + "> zAttribute = getVoAttribute( a" + zName + " );" ); |
|
140 |
+ |
addLine( "VoAttribute<" + mVoAttributeGenericType + "> zAttribute = getVoAttribute( a" + zName + " );" ); |
139 |
141 |
|
addLine( "if ( verifyMutabilityOnChange( zAttribute, get" + zName + "(), p" + zName + " = zAttribute.normalize( p" + zName + ", zAttribute.isRequired() ) ) )" ); |
140 |
142 |
|
addBlockStart(); |
141 |
143 |
|
addLine( "LLset" + zName + "( p" + zName + " );" ); |