Example usage for com.fasterxml.jackson.databind.introspect AnnotatedClass memberMethods

List of usage examples for com.fasterxml.jackson.databind.introspect AnnotatedClass memberMethods

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.introspect AnnotatedClass memberMethods.

Prototype

public Iterable<AnnotatedMethod> memberMethods() 

Source Link

Usage

From source file:com.github.mrenou.jacksonatic.internal.AnnotatedClassLogger.java

private static void logMethodAnnotations(AnnotatedClass annotatedClass, StringBuilder sb) {
    stream(annotatedClass.memberMethods())
            .filter(annotatedMethod -> hasAnnotationOrParameterAnnotation(annotatedMethod))
            .forEach(annotatedMethod -> {
                sb.append("> Method["
                        + methodSignature(annotatedMethod.getName(), annotatedMethod.getRawParameterTypes())
                        + "] : " + annotationsItToStr(annotatedMethod.annotations())).append(ln);
                logParameters(sb, annotatedMethod);
            });//from   w  w  w .ja v a  2 s .  c  o m
}

From source file:com.github.mrenou.jacksonatic.internal.annotations.ClassAnnotationDecorator.java

private static void addMethodAnnotations(AnnotatedClass annotatedClass,
        ClassMappingInternal<Object> classMapping) {
    stream(annotatedClass.memberMethods()).forEach(annotatedMethod -> getFirstPresent(
            () -> classMapping.<MethodMappingInternal>getMethodMappingInternal(
                    methodSignature(annotatedMethod.getName(), annotatedMethod.getRawParameterTypes())),
            () -> classMapping.<MethodMappingInternal>getMethodMappingInternal(
                    methodSignatureIgnoringParameters(annotatedMethod.getName())))
                            .ifPresent(methodMapping -> methodMapping.getAnnotations().values().stream()
                                    .forEach(annotatedMethod::addOrOverride)));
}

From source file:com.arpnetworking.logback.jackson.StenoAnnotationIntrospector.java

/**
 * {@inheritDoc}/*from   www .ja v a  2  s. c om*/
 */
@Override
public boolean hasAsValueAnnotation(final AnnotatedMethod annotatedMethod) {
    // The @LogValue annotation if active takes precedence
    final AnnotatedClass annotatedClass = annotatedMethod.getContextClass();
    for (final AnnotatedMethod otherAnnotatedMethod : annotatedClass.memberMethods()) {
        final LogValue annotation = _findAnnotation(otherAnnotatedMethod, LogValue.class);
        if (annotation != null) {
            if (annotation.enabled()) {
                return otherAnnotatedMethod.equals(annotatedMethod);
            } else if (!annotation.fallback()) {
                return false;
            }
        }
    }

    // Otherwise use default logic (e.g respect @JsonValue)
    return super.hasAsValueAnnotation(annotatedMethod);
}