You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
3 years ago
|
import java.util.UUID;
|
||
|
import lorem.ipsum.javatester.domain.CodeModel;
|
||
|
|
||
|
|
||
|
//By convention, the first template command line is a model creation command
|
||
|
//and the second template command line is a file creation command
|
||
|
|
||
|
<<:model CodeModel model>>
|
||
|
<<:file x {UUID.randomUUID().toString()}.txt>>
|
||
|
|
||
|
if (model.getName().equals("Lorem Ipsum")) {
|
||
|
<<:out x Hello, Lorem!\r\n>>
|
||
|
} else if (model.getName() == null) {
|
||
|
<<:out x Null???\r\n>>
|
||
|
} else {
|
||
|
<<:file y hello-{UUID.randomUUID().toString()}>>
|
||
|
<<:out y Hello, {model.getName().toUpperCase()} !\r\n>>
|
||
|
}
|
||
|
|
||
|
|
||
|
//Phase 2
|
||
|
|
||
|
import java.util.UUID;
|
||
|
import lorem.ipsum.javatester.domain.CodeModel;
|
||
|
import lorem.ipsum.javatester.file.*;
|
||
|
|
||
|
//By convention. ...
|
||
|
//and the second line has to have a model creation command
|
||
|
class GenerativeFunXYZ {
|
||
|
|
||
|
public static void generate(CodeModel inputModel, String outputPath) {
|
||
|
GeneratedFile x = GeneratesFiles.create(inputPath, ""+UUID.randomUUID().toString()+".txt");
|
||
|
CodeModel model = inputModel;
|
||
|
|
||
|
if (model.getName().equals("Lorem Ipsum")) {
|
||
|
x.out("Hello, Lorem!\r\n");
|
||
|
} else if (model.getName() == null) {
|
||
|
x.out("Null???\r\n");
|
||
|
} else {
|
||
|
GeneratedFile y = GeneratesFiles.create(inputPath, "hello-"+UUID.randomUUID().toString()+"\r\n");
|
||
|
y.out("Hello, "+model.getName().toUpperCase()+" !\r\n");
|
||
|
}
|
||
|
}
|
||
|
}
|