Search in sources :

Example 1 with AgileArchitectureSection

use of org.ndx.agile.architecture.base.AgileArchitectureSection in project agile-architecture-documentation-system by Riduidel.

the class DocumentsCollector method collect.

/**
 * Collect elements of all sections produced for the given component
 * @param element the element for which we want the output
 * @param builder output generator used
 */
public void collect(Element element, OutputBuilder builder) {
    for (AgileArchitectureSection section : AgileArchitectureSection.values()) {
        File sectionFolderFor = builder.outputDirectoryFor(section, element);
        File[] filesArray = sectionFolderFor.listFiles((dir, name) -> name.toLowerCase().endsWith(".adoc"));
        if (filesArray != null && filesArray.length > 0) {
            Set<File> files = Stream.of(filesArray).map(file -> file.getAbsoluteFile()).collect(Collectors.toCollection(() -> new TreeSet<File>()));
            hierarchy.get(section).put(element, files);
        }
    }
}
Also used : Arrays(java.util.Arrays) OutputBuilder(org.ndx.agile.architecture.base.OutputBuilder) StringUtils(org.apache.commons.lang3.StringUtils) Component(com.structurizr.model.Component) TreeSet(java.util.TreeSet) ConfigProperty(org.apache.deltaspike.core.api.config.ConfigProperty) ModelElementKeys(org.ndx.agile.architecture.base.enhancers.ModelElementKeys) Inject(javax.inject.Inject) StructurizrUtils(org.ndx.agile.architecture.base.utils.StructurizrUtils) Map(java.util.Map) Model(com.structurizr.model.Model) Container(com.structurizr.model.Container) EnumMap(java.util.EnumMap) Set(java.util.Set) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) ModelEnhancer(org.ndx.agile.architecture.base.ModelEnhancer) SoftwareSystem(com.structurizr.model.SoftwareSystem) AgileArchitectureSection(org.ndx.agile.architecture.base.AgileArchitectureSection) Collectors(java.util.stream.Collectors) File(java.io.File) Workspace(com.structurizr.Workspace) Stream(java.util.stream.Stream) TreeMap(java.util.TreeMap) Comparator(java.util.Comparator) Element(com.structurizr.model.Element) TreeSet(java.util.TreeSet) AgileArchitectureSection(org.ndx.agile.architecture.base.AgileArchitectureSection) File(java.io.File)

Aggregations

Workspace (com.structurizr.Workspace)1 Component (com.structurizr.model.Component)1 Container (com.structurizr.model.Container)1 Element (com.structurizr.model.Element)1 Model (com.structurizr.model.Model)1 SoftwareSystem (com.structurizr.model.SoftwareSystem)1 File (java.io.File)1 IOException (java.io.IOException)1 Arrays (java.util.Arrays)1 Comparator (java.util.Comparator)1 EnumMap (java.util.EnumMap)1 Map (java.util.Map)1 Set (java.util.Set)1 TreeMap (java.util.TreeMap)1 TreeSet (java.util.TreeSet)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Inject (javax.inject.Inject)1 FileUtils (org.apache.commons.io.FileUtils)1 StringUtils (org.apache.commons.lang3.StringUtils)1