@Override protected void onSource(WithSourcesDeclaration owner, SourceDeclaration source) { source.getModelProperty(ImplementingTypeModelProperty.class) .map(ImplementingTypeModelProperty::getType) .ifPresent(clazz -> { getOutputType(clazz).ifPresent(type -> declareCustomType(source.getOutput(), type)); getAttributesType(clazz).ifPresent(type -> declareCustomType(source.getOutputAttributes(), type)); }); source.getSuccessCallback().ifPresent(this::declareParametersCustomStaticTypes); source.getErrorCallback().ifPresent(this::declareParametersCustomStaticTypes); }
void document(TypeElement element, WithSourcesDeclaration<?>... containerDeclarations) { getSourceClasses(processingEnv, element) .forEach(sourceElement -> findMatchingSource(containerDeclarations, sourceElement) .ifPresent(source -> { source.setDescription(processor.getJavaDocSummary(processingEnv, sourceElement)); parameterDeclarer.document(source, sourceElement); Map<String, Element> methods = getApiMethods(processingEnv, singletonList(sourceElement)); source.getSuccessCallback().ifPresent(cb -> documentCallback(methods, cb)); source.getErrorCallback().ifPresent(cb -> documentCallback(methods, cb)); })); }
@Before public void before() { when(extensionLoadingContext.getExtensionDeclarer()).thenReturn(extensionDeclarer); when(extensionDeclarer.getDeclaration()).thenReturn(extensionDeclaration); when(extensionDeclaration.getMessageSources()).thenReturn(asList(sourceDeclaration)); when(sourceDeclaration.getParameterGroup(DEFAULT_GROUP_NAME)).thenReturn(parameterGroup); when(sourceDeclaration.getSuccessCallback()).thenReturn(empty()); when(sourceDeclaration.getErrorCallback()).thenReturn(empty()); }
@Before public void before() { when(extensionLoadingContext.getExtensionDeclarer()).thenReturn(extensionDeclarer); when(extensionDeclarer.getDeclaration()).thenReturn(extensionDeclaration); when(extensionDeclaration.getOperations()).thenReturn(singletonList(operation)); when(extensionDeclaration.getMessageSources()).thenReturn(singletonList(source)); when(source.getSuccessCallback()).thenReturn(empty()); when(source.getErrorCallback()).thenReturn(empty()); when(source.getModelProperty(ExtensionTypeDescriptorModelProperty.class)).thenReturn(empty()); when(operation.getModelProperty(ExtensionOperationDescriptorModelProperty.class)).thenReturn(empty()); when(operation.getParameterGroup(DEFAULT_GROUP_NAME)).thenReturn(new ParameterGroupDeclaration(DEFAULT_GROUP_NAME)); when(source.getParameterGroup(DEFAULT_GROUP_NAME)).thenReturn(new ParameterGroupDeclaration(DEFAULT_GROUP_NAME)); mockMediaType(operation, false); mockMediaType(source, false); }
@Override protected void onSource(WithSourcesDeclaration owner, SourceDeclaration source) { source.getModelProperty(ImplementingTypeModelProperty.class) .map(ImplementingTypeModelProperty::getType) .ifPresent(clazz -> { getOutputType(clazz).ifPresent(type -> declareCustomType(source.getOutput(), type)); getAttributesType(clazz).ifPresent(type -> declareCustomType(source.getOutputAttributes(), type)); }); source.getSuccessCallback().ifPresent(this::declareParametersCustomStaticTypes); source.getErrorCallback().ifPresent(this::declareParametersCustomStaticTypes); }
void document(TypeElement element, WithSourcesDeclaration<?>... containerDeclarations) { getSourceClasses(processingEnv, element) .forEach(sourceElement -> findMatchingSource(containerDeclarations, sourceElement) .ifPresent(source -> { source.setDescription(processor.getJavaDocSummary(processingEnv, sourceElement)); parameterDeclarer.document(source, sourceElement); Map<String, Element> methods = getApiMethods(processingEnv, singletonList(sourceElement)); source.getSuccessCallback().ifPresent(cb -> documentCallback(methods, cb)); source.getErrorCallback().ifPresent(cb -> documentCallback(methods, cb)); })); }