Author: tv
Date: Sun Apr 21 13:21:14 2024
New Revision: 1917238
URL: http://svn.apache.org/viewvc?rev=1917238&view=rev
Log:
Eclipse cleanup
Modified:
db/torque/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java
Modified:
db/torque/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java?rev=1917238&r1=1917237&r2=1917238&view=diff
==============================================================================
---
db/torque/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java
(original)
+++
db/torque/trunk/torque-ant-tasks/src/main/java/org/apache/torque/ant/task/Torque4JDBCTransformTask.java
Sun Apr 21 13:21:14 2024
@@ -2,13 +2,13 @@ package org.apache.torque.ant.task;
/*
* Copyright 2001-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,18 +45,18 @@ import org.apache.torque.generator.contr
*/
public class Torque4JDBCTransformTask extends Task
{
-
+
/**
- * The packaging type of the generation unit, either "directory"
+ * The packaging type of the generation unit, either "directory"
* or "classpath". Default is "classpath".
*/
private String packaging = "classpath";
-
+
/**
* The target directory for files which are generated each time anew.
* Default is "target/generated-sources"
*/
- private File defaultOutputDir = new File("target/generated-schema");
+ private File defaultOutputDir = new File("target/generated-schema");
/**
* The root directory of the project.
@@ -64,10 +64,10 @@ public class Torque4JDBCTransformTask ex
* Default is ".".
*/
private File projectRootDir = new File(".");
-
+
/** Name of XML database schema produced. */
protected String xmlSchema = "schema.xml";
-
+
/**
* The Loglevel to use in the generation process. Must be one of
* trace, debug, info, warn or error.
@@ -86,12 +86,12 @@ public class Torque4JDBCTransformTask ex
/** JDBC password. */
protected String dbPassword;
-
+
/**
* The configuration package of the generation unit.
*/
private String configPackage;
-
+
/**
* The configuration directory of the generation unit.
* Has no effect if packaging is "classpath".
@@ -156,17 +156,17 @@ public class Torque4JDBCTransformTask ex
// Attemtp to connect to a database.
//Connection con = DriverManager.getConnection(dbUrl, dbUser,
dbPassword);
//log("DB connection established", Project.MSG_INFO);
-
+
Controller controller = new Controller();
List<UnitDescriptor> unitDescriptors = new ArrayList<>();
-
+
Map<String, String> overrideOptions = new HashMap<>();
overrideOptions.put("torque.jdbc2schema.url", dbUrl);
overrideOptions.put("torque.jdbc2schema.driver", dbDriver);
overrideOptions.put("torque.jdbc2schema.user", dbUser);
overrideOptions.put("torque.jdbc2schema.password", dbPassword);
-
+
UnitDescriptor.Packaging packaging;
if ("directory".equals(this.packaging))
{
@@ -183,7 +183,7 @@ public class Torque4JDBCTransformTask ex
+ ", must be jar, directory or classpath");
}
log("Packaging is " + packaging, Project.MSG_DEBUG);
-
+
ProjectPaths defaultProjectPaths;
if (UnitDescriptor.Packaging.DIRECTORY == packaging)
{
@@ -199,11 +199,11 @@ public class Torque4JDBCTransformTask ex
{
throw new IllegalStateException("Unknown packaging" + packaging);
}
-
+
CustomProjectPaths projectPaths
= new CustomProjectPaths(defaultProjectPaths);
-
+
if (UnitDescriptor.Packaging.CLASSPATH == packaging)
{
if (configPackage == null)
@@ -223,7 +223,7 @@ public class Torque4JDBCTransformTask ex
Project.MSG_DEBUG);
}
}
-
+
if (defaultOutputDir != null)
{
projectPaths.setOutputDirectory(null, defaultOutputDir);
@@ -231,15 +231,15 @@ public class Torque4JDBCTransformTask ex
+ defaultOutputDir.getAbsolutePath(),
Project.MSG_DEBUG);
}
-
+
log("ProjectPaths = " + projectPaths);
-
+
Loglevel convertedLoglevel = null;
if (this.loglevel != null)
{
convertedLoglevel = Loglevel.getByKey(loglevel);
}
-
+
UnitDescriptor unitDescriptor = new UnitDescriptor(
packaging,
projectPaths,
@@ -251,15 +251,15 @@ public class Torque4JDBCTransformTask ex
try {
log("Generation started", Project.MSG_DEBUG);
- controller.run(unitDescriptors);
+ controller.run(unitDescriptors);
log("Generation successful", Project.MSG_INFO);
} catch (GeneratorException e) {
log("Error during jdbc3schema generation", e, Project.MSG_ERR);
throw new BuildException(e.getMessage());
- }
+ }
}
-
+
public void setConfigDir(final File configDir)
{
this.configDir = configDir;
@@ -291,7 +291,7 @@ public class Torque4JDBCTransformTask ex
this.projectRootDir = projectRootDir;
}
-
+
/**
* Sets the packaging.
*
@@ -309,5 +309,5 @@ public class Torque4JDBCTransformTask ex
public void setDbPassword(String dbPassword) {
this.dbPassword = dbPassword;
}
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]