use of org.eclipse.winery.repository.rest.resources.apiData.converter.QNameConverter in project winery by eclipse.
the class TemplatesOfOneType method getJSON.
/**
* returns a list of all implementations of a type using the getAllImplementations method
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getJSON() {
Collection<? extends DefinitionsChildId> allImplementations = this.getAllImplementations();
List<QNameApiData> res = new ArrayList<>(allImplementations.size());
QNameConverter adapter = new QNameConverter();
for (DefinitionsChildId id : allImplementations) {
res.add(adapter.marshal(id.getQName()));
}
return Response.ok().entity(res).build();
}
use of org.eclipse.winery.repository.rest.resources.apiData.converter.QNameConverter in project winery by eclipse.
the class ImplementationsOfOneNodeTypeResource method getJSON.
@Override
public Response getJSON() {
Collection<NodeTypeImplementationId> allImplementations = RepositoryFactory.getRepository().getAllElementsReferencingGivenType(NodeTypeImplementationId.class, this.getTypeId().getQName());
List<QNameApiData> res = new ArrayList<>(allImplementations.size());
QNameConverter adapter = new QNameConverter();
for (NodeTypeImplementationId id : allImplementations) {
res.add(adapter.marshal(id.getQName()));
}
return Response.ok().entity(res).build();
}
use of org.eclipse.winery.repository.rest.resources.apiData.converter.QNameConverter in project winery by eclipse.
the class ImplementationsOfOneRelationshipTypeResource method getJSON.
@Override
public Response getJSON() {
Collection<RelationshipTypeImplementationId> allImplementations = RepositoryFactory.getRepository().getAllElementsReferencingGivenType(RelationshipTypeImplementationId.class, this.getTypeId().getQName());
List<QNameApiData> res = new ArrayList<>(allImplementations.size());
QNameConverter adapter = new QNameConverter();
for (RelationshipTypeImplementationId id : allImplementations) {
res.add(adapter.marshal(id.getQName()));
}
return Response.ok().entity(res).build();
}
Aggregations