Package org.springframework.beans

Examples of org.springframework.beans.NotReadablePropertyException


    } catch (NotReadablePropertyException e) {

      Field field = findField(getWrappedClass(), propertyName);

      if (field == null) {
        throw new NotReadablePropertyException(getWrappedClass(), propertyName,
            "Could not find field for property during fallback access!");
      }

      makeAccessible(field);
      return getField(field, getWrappedInstance());
View Full Code Here


    }
  }

  public Object getIndexedPropertyValue(String propertyName) throws BeansException {
    if (getPropertyType(propertyName) == null) {
      throw new NotReadablePropertyException(getTargetClass(), propertyName,
          "property type could not be determined");
    }
    String rootPropertyName = getRootPropertyName(propertyName);
    Member readAccessor = getReadPropertyAccessor(rootPropertyName);
    if (readAccessor == null) {
      throw new NotReadablePropertyException(getTargetClass(), propertyName,
          "Neither non-static field nor get-method exists for indexed property");
    }
    Object rootProperty = getPropertyValue(rootPropertyName);
    if (rootProperty == null) {
      if (isStrictNullHandlingEnabled()) {
        throw new NullValueInNestedPathException(getTargetClass(), propertyName);
      }
      else if (isWritableProperty(rootPropertyName)) {
        return null;
      }
      else {
        throw new NotReadablePropertyException(getTargetClass(), propertyName);
      }
    }
    Object[] indices;
    try {
      indices = getIndices(propertyName);
View Full Code Here

  }

  public Object getSimplePropertyValue(String propertyName) throws BeansException {
    Member readAccessor = getReadPropertyAccessor(propertyName);
    if (readAccessor == null) {
      throw new NotReadablePropertyException(getTargetClass(), propertyName,
          "Neither non-static field nor get-method does exist");
    }
    Object target = getTarget();
    if (target == null) {
      return null;
View Full Code Here

    }
  }

  protected NotReadablePropertyException createNotReadablePropertyException(String propertyName, Exception e) {
    if (JdkVersion.isAtLeastJava14()) {
      NotReadablePropertyException beanException = new NotReadablePropertyException(getTargetClass(),
          propertyName);
      beanException.initCause(e);
      return beanException;
    }
    else {
      ByteArrayOutputStream stackTrace = new ByteArrayOutputStream();
      PrintWriter stackTraceWriter = new PrintWriter(stackTrace);
      e.printStackTrace(stackTraceWriter);
      stackTraceWriter.close();
      return new NotReadablePropertyException(getTargetClass(), propertyName,
          new String(stackTrace.toByteArray()));
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.NotReadablePropertyException

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.