From: Eric C. <ecr...@us...> - 2006-07-28 02:10:09
|
User: ecrutchfield Date: 06/07/27 19:10:07 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: fixed whitespace Revision Changes Path 1.2 +2 -2 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 |
From: Chris M. <cm...@us...> - 2007-09-25 23:34:16
|
User: cmicali Date: 07/09/25 15:47:32 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: - Added XmlInclude for VO inheritance and Clone() method - Fixed issue with dao->dao references Revision Changes Path 1.4 +29 -1 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- ValueObject.vsl 15 Aug 2006 22:48:43 -0000 1.3 +++ ValueObject.vsl 25 Sep 2007 22:47:32 -0000 1.4 @@ -4,7 +4,14 @@ // Attention: Generated code! Do not modify by hand! // Generated by: ValueObject.vsl in andromda-cs-cartridge. +#region Using statements + using System; +using System.IO; +using System.Xml.Serialization; +using System.Runtime.Serialization.Formatters.Binary; + +#endregion #if ($stringUtils.isNotBlank($class.packageName)) namespace $class.packageName @@ -14,9 +21,14 @@ $class.getDocumentation(" /// ") /// </summary> [Serializable] +#foreach ($subentity in $class.specializations) + [XmlInclude(typeof(${subentity.name}))] +#end public#if($class.abstract) abstract#end class $class.name #if($class.generalization) - : ${class.generalization.fullyQualifiedName} + : ${class.generalization.fullyQualifiedName} , ICloneable +#else + : ICloneable #end { @@ -114,6 +126,22 @@ #end #endregion + #region ICloneable Implementation + + public#if($class.generalization) new#end object Clone() + { + ${class.name} _clone = default(${class.name}); //initialize to default not null + BinaryFormatter bf = new BinaryFormatter(); //helper to serialize + MemoryStream memStream = new MemoryStream(); + bf.Serialize(memStream, this); + memStream.Flush(); + memStream.Position = 0; + _clone = ((${class.name})bf.Deserialize(memStream)); //this returns the copy of type T + return _clone; + } + + #endregion + // ValueObject.vsl merge-point } |
From: Chris M. <cm...@us...> - 2007-10-03 15:06:36
|
User: cmicali Date: 07/10/03 08:06:35 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: Revision Changes Path 1.5 +1 -1 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- ValueObject.vsl 25 Sep 2007 22:47:32 -0000 1.4 +++ ValueObject.vsl 3 Oct 2007 15:06:34 -0000 1.5 @@ -22,7 +22,7 @@ /// </summary> [Serializable] #foreach ($subentity in $class.specializations) - [XmlInclude(typeof(${subentity.name}))] + [XmlInclude(typeof(${subentity.fullyQualifiedName}))] #end public#if($class.abstract) abstract#end class $class.name #if($class.generalization) |
From: Chris M. <cm...@us...> - 2007-10-05 14:07:01
|
User: cmicali Date: 07/10/05 07:07:04 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: [NETCART-17] Applied Jens' patch to enable attribute to set prefix on value object member variable names. Revision Changes Path 1.6 +8 -8 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- ValueObject.vsl 3 Oct 2007 15:06:34 -0000 1.5 +++ ValueObject.vsl 5 Oct 2007 14:07:04 -0000 1.6 @@ -36,13 +36,13 @@ ## **** Generate attribute **** #foreach ($attribute in $class.attributes) - private $attribute.getterSetterTypeName _$attribute.name; + private $attribute.getterSetterTypeName ${attributeNamePrefix}${attribute.name}; #end ## **** Generate associations **** #foreach ($associationEnd in $class.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable) - private $target.getterSetterTypeName _$target.name; + private $target.getterSetterTypeName ${attributeNamePrefix}${target.name}; #end #end @@ -74,7 +74,7 @@ #end { #foreach ($property in $class.properties) - this._${property.name} = ${property.name}; + this.${attributeNamePrefix}${property.name} = ${property.name}; #end } @@ -88,7 +88,7 @@ if (other${class.name} != null) { #foreach ( $property in $class.properties) - this._${property.name} = other${class.name}.${stringUtils.upperCamelCaseName($property.name)}; + this.${attributeNamePrefix}${property.name} = other${class.name}.${stringUtils.upperCamelCaseName($property.name)}; #end } } @@ -104,8 +104,8 @@ /// </summary> $attribute.visibility $attribute.getterSetterTypeName ${stringUtils.upperCamelCaseName($attribute.name)} { - get { return _$attribute.name; } - set { this._$attribute.name = value; } + get { return ${attributeNamePrefix}${attribute.name}; } + set { this.${attributeNamePrefix}${attribute.name} = value; } } #end @@ -118,8 +118,8 @@ /// </summary> public $target.getterSetterTypeName ${stringUtils.upperCamelCaseName($target.name)} { - get { return _$target.name; } - set { this._$target.name = value; } + get { return ${attributeNamePrefix}${target.name}; } + set { this.${attributeNamePrefix}${target.name} = value; } } #end |
From: Chris M. <cm...@us...> - 2007-10-05 15:55:32
|
User: cmicali Date: 07/10/05 08:55:35 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: Fix for [NETCART-5] - Modified constructors in ValueObject.vsl to call parent constructors if there is a parent class Revision Changes Path 1.7 +21 -5 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- ValueObject.vsl 5 Oct 2007 14:07:04 -0000 1.6 +++ ValueObject.vsl 5 Oct 2007 15:55:34 -0000 1.7 @@ -57,21 +57,29 @@ #end #if ($enablePropertyConstructors.equalsIgnoreCase('true')) -#set ($propertiesNumber = $class.properties.size()) -#if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.properties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName)) +#set ($propertiesNumber = $class.allProperties.size()) +#if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.allProperties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName)) /// <summary> /// Constructor taking all properties. /// </summary> #set ($parenthesis = "(") -#if ($class.properties.empty) +#if ($class.allProperties.empty) #set ($parenthesis = "()") #end public ${class.name}${parenthesis} -#foreach ($property in $class.properties) - $property.getterSetterTypeName ${property.name}#if($velocityCount != $class.properties.size()),#else) +#foreach ($property in $class.allProperties) + $property.getterSetterTypeName ${property.name}#if($velocityCount != $class.allProperties.size()),#else) #end #end +#if($class.generalization) + : base(#set ($comma = "") +#foreach ($property in $class.generalization.allProperties) +${comma}${property.name}## no newline +#set ($comma = ", ") +#end +) +#end { #foreach ($property in $class.properties) this.${attributeNamePrefix}${property.name} = ${property.name}; @@ -84,6 +92,14 @@ /// Copy constructor /// </summary> public ${class.name}(${class.name} other${class.name}) +#if($class.generalization) + : base(#set ($comma = "") +#foreach ($property in $class.generalization.allProperties) +${comma}other${class.name}.${property.name}## no newline +#set ($comma = ", ") +#end +) +#end { if (other${class.name} != null) { |
From: Chris M. <cm...@us...> - 2007-10-08 18:59:58
|
User: cmicali Date: 07/10/08 11:59:37 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: - Fixed bug output property names when calling base constructors Revision Changes Path 1.8 +2 -2 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- ValueObject.vsl 5 Oct 2007 15:55:34 -0000 1.7 +++ ValueObject.vsl 8 Oct 2007 18:59:36 -0000 1.8 @@ -75,7 +75,7 @@ #if($class.generalization) : base(#set ($comma = "") #foreach ($property in $class.generalization.allProperties) -${comma}${property.name}## no newline +${comma}${stringUtils.upperCamelCaseName($property.name)}## no newline #set ($comma = ", ") #end ) @@ -95,7 +95,7 @@ #if($class.generalization) : base(#set ($comma = "") #foreach ($property in $class.generalization.allProperties) -${comma}other${class.name}.${property.name}## no newline +${comma}other${class.name}.${stringUtils.upperCamelCaseName($property.name)}## no newline #set ($comma = ", ") #end ) |
From: Chris M. <cm...@us...> - 2007-10-08 19:04:16
|
User: cmicali Date: 07/10/08 12:04:19 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: - Another shot Revision Changes Path 1.9 +1 -1 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- ValueObject.vsl 8 Oct 2007 18:59:36 -0000 1.8 +++ ValueObject.vsl 8 Oct 2007 19:04:14 -0000 1.9 @@ -75,7 +75,7 @@ #if($class.generalization) : base(#set ($comma = "") #foreach ($property in $class.generalization.allProperties) -${comma}${stringUtils.upperCamelCaseName($property.name)}## no newline +${comma}${property.name}## no newline #set ($comma = ", ") #end ) |
From: Chris M. <cm...@us...> - 2007-10-08 19:06:02
|
User: cmicali Date: 07/10/08 12:06:05 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: - Always supply default constructor Revision Changes Path 1.10 +2 -2 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -r1.9 -r1.10 --- ValueObject.vsl 8 Oct 2007 19:04:14 -0000 1.9 +++ ValueObject.vsl 8 Oct 2007 19:06:03 -0000 1.10 @@ -50,12 +50,12 @@ #region Constructors -#if (!$class.properties.empty) +##if (!$class.properties.empty) public ${class.name}() { } -#end +##end #if ($enablePropertyConstructors.equalsIgnoreCase('true')) #set ($propertiesNumber = $class.allProperties.size()) #if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.allProperties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName)) |
From: Chris M. <cm...@us...> - 2007-10-08 19:16:44
|
User: cmicali Date: 07/10/08 12:16:44 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: - Last try Revision Changes Path 1.11 +2 -4 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- ValueObject.vsl 8 Oct 2007 19:06:03 -0000 1.10 +++ ValueObject.vsl 8 Oct 2007 19:16:44 -0000 1.11 @@ -50,15 +50,13 @@ #region Constructors -##if (!$class.properties.empty) public ${class.name}() { } -##end -#if ($enablePropertyConstructors.equalsIgnoreCase('true')) +#if ($enablePropertyConstructors.equalsIgnoreCase('true') && !$class.allProperties.empty) #set ($propertiesNumber = $class.allProperties.size()) -#if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.allProperties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName)) +#if ($propertiesNumber != 1 || !$class.allProperties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName)) /// <summary> /// Constructor taking all properties. /// </summary> |
From: Chris M. <cm...@us...> - 2007-10-10 20:48:18
|
User: cmicali Date: 07/10/10 13:48:23 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: - Added properties enableXmlInclude and enableICloneableImplementation to toggle output of the XmlInclude attributes and serialization-based implementation of Clone() method Revision Changes Path 1.12 +5 -1 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -r1.11 -r1.12 --- ValueObject.vsl 8 Oct 2007 19:16:44 -0000 1.11 +++ ValueObject.vsl 10 Oct 2007 20:48:23 -0000 1.12 @@ -21,15 +21,19 @@ $class.getDocumentation(" /// ") /// </summary> [Serializable] +#if($enableXmlInclude.equalsIgnoreCase('true')) #foreach ($subentity in $class.specializations) [XmlInclude(typeof(${subentity.fullyQualifiedName}))] #end +#end public#if($class.abstract) abstract#end class $class.name #if($class.generalization) - : ${class.generalization.fullyQualifiedName} , ICloneable + : ${class.generalization.fullyQualifiedName}#if($enableIClonableImplementation.equalsIgnoreCase('true')), ICloneable#end #else +#if($enableIClonableImplementation.equalsIgnoreCase('true')) : ICloneable #end +#end { #region Attributes and Associations |
From: Chris M. <cm...@us...> - 2007-10-11 14:24:50
|
User: cmicali Date: 07/10/11 07:24:55 Modified: andromda-cs/src/main/resources/templates/cs ValueObject.vsl Log: Revision Changes Path 1.13 +4 -0 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- ValueObject.vsl 10 Oct 2007 20:48:23 -0000 1.12 +++ ValueObject.vsl 11 Oct 2007 14:24:55 -0000 1.13 @@ -8,8 +8,12 @@ using System; using System.IO; +#if($enableXmlInclude.equalsIgnoreCase('true')) using System.Xml.Serialization; +#end +#if($enableIClonableImplementation.equalsIgnoreCase('true')) using System.Runtime.Serialization.Formatters.Binary; +#end #endregion |