Package org.springframework.beans

Examples of org.springframework.beans.InvalidPropertyException


      else {// readAccessor instanceof Method
        return ((Method) readAccessor).invoke(target, null);
      }
    }
    catch (IllegalAccessException e) {
      throw new InvalidPropertyException(getTargetClass(), propertyName, "Property is not accessible", e);
    }
    catch (InvocationTargetException e) {
      ReflectionUtils.handleInvocationTargetException(e);
      throw new IllegalStateException(
          "An unexpected state occured during getSimplePropertyValue(String). This may be a bug.");
View Full Code Here


    if (parameterIndex == indices.length - 1) {
      return value;
    }
    if (value == null) {
      if (isStrictNullHandlingEnabled()) {
        throw new InvalidPropertyException(getTargetClass(), "", "");
      }
      else {
        return null;
      }
    }
View Full Code Here

  private Object getArrayValue(Object array, Integer index) {
    if (Array.getLength(array) > index.intValue()) {
      return Array.get(array, index.intValue());
    }
    else if (isStrictNullHandlingEnabled()) {
      throw new InvalidPropertyException(getTargetClass(), "", "");
    }
    else {
      return null;
    }
  }
View Full Code Here

  private Object getListValue(List list, Integer index) {
    if (list.size() > index.intValue()) {
      return list.get(index.intValue());
    }
    else if (isStrictNullHandlingEnabled()) {
      throw new InvalidPropertyException(getTargetClass(), "", "");
    }
    else {
      return null;
    }
  }
View Full Code Here

        iterator.next();
      }
      return iterator.next();
    }
    else if (isStrictNullHandlingEnabled()) {
      throw new InvalidPropertyException(getTargetClass(), "", "");
    }
    else {
      return null;
    }
  }
View Full Code Here

      else {// writeAccessor instanceof Method
        ((Method) writeAccessor).invoke(target, new Object[] { value });
      }
    }
    catch (IllegalAccessException e) {
      throw new InvalidPropertyException(getTargetClass(), propertyName, "Property is not accessible", e);
    }
    catch (InvocationTargetException e) {
      ReflectionUtils.handleInvocationTargetException(e);
      throw new IllegalStateException(
          "An unexpected state occured during setPropertyValue(String, Object). This may be a bug.");
View Full Code Here

        MethodParameter parameter = new MethodParameter((Method) accessor, ((Method) accessor)
            .getParameterTypes().length - 1, nestingLevel);
        return GenericCollectionTypeResolver.getMapKeyParameterType(parameter);
      }
      else {
        throw new InvalidPropertyException(getTargetClass(), propertyName, "property not accessable");
      }
    }
    else {
      return String.class; // the default for Java 1.4
    }
View Full Code Here

            tempProps.load(in);
            System.out.println("Loaded " + tempProps.keySet() + " from " + propPath);
            CollectionUtils.mergePropertiesIntoMap(tempProps, misoProps);
          }
          catch (IOException e) {
            throw new InvalidPropertyException(MisoPropertyExporter.class, "All", "Cannot load " + baseStoragePath+propPath + " properties. Cannot read file!");
          }
        }
        catch (FileNotFoundException e) {
          throw new InvalidPropertyException(MisoPropertyExporter.class, "All", "Cannot load " + baseStoragePath+propPath + " properties. File does not exist!");
        }
      }

      super.processProperties(beanFactoryToProcess, misoProps);
      resolvedProperties = new HashMap<String, String>();
      for (Object key : misoProps.keySet()) {
        String keyStr = key.toString();

        //doesn't seem to resolve properties properly - just end up null
        //resolvedProperties.put(keyStr, resolvePlaceholder(props.getProperty(keyStr), props, SYSTEM_PROPERTIES_MODE_OVERRIDE));
        resolvedProperties.put(keyStr, misoProps.getProperty(keyStr));
      }
    }
    else {
      throw new InvalidPropertyException(MisoPropertyExporter.class,
                                         "miso.baseDirectory",
                                         "Cannot resolve miso.baseDirectory. This should be specified in the " +
                                         "miso.properties file which should be made available on the classpath.");
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.InvalidPropertyException

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.