[Lutingenerator-commits] r330 - maven-generator-plugin/trunk/src/main/java/org/codelutin/generator/plugin
Author: tchemit Date: 2008-10-13 13:46:12 +0000 (Mon, 13 Oct 2008) New Revision: 330 Modified: maven-generator-plugin/trunk/src/main/java/org/codelutin/generator/plugin/CopyVersionFiles.java Log: foreach + javadoc Modified: maven-generator-plugin/trunk/src/main/java/org/codelutin/generator/plugin/CopyVersionFiles.java =================================================================== --- maven-generator-plugin/trunk/src/main/java/org/codelutin/generator/plugin/CopyVersionFiles.java 2008-10-13 13:44:32 UTC (rev 329) +++ maven-generator-plugin/trunk/src/main/java/org/codelutin/generator/plugin/CopyVersionFiles.java 2008-10-13 13:46:12 UTC (rev 330) @@ -156,7 +156,8 @@ /** * Check if previous saved files are already present - */ + * @return <code>true</code> if already present,<code>false</code> otherwise. + */ protected boolean checkExistence() { boolean exist = false; @@ -199,8 +200,8 @@ fileSet.setDir(destDirGen); fileSet.setIncludes(copyVersionFiles); copy.addFileset(fileSet); - - /* Execution */ + + /* Execution */ copy.execute(); } @@ -213,24 +214,24 @@ File[] modelFiles = srcModelDir.listFiles(this); - for (int i = 0; i < modelFiles.length; ++i) { - SAXReader saxR = new SAXReader(); - Document document; - try { - document = saxR.read(modelFiles[i]); - Node node; - node = document.selectSingleNode("/objectModel/@version"); - if (node != null) { - versionFound = node.getStringValue(); - } - node = document.selectSingleNode("/objectModel/@name"); - if (node != null) { - modelNameFound = node.getStringValue(); - } - } catch (DocumentException e) { - logger.error("Can't read document", e); - } - } + for (File modelFile : modelFiles) { + SAXReader saxR = new SAXReader(); + Document document; + try { + document = saxR.read(modelFile); + Node node; + node = document.selectSingleNode("/objectModel/@version"); + if (node != null) { + versionFound = node.getStringValue(); + } + node = document.selectSingleNode("/objectModel/@name"); + if (node != null) { + modelNameFound = node.getStringValue(); + } + } catch (DocumentException e) { + logger.error("Can't read document", e); + } + } } protected Project createProject() {
participants (1)
-
tchemit@users.labs.libre-entreprise.org