Example usage for com.fasterxml.jackson.databind.introspect AnnotatedMethod getDeclaringClass

List of usage examples for com.fasterxml.jackson.databind.introspect AnnotatedMethod getDeclaringClass

Introduction

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

Prototype

public Class<?> getDeclaringClass() 

Source Link

Usage

From source file:io.fabric8.cxf.endpoint.IgnorePropertiesBackedByTransientFields.java

@Override
public boolean isGetterVisible(AnnotatedMethod method) {
    boolean answer = defaultChecker.isGetterVisible(method);
    if (answer) {
        answer = isGetterMethodWithFieldVisible(method, getGetterFieldName(method.getName()),
                method.getDeclaringClass())
                && isGetterMethodRetItselfVisible(method.getMember(), method.getDeclaringClass());
    }/*  www  .  j a  v  a  2 s.  c o m*/
    return answer;
}

From source file:io.fabric8.cxf.endpoint.IgnorePropertiesBackedByTransientFields.java

@Override
public boolean isIsGetterVisible(AnnotatedMethod method) {
    boolean answer = defaultChecker.isIsGetterVisible(method);
    if (answer) {
        answer = isGetterMethodWithFieldVisible(method, getIsGetterFieldName(method.getName()),
                method.getDeclaringClass())
                && isGetterMethodRetItselfVisible(method.getMember(), method.getDeclaringClass());
    }/*from   ww w  .  j  a  v  a  2s . c o m*/
    return answer;
}

From source file:io.fabric8.cxf.endpoint.BeanValidationAnnotationIntrospector.java

@Override
public boolean hasIgnoreMarker(AnnotatedMember m) {
    Member member = m.getMember();
    int modifiers = member.getModifiers();
    if (Modifier.isTransient(modifiers)) {
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Ignoring transient member " + m);
        }/*from  w ww.  ja  va2s .com*/
        return true;
    } else if (m instanceof AnnotatedMethod) {
        AnnotatedMethod method = (AnnotatedMethod) m;
        String methodName = method.getName();
        // lets see if there is a transient field of the same name as the getter
        if (methodName.startsWith("get") && method.getParameterCount() == 0) {
            String fieldName = Introspector.decapitalize(methodName.substring(3));
            Class<?> declaringClass = method.getDeclaringClass();
            Field field = findField(fieldName, declaringClass);
            if (field != null) {
                int fieldModifiers = field.getModifiers();
                if (Modifier.isTransient(fieldModifiers)) {
                    LOG.fine("Ignoring member " + m + " due to transient field called " + fieldName);
                    return true;
                }
            }
        }
    }
    return super.hasIgnoreMarker(m);

}