Wiki

Clone wiki

TraceabilityV2 / TraceCodeGenLib / IClassGenerator

Home

TraceCodeGenerator Lib

#IClassGenerator

This IClassGenerator interface provides a standard implementation for each of the generators. It also is the requirement to pass a generator into the FileWriter so that the code is actually written to disk.

##Properties ###string Namespace { get; } Retrieves the namespace the code will inhabit once it is generated.

###string DeclarationName { get; } The type name of the generated class. This field will appear in code where the class is declared.

###string QualifiedName { get; } The qualified name of the generated class. This will contain the namespace, the declaration name, and the assembly name. It will be in the format: namespace.declarationName,assemblyName

###string Filename { get; } Retrieves the name that will be used when the FileWriter writes the doce to disk. The FileWriter may override this value.

###string FileType { get; } Retrieves the file type that will be used when the code is written to disk.

###bool HasError { get; } Indicates if there was an error during code generation.

###string Error { get; } Will contain any error message that occurred in the generator. If there were no errors, then it will be null.

###IClassGenerator AddUsing(string name_space) Provides a way to add additional using clauses that will appear in the generated code.

###IClassGenerator MakePartial() The generated class will have the partial classifier added to it. This can be useful if we need to add additional code to a generated class. By making it partial, we can keep the manually written code in a separate file, and do not have worry about losing it when the generated class is regenerated.

###IClassGenerator MakeInternal(); By default, all generated classes have public visibility. This call will give it an internal visibility.

###String Build(); Causes the generater to use the gathered data to construct compilable code that is then returned in a string.

Updated