Example usage for java.lang.reflect AnnotatedElement toString

List of usage examples for java.lang.reflect AnnotatedElement toString

Introduction

In this page you can find the example usage for java.lang.reflect AnnotatedElement toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.icfcc.cache.annotation.SpringCacheAnnotationParser.java

CacheOperation parseUpdateAnnotation(AnnotatedElement ae, CachePut caching) {
    CachePutOperation cuo = new CachePutOperation();
    cuo.setCacheNames(caching.value());//w w  w .  j a va 2s  .  com
    cuo.setCondition(caching.condition());
    cuo.setKey(caching.key());
    cuo.setName(ae.toString());
    return cuo;
}

From source file:com.icfcc.cache.annotation.SpringCacheAnnotationParser.java

CacheableOperation parseCacheableAnnotation(AnnotatedElement ae, Cacheable caching) {
    CacheableOperation cuo = new CacheableOperation();
    cuo.setCacheNames(caching.value());/* w ww  . jav a2s  .  c o m*/
    cuo.setCondition(caching.condition());
    cuo.setKey(caching.key());
    cuo.setName(ae.toString());
    return cuo;
}

From source file:com.icfcc.cache.annotation.SpringCacheAnnotationParser.java

CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, CacheEvict caching) {
    CacheEvictOperation ceo = new CacheEvictOperation();
    ceo.setCacheNames(caching.value());/*from w  w  w  .j a v a  2  s  .  c  o  m*/
    ceo.setCondition(caching.condition());
    ceo.setKey(caching.key());
    ceo.setCacheWide(caching.allEntries());
    ceo.setBeforeInvocation(caching.beforeInvocation());
    ceo.setName(ae.toString());
    return ceo;
}

From source file:org.jdal.aop.config.SerializableAnnotationBeanPostProcessor.java

private ResolvableType getResolvableType(AnnotatedElement element) {
    if (element instanceof Field)
        return ResolvableType.forField((Field) element);
    else if (element instanceof Method)
        return ResolvableType.forMethodParameter(new MethodParameter((Method) element, 0));

    throw new IllegalArgumentException("SerializableProxy annotation should only be applied on types"
            + ", fields or methods but was found in [" + element.toString() + "]");
}

From source file:com.medsphere.fileman.FMRecord.java

/**
 * if the annotation is a method, get the setter for the method and invoke it.
 * @param ele/*from  w  w w .ja  v  a2 s. c o m*/
 * @param method
 * @param obj
 */
private void invokeSetter(AnnotatedElement ele, Method method, Object obj) {
    String getter = method.getName();
    String setterName = getter.replaceFirst("get", "set");
    try {
        Method setter = method.getDeclaringClass().getMethod(setterName, obj.getClass());
        setter.invoke(this, obj);
    } catch (SecurityException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
        logger.error("Unable to find setter for " + ele.toString()
                + ".  Ensure that a setter exists for this field.  Expecting " + setterName);
    } catch (IllegalArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}