我在将值设置为SoyFileSupplier列表时遇到问题,列表中应该有类型文件的值,通过传递一个soyFileSupplier列表来将soyfilesetParse类用于解析,将值设置为。文件(sample.soy)将值设置为列表
The sample code is as below:
public class test {
main() {
soyTree=parseSoyFiles(soyFileSuppliers);
}
}
调用类是:
public class soyFileSetParse {
public static SoyFileSetNode parseSoyFiles(List<SoyFileSupplier> soyFileSuppliers)
throws SoySyntaxException {
IdGenerator nodeIdGen = new IntegerIdGenerator();
SoyFileSetNode soyTree = new SoyFileSetNode(nodeIdGen.genStringId(), nodeIdGen);
for (SoyFileSupplier soyFileSupplier : soyFileSuppliers) {
soyTree.addChild(parseSoyFileHelper(soyFileSupplier, nodeIdGen));
}
return soyTree;
}
}
设置为文件类型:
public class SoyFileSupplier {
/**
* Creates a new {@code SoyFileSupplier} given a {@code File}.
*
* @param inputFile The Soy file.
*/
public SoyFileSupplier(File inputFile) {
this(Files.newReaderSupplier(inputFile, Charsets.UTF_8), inputFile.getPath());
}
我不明白我做错了什么。
您的问题是什么? – Saket