How Do I learn what input parameters a template needs programmatically with the Java Engine?

For some context, this is so users can edit and upload templates, and then you can provide a dynamic “generate document” UI based on the template that the user selects.

For the Java Engine use getTemplateMetrics.