io.engineblock.activities.json.statements.FileStmtDoc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of at-json Show documentation
Show all versions of at-json Show documentation
A engineblock ActivityType (AT) driver module;
Provides an activity capable of writing results out via JSON
package io.engineblock.activities.json.statements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
public class FileStmtDoc extends FileStmtBlock {
private final static Logger logger = LoggerFactory.getLogger(FileStmtDoc.class);
private List blocks = new ArrayList<>();
public List getBlocks() {
return blocks;
}
public void setBlocks(List blocks) {
this.blocks.clear();
this.blocks.addAll(blocks);
}
/**
* Returns a full view of all blocks, with the global 'this' block inserted at the front of the list,
* but only if it includes statements.
* @return a new List of FileStmtSections
*/
public List getAllBlocks() {
List allSections = new ArrayList();
if (getStatements().size()>0) {
allSections.add(this);
}
allSections.addAll(blocks);
return allSections;
}
}