mguymon / model-citizen

Annotation based model factory for Java
Apache License 2.0
94 stars 13 forks source link

Include a way to create objects when they do not have a default empty constructor #22

Closed jesse-zlata closed 10 years ago

jesse-zlata commented 10 years ago

Currently is there is no default constructor the following error is thrown:

com.tobedevoured.modelcitizen.template.BlueprintTemplateException: java.lang.NoSuchMethodException: No such accessible constructor on object

I see the constructor callback but there is no documentation around its use.

Thanks

mguymon commented 10 years ago

ModelCitizen should be fine if there is no constructor defined, could you post the stack trace and I will take a look?

Here is the sample callback for constructor (at the bottom): https://github.com/mguymon/model-citizen/blob/master/core/src/test/java/com/tobedevoured/modelcitizen/blueprint/CarBlueprint.java

mguymon commented 10 years ago

Here is the correct link to the sample constructor callback - https://github.com/mguymon/model-citizen/blob/master/core/src/test/java/com/tobedevoured/modelcitizen/blueprint/SpareTireBlueprint.java

jesse-zlata commented 10 years ago

Thanks for the super fast reply. I used your the linked example and it corrected the error.