jlamfers/RazorMachine

Configuration

Closed this issue · 5 comments

Above RazorConfig class I read:

Holds all configuration settings. You may initialize the configuration by default, or by an xml string / xml file name, or by explicit arguments, and/or by another GeneratorConfig object.

How can I do that if the class has no constructor and all the methods are either private or internal?

That comment is old and incorrect. The RazorConfig class is initialized together with the RazorMachine class. For this purpose the RazorMachine class has overloaded constructors. I removed the incorrect comment.

Thanks for the quick response. I figured later. I would prefer the config object approach though.

yes me too

great work though

I made the configuration initializers public and I added a RazorMachine constructor that takes a RazorConfig instance. When that configuration instance is registered inside the RazorContext it is ensured to be read-only so that its settings cannot be changed anymore.