diff --git a/.classpath b/.classpath index da1d34b65a034d5627357a4acde1243064b77764..d390ad06a53c82d6342b6aace9c7583646a551a1 100644 --- a/.classpath +++ b/.classpath @@ -1,9 +1,7 @@ - - diff --git a/pom.xml b/pom.xml index 40d8ad91a7262c304de521778d5848ce9e620896..9277962cfb5f130607adba960b57d3533e4f1214 100644 --- a/pom.xml +++ b/pom.xml @@ -45,5 +45,11 @@ tess4j 4.5.3 + + + com.github.javaparser + javaparser-core + 3.22.1 + \ No newline at end of file diff --git a/src/main/java/com/hy/java/uct/cdtocode/CDToCodeTracer.java b/src/main/java/com/hy/java/uct/cdtocode/CDToCodeTracer.java new file mode 100644 index 0000000000000000000000000000000000000000..cbc29a9a02c3b77d60798cc26bc768fae1564345 --- /dev/null +++ b/src/main/java/com/hy/java/uct/cdtocode/CDToCodeTracer.java @@ -0,0 +1,44 @@ +package com.hy.java.uct.cdtocode; + +import java.io.File; +import java.io.FileNotFoundException; + +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.CompilationUnit; +import com.hy.java.utility.common.FileEditor; + +public class CDToCodeTracer { + /** + * 将要追踪的类图放在cd_dir目录下 + */ + private static final String cd_dir = System.getProperty("user.dir") + "\\src\\main\\resources\\cdtocode\\cd\\"; + + /** + * 将要设计文档放在doc_dir目录下 + */ + private static final String doc_dir = System.getProperty("user.dir") + "\\src\\main\\resources\\cdtocode\\doc\\"; + + /** + * 将要追踪的代码放在cd_dir目录下 + */ + private static final String code_dir = System.getProperty("user.dir") + "\\src\\main\\resources\\cdtocode\\code\\"; + + /** + * 针对类图及其相关文档,追踪到代码中的类 + */ + public static void main(String[] args) { + /* + * 1、读取模型信息 + */ + FileEditor model_file = new FileEditor(cd_dir); + /* + * 2、读取文档信息 + */ + /* + * 3、读取code目录下所有java文件名 + */ + /* + * 4、遍历模型中的实体元素(类或对象),针对每个元素,在code中寻找能匹配的java文件 + */ + } +}