Package jodd.introspector

Examples of jodd.introspector.Getter


  /**
   * Extracts type of current property.
   */
  protected Class extractType(BeanProperty bp, boolean declared) {
    Getter getter = bp.getGetter(declared);
    if (getter != null) {
      if (bp.index != null) {
        Class type = getter.getGetterRawComponentType();
        return type == null ? Object.class : type;
      }
      return getter.getGetterRawType();
    }

    return null// this should not happens
  }
View Full Code Here


    if (bp.bean == null) {
      return false;
    }

    // try: getter
    Getter getter = bp.getGetter(declared);
    if (getter != null) {
      return true;
    }

    // try: (Map) get("property")
View Full Code Here

    if ((bp.name.length() == 0 && bp.first) || bp.name.equals(JoddBean.thisRef)) {
      return bp.bean;
    }

    Getter getter = bp.getGetter(declared);

    if (getter != null) {
      Object result;
      try {
        result = getter.invokeGetter(bp.bean);
      } catch (Exception ex) {
        throw new BeanException("Getter failed: " + getter, ex);
      }

      if ((result == null) && (bp.forced == true)) {
View Full Code Here

   */
  protected Object getIndexProperty(BeanProperty bp, boolean declared) {
    String indexString = extractIndex(bp);

    Object resultBean = getSimpleProperty(bp, declared);
    Getter getter = bp.getGetter(declared);

    if (indexString == null) {
      return resultBean;  // no index, just simple bean
    }
    if (resultBean == null) {
View Full Code Here

      return;
    }

    // try: getInner()
    Object nextBean = getSimpleProperty(bp, declared);
    Getter getter = bp.getGetter(declared);

    if (nextBean == null) {
      throw new BeanException("Index property is null:" + bp.name, bp);
    }
View Full Code Here

    PropertyDescriptor[] propertyDescriptors = classDescriptor.getAllPropertyDescriptors();

    for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {

      Getter getter = propertyDescriptor.getGetter(declared);
      if (getter != null) {
        String propertyName = propertyDescriptor.getName();

        boolean isTransient = false;
        // check for transient flag
View Full Code Here

  /**
   * Reads property using property descriptor.
   */
  private Object readProperty(Object source, PropertyDescriptor propertyDescriptor) {
    Getter getter = propertyDescriptor.getGetter(declared);

    if (getter != null) {
      try {
        return getter.invokeGetter(source);
      }
      catch (Exception ex) {
        throw new JsonException(ex);
      }
    }
View Full Code Here

    if (bp.bean == null) {
      return false;
    }

    // try: getter
    Getter getter = bp.getGetter(bp.declared);
    if (getter != null) {
      return true;
    }

    // try: (Map) get("property")
View Full Code Here

    if ((bp.name.length() == 0 && bp.first) || bp.name.equals(JoddBean.thisRef)) {
      return bp.bean;
    }

    Getter getter = bp.getGetter(bp.declared);

    if (getter != null) {
      Object result;
      try {
        result = getter.invokeGetter(bp.bean);
      } catch (Exception ex) {
        if (bp.silent) {
          return null;
        }
        throw new BeanException("Getter failed: " + getter, ex);
View Full Code Here

   */
  protected Object getIndexProperty(BeanProperty bp) {
    String indexString = extractIndex(bp);

    Object resultBean = getSimpleProperty(bp);
    Getter getter = bp.getGetter(bp.declared);

    if (indexString == null) {
      return resultBean;  // no index, just simple bean
    }
    if (resultBean == null) {
View Full Code Here

TOP

Related Classes of jodd.introspector.Getter

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.