Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/PoVoGenerator/Generator/src/org/litesoft/generator/GenerateVO.java

Diff revisions: vs.
  @@ -1,49 +1,49 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.generator;
3 -
4 - import org.litesoft.aokeyhole.objects.*;
5 - import org.litesoft.codegen.*;
6 -
7 - public class GenerateVO extends AbstractVOFileGenerator {
8 - public GenerateVO( ErrorSinc pErrorSinc, ObjectMetaData pObjectMetaData, DerivedObjectTuple pDerivedFromObject, ObjectRef pObjectRef,
9 - ObjectRef pParentObjectRef ) {
10 - super( pErrorSinc, pObjectMetaData, pDerivedFromObject, pObjectRef, "", pParentObjectRef );
11 - }
12 -
13 - @Override
14 - protected void LLaddClassDefinition() {
15 - if ( mIsParent ) {
16 - makeClassAbstract();
17 - addClassDefinition( mClassName + "<T extends " + mObjectName + "<T>>", mClassName + "GO<T>" );
18 - } else {
19 - addClassDefinition( mClassName, mClassName + "GO" );
20 - }
21 - }
22 -
23 - @Override
24 - protected void LLaddClassBody() {
25 - if ( mIsParent ) {
26 - addLine( "protected " + mClassName + "( " + mObjectName + "MetaData<T> pMetaData ) // For Serialization" ); // constructor w/ comment
27 - addBlockStart();
28 - addLine( "super( pMetaData );" );
29 - addMethodEnd();
30 - addConstructorProtected( mClassName, mObjectName + "MetaData<T> pMetaData", "boolean pNew", "org.litesoft.bo.views.TransactionSet pTransactionSet" );
31 - addLine( "super( pMetaData, pNew, pTransactionSet );" );
32 - addBlockEnd();
33 - } else {
34 - addLine( "@Deprecated" );
35 - addLine( "protected " + mClassName + "() // For Serialization" ); // constructor w/ comment
36 - addBlockStart();
37 - addMethodEnd();
38 - addConstructorProtected( mClassName, "boolean pNew", "org.litesoft.bo.views.TransactionSet pTransactionSet" );
39 - addLine( "super( pNew, pTransactionSet );" );
40 - addMethodEnd();
41 - addLine( "public static " + mObjectName + " createNew()" );
42 - addBlockStart();
43 - addLine( mObjectName + " zVO = new " + mObjectName + "( true, " + mObjectName + "DataProvider.getInstance().createTransactionSet() );" );
44 - addLine( "zVO.initialize();" );
45 - addLine( "return zVO;" );
46 - addBlockEnd();
47 - }
48 - }
49 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.generator;
3 +
4 + import org.litesoft.aokeyhole.objects.*;
5 + import org.litesoft.codegen.*;
6 +
7 + public class GenerateVO extends AbstractVOFileGenerator {
8 + public GenerateVO( ErrorSinc pErrorSinc, ObjectMetaData pObjectMetaData, DerivedObjectTuple pDerivedFromObject, ObjectRef pObjectRef,
9 + ObjectRef pParentObjectRef ) {
10 + super( pErrorSinc, pObjectMetaData, pDerivedFromObject, pObjectRef, "", pParentObjectRef );
11 + }
12 +
13 + @Override
14 + protected void LLaddClassDefinition() {
15 + if ( mIsParent ) {
16 + makeClassAbstract();
17 + addClassDefinition( mClassName + "<T extends " + mObjectName + "<T>>", mClassName + "GO<T>" );
18 + } else {
19 + addClassDefinition( mClassName, mClassName + "GO" );
20 + }
21 + }
22 +
23 + @Override
24 + protected void LLaddClassBody() {
25 + if ( mIsParent ) {
26 + addLine( "protected " + mClassName + "( " + mObjectName + "MetaData<T> pMetaData ) // For Serialization" ); // constructor w/ comment
27 + addBlockStart();
28 + addLine( "super( pMetaData );" );
29 + addMethodEnd();
30 + addConstructorProtected( mClassName, mObjectName + "MetaData<T> pMetaData", "boolean pNew", "org.litesoft.bo.views.TransactionSet pTransactionSet" );
31 + addLine( "super( pMetaData, pNew, pTransactionSet );" );
32 + addBlockEnd();
33 + } else {
34 + addLine( "@Deprecated" );
35 + addLine( "protected " + mClassName + "() // For Serialization" ); // constructor w/ comment
36 + addBlockStart();
37 + addMethodEnd();
38 + addConstructorProtected( mClassName, "boolean pNew", "org.litesoft.bo.views.TransactionSet pTransactionSet" );
39 + addLine( "super( pNew, pTransactionSet );" );
40 + addMethodEnd();
41 + addLine( "public static " + mObjectName + " createNew()" );
42 + addBlockStart();
43 + addLine( mObjectName + " zVO = new " + mObjectName + "( true, " + mObjectName + "DataProvider.getInstance().createTransactionSet() );" );
44 + addLine( "zVO.initialize();" );
45 + addLine( "return zVO;" );
46 + addBlockEnd();
47 + }
48 + }
49 + }