use of org.ndx.agile.architecture.sequence.generator.javaparser.adapter.MethodDeclarationRepresentation in project agile-architecture-documentation-system by Riduidel.
the class SequenceDiagramConstructionKit method activateCreation.
public void activateCreation(ObjectCreationRepresentation objectCreationRepresentation) {
createIfNeeded(objectCreationRepresentation, (objectCreation, toComponent) -> {
components.add(toComponent);
methodCalls.append("create ").append(componentId(toComponent)).append('\n');
// Don't forget to add the "new" call
Optional<MethodDeclarationRepresentation> declaration = objectCreation.containerOfType(MethodDeclarationRepresentation.class);
declaration.stream().forEach(decl -> {
Component fromComponent = classesToComponents.get(decl.className);
methodCalls.append(componentId(fromComponent)).append("->").append(componentId(toComponent)).append(":new\n");
});
});
}
use of org.ndx.agile.architecture.sequence.generator.javaparser.adapter.MethodDeclarationRepresentation in project agile-architecture-documentation-system by Riduidel.
the class SequenceDiagramGenerator method findImplementationOf.
private MethodDeclarationRepresentation findImplementationOf(MethodCallRepresentation methodCallRepresentation) {
Component component = classesToComponents.get(methodCallRepresentation.calledTypeName);
MethodDeclarationRepresentation representation = null;
for (CodeElement code : component.getCode()) {
representation = callGraphModel.getClassFor(code.getType()).getMethodFor(methodCallRepresentation);
// This will be null.
if (representation != null) {
if (!representation.getChildren().isEmpty()) {
break;
}
}
}
return representation;
}
Aggregations