Search in sources :

Example 1 with TableRow

use of org.qi4j.envisage.util.TableRow in project qi4j-sdk by Qi4j.

the class PDFWriter method writeTypeServiceUsagePage.

private void writeTypeServiceUsagePage(Object objectDesciptor) {
    setFont(header5Font, header5FontSize);
    writeString("Usage: ", headerLineSpace);
    setFont(normalFont, normalFontSize);
    List<ServiceUsage> serviceUsages = DescriptorUtilities.findServiceUsage((ServiceDetailDescriptor) objectDesciptor);
    List<TableRow> rows = TableRowUtilities.toTableRows(serviceUsages);
    for (TableRow row : rows) {
        //String owner;
        String usage;
        String module;
        String layer;
        Object obj = row.get(0);
        if (obj instanceof CompositeDetailDescriptor) {
            CompositeDetailDescriptor descriptor = (CompositeDetailDescriptor) obj;
            //owner = descriptor.toString();
            module = descriptor.module().toString();
            layer = descriptor.module().layer().toString();
        } else {
            ObjectDetailDescriptor descriptor = (ObjectDetailDescriptor) obj;
            //owner = descriptor.toString();
            module = descriptor.module().toString();
            layer = descriptor.module().layer().toString();
        }
        InjectedFieldDetailDescriptor injectedFieldescriptor = (InjectedFieldDetailDescriptor) row.get(1);
        DependencyDescriptor dependencyDescriptor = injectedFieldescriptor.descriptor().dependency();
        Annotation annotation = dependencyDescriptor.injectionAnnotation();
        usage = injectedFieldescriptor.toString() + " (@" + annotation.annotationType().getSimpleName() + ")";
        writeString("- owner: " + row.get(0).toString());
        writeString("    * usage: " + usage);
        writeString("    * module: " + module);
        writeString("    * layer: " + layer);
    }
}
Also used : DependencyDescriptor(org.qi4j.api.composite.DependencyDescriptor) TableRow(org.qi4j.envisage.util.TableRow) Annotation(java.lang.annotation.Annotation)

Aggregations

Annotation (java.lang.annotation.Annotation)1 DependencyDescriptor (org.qi4j.api.composite.DependencyDescriptor)1 TableRow (org.qi4j.envisage.util.TableRow)1