You can define templates and generated files for metaclasses, stereotypes, and criteria. If a template applies to all metaclasses, then you should create it in the Shared category.
The PowerDesigner Generation Template Language (GTL) is used to generate files from metaclasses and for scripting (see Customizing Generation with GTL). You write a template in GTL, using variables that allow you to access properties of the current object or any other object in the model.
In the following example, the Generated Files category for classifiers contains a Java Source entry, which contains a reference to the template %source%. When the file is generated for a given classifier or for the instances of a classifier with a selected stereotype or criterion, it will have the name specified in the File name field, and will contain the contents generated by this template: