Package org.reverspring.annotations

Examples of org.reverspring.annotations.SpringDescribe


      return null;

    Method idMethod = null;
    for (Method method : obj.getClass().getMethods()) {

      SpringDescribe describe = method.getAnnotation(SpringDescribe.class);
      if (describe != null && describe.isIdSource() && method.getGenericParameterTypes().length == 0) {
        idMethod = method;
        break;
      }
    }
View Full Code Here


  }

  public Set<String> getPropertyNames(Object obj) {
    Set<String> included = new HashSet<String>();
    boolean defaultInclude = false;
    SpringDescribe classAnnotation = (SpringDescribe) obj.getClass().getAnnotation(SpringDescribe.class);
    if (classAnnotation != null)
      defaultInclude = classAnnotation.included();

    // look for getters
    Method[] methods = obj.getClass().getMethods();
    for (Method method : methods) {
      if (method.getName().equals("getClass"))
        continue;
      boolean methodInclude = defaultInclude;
      String methodName = method.getName();
      if (!isValidGetter(method))
        continue;
      if (!existsSetterForGetter(method, obj.getClass()))
        continue;
      SpringDescribe annotation = (SpringDescribe) method.getAnnotation(SpringDescribe.class);

      if (annotation != null)
        methodInclude = annotation.included();
      if (!methodInclude)
        continue;
      String propertyName;
      if (methodName.startsWith("get"))
        propertyName = methodName.substring(3); // getXXX
View Full Code Here

      } catch (Exception e) {
      }
    }
    if (method == null)
      return false;
    SpringDescribe annotation = method.getAnnotation(SpringDescribe.class);
    if (annotation == null) {
      SpringDescribe classAnnotation = clazz.getAnnotation(SpringDescribe.class);
      if (classAnnotation == null)
        return false;
      return classAnnotation.nested();
    }
    return annotation.nested();
  }
View Full Code Here

TOP

Related Classes of org.reverspring.annotations.SpringDescribe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.