From 010fb2dcae06477f2b9ac5be9f0af1d0308f12b4 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Sat, 17 Feb 2018 10:26:31 +0100 Subject: [PATCH] doc: add missing Javadoc in ModelsUtils --- src/main/java/spoon/testing/utils/ModelUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/spoon/testing/utils/ModelUtils.java b/src/main/java/spoon/testing/utils/ModelUtils.java index 3c0ef22b5e7..0bf065b4733 100644 --- a/src/main/java/spoon/testing/utils/ModelUtils.java +++ b/src/main/java/spoon/testing/utils/ModelUtils.java @@ -37,6 +37,7 @@ public static Factory createFactory() { return new FactoryImpl(new DefaultCoreFactory(), new StandardEnvironment()); } + /** Utility method for testing: creates the model of `packageName` from src/test/java and returns the CtType corresponding to `className` */ public static > T build(String packageName, String className) throws Exception { SpoonModelBuilder comp = new Launcher().createCompiler(); comp.addInputSources(SpoonResourceHelper.resources("./src/test/java/" + packageName.replace('.', '/') + "/" + className + ".java")); @@ -44,6 +45,7 @@ public static > T build(String packageName, String className return comp.getFactory().Package().get(packageName).getType(className); } + /** Utility method for testing: creates the model of `packageName` and the factory from src/test/java and returns the CtType corresponding to `className` */ public static > T build(String packageName, String className, final Factory f) throws Exception { Launcher launcher = new Launcher() { @Override @@ -57,6 +59,7 @@ public Factory createFactory() { return comp.getFactory().Package().get(packageName).getType(className); } + /** Utility method for testing: creates the model of the given `classesToBuild` from src/test/java and returns the factory */ public static Factory build(Class... classesToBuild) throws Exception { SpoonModelBuilder comp = new Launcher().createCompiler(); for (Class classToBuild : classesToBuild) { @@ -66,6 +69,7 @@ public static Factory build(Class... classesToBuild) throws Exception { return comp.getFactory(); } + /** Utility method for testing: creates the noclasspath model of the given `classesToBuild` from src/test/java and returns the factory */ public static Factory buildNoClasspath(Class... classesToBuild) throws Exception { final Launcher launcher = new Launcher(); launcher.getEnvironment().setNoClasspath(true); @@ -77,6 +81,7 @@ public static Factory buildNoClasspath(Class... classesToBuild) throws Except return comp.getFactory(); } + /** Builds the Spoon mode of the `filesToBuild` given as parameter */ public static Factory build(File... filesToBuild) { final Launcher launcher = new Launcher(); launcher.getEnvironment().setNoClasspath(true); @@ -92,6 +97,7 @@ public static Factory build(File... filesToBuild) { return comp.getFactory(); } + /** Builds and returns the Spoon model of `` classToBuild */ public static CtType buildClass(Class classToBuild) throws Exception { return build(classToBuild).Type().get(classToBuild); }