private void documentOperations(WithOperationsDeclaration<?> declaration, Map<String, Element> methods) { for (OperationDeclaration operation : declaration.getOperations()) { Element method = methods.get(operation.getName()); // there are two cases in which method can be null: // * A synthetic operation which was not defined in any class but added by a model property // * An extension which operations are defined across multiple classes and the one being processed is not // the one which defined the operation being processed if (method == null) { continue; } MethodDocumentation documentation = processor.getMethodDocumentation(processingEnv, method); operation.setDescription(documentation.getSummary()); parameterDeclarer.document(operation, method, documentation); } }
private OperationDeclaration buildUnauthorizeOperation() { OperationDeclaration operation = new OperationDeclaration(UNAUTHORIZE_OPERATION_NAME); operation.setDescription("Deletes all the access token information of a given resource owner id so that it's impossible to " + "execute any operation for that user without doing the authorization dance again"); operation.setBlocking(true); operation.setExecutionType(BLOCKING); operation.setOutput(toDeclaration(voidType)); operation.setOutputAttributes(toDeclaration(voidType)); operation.setRequiresConnection(false); operation.setSupportsStreaming(false); operation.setTransactional(false); operation.addModelProperty(new ComponentExecutorModelProperty((model, params) -> new UnauthorizeOperationExecutor())); ParameterGroupDeclaration group = operation.getParameterGroup(DEFAULT_GROUP_NAME); group.showInDsl(false); ParameterDeclaration parameter = new ParameterDeclaration(RESOURCE_OWNER_ID_PARAMETER_NAME); parameter.setDescription("The id of the resource owner which access should be invalidated"); parameter.setExpressionSupport(SUPPORTED); parameter.setLayoutModel(LayoutModel.builder().build()); parameter.setRequired(false); parameter.setParameterRole(BEHAVIOUR); parameter.setType(stringType, false); group.addParameter(parameter); return operation; }
private void documentOperations(WithOperationsDeclaration<?> declaration, Map<String, Element> methods) { for (OperationDeclaration operation : declaration.getOperations()) { Element method = methods.get(operation.getName()); // there are two cases in which method can be null: // * A synthetic operation which was not defined in any class but added by a model property // * An extension which operations are defined across multiple classes and the one being processed is not // the one which defined the operation being processed if (method == null) { continue; } MethodDocumentation documentation = processor.getMethodDocumentation(processingEnv, method); operation.setDescription(documentation.getSummary()); parameterDeclarer.document(operation, method, documentation); } }
private OperationDeclaration buildUnauthorizeOperation() { OperationDeclaration operation = new OperationDeclaration(UNAUTHORIZE_OPERATION_NAME); operation.setDescription("Deletes all the access token information of a given resource owner id so that it's impossible to " + "execute any operation for that user without doing the authorization dance again"); operation.setBlocking(true); operation.setExecutionType(BLOCKING); operation.setOutput(toDeclaration(voidType)); operation.setOutputAttributes(toDeclaration(voidType)); operation.setRequiresConnection(false); operation.setSupportsStreaming(false); operation.setTransactional(false); operation.addModelProperty(new ComponentExecutorModelProperty((model, params) -> new UnauthorizeOperationExecutor())); ParameterGroupDeclaration group = operation.getParameterGroup(DEFAULT_GROUP_NAME); group.showInDsl(false); ParameterDeclaration parameter = new ParameterDeclaration(RESOURCE_OWNER_ID_PARAMETER_NAME); parameter.setDescription("The id of the resource owner which access should be invalidated"); parameter.setExpressionSupport(SUPPORTED); parameter.setLayoutModel(LayoutModel.builder().build()); parameter.setRequired(false); parameter.setParameterRole(BEHAVIOUR); parameter.setType(stringType, false); group.addParameter(parameter); return operation; }