code-generation

C# How to exclude generated code from VS2008 code metrics?

See title. I've been digging around but i found no solution. DebuggerHidden and DebuggerNonUserCode seem to fail. ...

MyGeneration Template Creation Tutorials

Just wondering if anyone has some good resources for learning how to create new templates with MyGeneration? I've only found a couple of very basic introductions so far, and the majority of the rest of the documentation appears to be about generating code with the existing templates. I'm looking to write some templates of my own to bet...

Unexpected __-prefixed public variables in XSDObjectGen.exe auto generated code

I have auto generated some classes from an xsd file using the XSDObjectGen.exe tool. My classes contain extra public variables, named using leading underscores, and I cannot figure out why. Here's a sample from the xsd file: <xs:attribute name="Fare" type="xs:int" use="required"> <xs:annotation> <xs:documentation>The fare p...

in code dom how to use in-built properties

CodeVariableDeclarationStatement hashTableParam = new CodeVariableDeclarationStatement(); hashTableParam.Name = "hastable"; hashTableParam.Type = new CodeTypeReference(typeof(System.Collections.Hashtable)); here i have created a hashtable data type using code dom . Now i want to use its in-built properties such that add...

How to incorporate code generation to a C# solution?

(This question is rather similar, but the only answer does not seem to be answering my needs). I am thinking of using Thrift in C#, and am considering how exactly the build process would work. Do C# projects in Visual Studio 2008 support custom build actions that generate C# classes? I found the "Custom Tool" option, but I'm not sure i...

Autogenerate value objects

Given an interface or interfaces, what is the best way to generate an class implementation? interface Vehicle { Engine getEngine(); } @Generated class Car implements Vehicle { private final Engine engine; public Car(Engine engine) { this.engine = engine; } public Engine getEngine() { return...

Appending text to class names

Hi, Is there a way in Subsonic to append text to a generated class name? I know the appendWith property can be used in cases where the property name conflicts with type names, but is there a way to do it for every table regardless of the name? I've tried using the regular expression match and replace but that also appends the text to th...

Time to develop an option in Eclipse to modify a Java file source

I'm evaluating the possibility of developing an Eclipse plugin to modify the source code of some Java files. The Eclipse plugin should: add one menu option or context menu option to launch the modification process. add a key binding only alter the UI in that way when an editor has been open on a Java file. the modification process wou...

Code generation in Maven

I want to autogenerate some java classes from interfaces. My first thought was to write a code generator, and integrate it as a maven plugin. I was thinking of creating a maven plugin with a codegen goal that is called during the build process. So if I choose this route, how do I provide the plugin with the interfaces to be processed? ...

Automatic generation of wrappers to prevent "malicious downcast"?

If you implement an interface in Java, there is nothing to prevent the caller from looking at what concrete implementation you have supplied, casting to that class and calling methods that are not in the interface. I believe this is called "malicious downcasting". A way to prevent this is to create a wrapper that only has the interface'...

Generating Delegate Types dynamically in C#.

We have a requirement where we need to generate delegate types on the fly. We need to generate delegates given the input parameters and the output. Both input and output would be simple types. eg, we need to generate int Del(int, int, int, string) and int Del2(int, int, string, int) Any pointers on how to get started on this would...

Can anyone recommend a tool for generating a simple C# ASP.Net Web Application for a SQL Server database?

I have a SQL Server 2005 database which holds a fairly basic schema. I'm fine with accessing it through Management Studio, but I need to be able to provide read-write access to other internal staff so they can modify the contents of certain tables. Can anyone recommend a tool (preferably free) that can look at a SQL Server database and...

'Encapsulate Field' tool for a PHP IDE

Does anybody know an PHP IDE that features a tool to encapsulate private variables, as Visual Studio does for C#/VB/etc? In fact any IDEs that support PHP and include code-generation tools would be of interest. ...

Is there a way of auto-generating elements.xml etc files for sharepoint development?

I have matched the "12 hive" structure in my solution, and I am using SPDeploy to create and deploy .wsp files and to deploy to my test servers. I am about to add a whole bunch of files throughout the structure and there is quite a lot of redundancy in the elements.xml and feature.xml files. Has anyone done the work to assist in the cre...

How can I extend Java code generated by JAXB, CXF or Hibernate tools?

With generated Java source code, like code generated with Hibernate tools code generated with JAXB schema binding (xjc) code generated with WDSL2Java (cxf) all generated classes are "value object" types, without business logic. And if I add methods to the generated source code, I will loose these methods if I repeat the source code g...

Any good C# code generator for using oracle stored procedures?

I'm looking for a C# code generator which generate C# automatically to access stored procedures on Oracle Database. For instance, if I have some packages on schema DEV like: PACKAGE1 with FUNC1, FUN2 PACKAGE2 with FUNC3, FUN4 The generator creates code to run from C# the following code: int a = PACKAGE1.FUNC1(12, 34, "hello"); An...

JAXB Types problem

I have an xsd that looks like this (snippet): <xs:complexType name="IDType"> <xs:choice minOccurs="1" maxOccurs="2"> <xs:element name="FileID" minOccurs="0" maxOccurs="1" type="an..35" /> <xs:element name="IDNumber1" minOccurs="0" maxOccurs="1" type="an..35" /> <xs:element name="Number" minOccurs="0" maxOccurs="1" ty...

Is there an Emacs Lisp library for generating HTML?

I'm looking for a solution that allows me to write native Emacs Lisp code and at compile time turns it into HTML, like Franz's htmlgen: (html ((:div class "post") (:h1 "Title") (:p "Hello, World!"))) Of course I can write my own macros, but I'm interested if there are any projects around this problem. ...

C# --> Java code generator

I have a small (~2000 lines of code) class that I would like to use from both java & .NET. There are several approaches to do this - among them wrapping the class as a service, using some interop voodoo, or duplicating the code to both C# & java. Do you know an out-of-the-box tool that accomplishes the latter - takes a simple C# class w...

Auto Generate Gets and Sets from a Database

I am coming from VB6 and I am starting to convert an existing VB6 code to VB.Net. What tools can I use to automate this task? ...