Skip to content

Commit

Permalink
chore: Expose methods from Flow crud classes to browser callables
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Dec 20, 2024
1 parent 4795fd0 commit f875edb
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,20 @@ public NodeDependencies scan(@NonNull NodeDependencies nodeDependencies) {
.getEndpointExposedAnnotationName();
var exposed = classInfo.getAnnotations().stream()
.map(AnnotationInfoModel::getName)
.anyMatch(endpointExposedAnnotationName::equals);
.anyMatch(endpointExposedAnnotationName::equals)
|| alwaysExpose(classInfo);
var classInfoNode = exposed ? EndpointExposedNode.of(classInfo)
: EndpointNonExposedNode.of(classInfo);
return classInfoNode;
}

private boolean alwaysExpose(ClassInfoModel classInfo) {
return classInfo
.is("com.vaadin.flow.spring.data.jpa.CrudRepositoryService")
|| classInfo.is(
"com.vaadin.flow.spring.data.jpa.ListRepositoryService");
}

/**
* Replaces generic type parameters used in {@code @EndpointExposed} with
* their arguments defined in type signatures of endpoint class hierarchy
Expand Down

0 comments on commit f875edb

Please sign in to comment.