Examples of InvalidPropertyException


Examples of nextapp.echo2.app.componentxml.InvalidPropertyException

            } else {
                return null;
            }
        } catch (ClassNotFoundException ex) {
            // Should not occur.
            throw new InvalidPropertyException("Object class not found.", ex)
        }
    }
View Full Code Here

Examples of nextapp.echo2.app.componentxml.InvalidPropertyException

    if (propertyElement.hasAttribute("value")) {
      return new HttpImageReference(propertyElement.getAttribute("value"));
    } else {
      Element httpImageReferenceElement = DomUtil.getChildElementByTagName(propertyElement, "http-image-reference");
      if (!httpImageReferenceElement.hasAttribute("uri")) {
        throw new InvalidPropertyException("Invalid HttpImageReference property (uri not specified).", null);
      }
      String url = httpImageReferenceElement.getAttribute("uri");
      Extent width = null;
      if (httpImageReferenceElement.hasAttribute("width")) {
        width = ExtentPeer.toExtent(httpImageReferenceElement.getAttribute("width"));
View Full Code Here

Examples of nextapp.echo2.app.componentxml.InvalidPropertyException

    throws InvalidPropertyException {
        try {
            int colorValue = Integer.parseInt(value.substring(1), 16);
            return new Color(colorValue);
        } catch (IndexOutOfBoundsException ex) {
            throw new InvalidPropertyException("Invalid color value: " + value, ex);
        } catch (NumberFormatException ex) {
            throw new InvalidPropertyException("Invalid color value: " + value, ex);
        }
    }
View Full Code Here

Examples of nextapp.echo2.app.componentxml.InvalidPropertyException

     */
    public Object getValue(ClassLoader classLoader, Class objectClass, Element propertyElement)
    throws InvalidPropertyException {
        Element fillImageElement = DomUtil.getChildElementByTagName(propertyElement, "fill-image");
        if (fillImageElement == null) {
            throw new InvalidPropertyException("Invalid FillImage property.", null);
        }
       
        Extent offsetX = fillImageElement.hasAttribute("horizontal")
                ? ExtentPeer.toExtent(fillImageElement.getAttribute("horizontal")) : null;
        Extent offsetY = fillImageElement.hasAttribute("vertical")
                ? ExtentPeer.toExtent(fillImageElement.getAttribute("vertical")) : null;
       
        int repeat;
        String repeatString = fillImageElement.getAttribute("repeat");
        if ("horizontal".equals(repeatString)) {
            repeat = FillImage.REPEAT_HORIZONTAL;
        } else if ("vertical".equals(repeatString)) {
            repeat = FillImage.REPEAT_VERTICAL;
        } else if ("none".equals(repeatString)) {
            repeat = FillImage.NO_REPEAT;
        } else {
            repeat = FillImage.REPEAT;
        }
       
        Element imageElement = DomUtil.getChildElementByTagName(fillImageElement, "image");
        if (imageElement == null) {
            throw new InvalidPropertyException("Invalid FillImage property.", null);
        }
        String imageType = imageElement.getAttribute("type");
        PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
       
        Class propertyClass;
        try {
            propertyClass = Class.forName(imageType, true, classLoader);
        } catch (ClassNotFoundException ex) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType + "\" not found.", ex);
        }
       
        Object imagePropertyValue = propertyLoader.getPropertyValue(FillImage.class, propertyClass, imageElement);
        if (!(imagePropertyValue instanceof ImageReference)) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType
                    + "\" is not an ImageReference.", null);
        }

        ImageReference imageReference = (ImageReference) imagePropertyValue;
        FillImage fillImage = new FillImage(imageReference, offsetX, offsetY, repeat);
View Full Code Here

Examples of org.apache.camel.InvalidPropertyException

        } catch (Exception e) {
            throw new RuntimeCamelException(
                    "Failed to set property " + name + " with value " + value + " on endpoint " + endpoint + " due to " + e.getMessage(), e);
        }
        if (!answer) {
            throw new InvalidPropertyException(endpoint, name);
        }
    }
View Full Code Here

Examples of org.grails.core.exceptions.InvalidPropertyException

     * @see org.codehaus.groovy.grails.domain.GrailsDomainClass#getPropertyByName(java.lang.String)
     */
    public GrailsDomainClassProperty getPropertyByName(String name) {
        GrailsDomainClassProperty persistentProperty = getPersistentProperty(name);
        if (persistentProperty == null) {
            throw new InvalidPropertyException("No property found for name ["+name+"] for class ["+getClazz()+"]");
        }

        return persistentProperty;
    }
View Full Code Here

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

Examples of org.springframework.beans.InvalidPropertyException

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

Examples of org.springframework.beans.InvalidPropertyException

  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

Examples of org.springframework.beans.InvalidPropertyException

  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
TOP
Copyright © 2018 www.massapi.com. 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.