package org.siman.generator;
-import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.ResourceBundle;
-
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
+import java.util.ResourceBundle;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
* @throws IOException
* @throws SAXException
*/
- public static void main(String[] args) throws ParserConfigurationException,
+ public static void main(final String[] args) throws ParserConfigurationException,
SAXException, IOException {
ResourceBundle bundle = ResourceBundle.getBundle("config");
String srcCtx = bundle.getString(SRC_CTX);
* @throws IOException
* @throws SAXException
*/
- private static void processMappingResource(List<Properties> daos,
- DocumentBuilderFactory dfactory, String resourceName,
- String srcPath, String outPath)
+ private static void processMappingResource(final List<Properties> daos,
+ final DocumentBuilderFactory dfactory, final String resourceName,
+ final String srcPath, final String outPath)
throws ParserConfigurationException, SAXException, IOException {
// dfactory.setValidating(false);
// dfactory.setFeature("http://xml.org/sax/features/namespaces", false);
* @param string
* @param outPath
*/
- private static void processClasses(List<Properties> daos, Document resDoc,
- String elementName, String outPath) {
+ private static void processClasses(final List<Properties> daos, final Document resDoc,
+ final String elementName, final String outPath) {
NodeList classes = resDoc.getElementsByTagName(elementName);
Element classElem;
for (int i = 0; i < classes.getLength(); i++) {
* @param string
* @param outPath
*/
- private static void generateClass(String entityName, String className,
- String templatePath, String outPath) {
+ private static void generateClass(final String entityName, final String className,
+ final String templatePath, final String outPath) {
String resultPath = outPath + className.replace(".", "/") + ".java";
System.out.println("Generating file: " + resultPath);
VelocityContext context = new VelocityContext();
* @param string
* @param outPath
*/
- private static void generateDaoContext(List<Properties> daos, String outPath) {
+ private static void generateDaoContext(final List<Properties> daos, final String outPath) {
String resultPath = outPath + "spring/daoContext.xml";
String templatePath = "templates/daoContext.xml.vm";
System.out.println("Generating file: " + resultPath);
* @param templatePath
* @param resultPath
*/
- private static void generateFile(VelocityContext context,
- String templatePath, String resultPath) {
+ private static void generateFile(final VelocityContext context,
+ final String templatePath, final String resultPath) {
Template template = null;
context.put("date", new Date());