Package java.beans

Examples of java.beans.IntrospectionException


        }
        if (m == null) {
            String msg = String.format("Accessor '%s' not found, "
                                       + "known setters are: %s, known getters are: %s", getterOrSetterName,
                                       setters.keySet(), getters.keySet());
            throw new IntrospectionException(msg);
        }
        return new TypeInfo(m.getReturnType(), m.getGenericReturnType(),
            primitiveToWrapper(m.getReturnType()));
    }
View Full Code Here


    public Beanspector<T> setValue(String setterName, Object value) throws Throwable {
        Method m = setters.get(setterName.toLowerCase());
        if (m == null) {
            String msg = String.format("Setter '%s' not found, " + "known setters are: %s", setterName,
                                       setters.keySet());
            throw new IntrospectionException(msg);
        }
        setValue(m, value);
        return this;
    }
View Full Code Here

                addArgument(new Argument(String.class, data), 0);
                methodValue = "forName"; //$NON-NLS-1$
            } else if (isPrimitive()) {
                if (isTag("char")) { //$NON-NLS-1$
                    if (data.length() != 1) {
                        throw new IntrospectionException(Messages.getString(
                                "beans.43", //$NON-NLS-1$
                                data));
                    }
                    addArgument(new Argument(char.class, new Character(data
                            .charAt(0))), 0);
View Full Code Here

    {
        Map settersForClassName = (Map) setterMap.get(className);

        if (settersForClassName == null)
        {
            throw new IntrospectionException("No setter Map for " + className
                    + " available!");
        }

        Method setter = (Method) settersForClassName.get(propName);
View Full Code Here

    {
        Map gettersForClassName = (Map) getterMap.get(className);

        if (gettersForClassName == null)
        {
            throw new IntrospectionException("No getter Map for " + className
                    + " available!");
        }

        Method getter = (Method) gettersForClassName.get(propName);
View Full Code Here

        if (fromStringMethod == null) {
            try {
                fromStringMethod = javaType.getMethod("fromString",
                                                 new Class[] {java.lang.String.class});
            } catch (Exception e) {
                throw new IntrospectionException(e.toString());
            }
        }
        return fromStringMethod.invoke(null,new Object [] { source });
    }
View Full Code Here

    {
        Map settersForClassName = (Map) setterMap.get(className);

        if (settersForClassName == null)
        {
            throw new IntrospectionException("No setter Map for " + className + " available!");
        }

        Method setter = (Method) settersForClassName.get(propName);

        if (setter == null)
View Full Code Here

    {
        Map gettersForClassName = (Map) getterMap.get(className);

        if (gettersForClassName == null)
        {
            throw new IntrospectionException("No getter Map for " + className + " available!");
        }

        Method getter = (Method) gettersForClassName.get(propName);

        if (getter == null)
View Full Code Here

                addArgument(new Argument(String.class, data), 0);
                methodValue = "forName"; //$NON-NLS-1$
            } else if (isPrimitive()) {
                if (isTag("char")) { //$NON-NLS-1$
                    if (data.length() != 1) {
                        throw new IntrospectionException(Messages.getString(
                                "beans.43", //$NON-NLS-1$
                                data));
                    }
                    addArgument(new Argument(char.class, Character.valueOf(data
                            .charAt(0))), 0);
View Full Code Here

            throws IntrospectionException {

        super(propertyName, null, null);
       
        if (propertyName == null || propertyName.length() == 0) {
            throw new IntrospectionException("bad property name: " +
                    propertyName + " on class: " + beanClass.getClass().getName());
        }

        setName(propertyName);
        String base = capitalize(propertyName);

        // Look for mapped get and set methods
        try {
            mappedReadMethod = findMethod(beanClass, "get" + base, 1,
                    stringClassArray);
            Class params[] = { String.class, mappedReadMethod.getReturnType() };
            mappedWriteMethod = findMethod(beanClass, "set" + base, 2,  params);
        } catch (IntrospectionException e) {
            ;
        }

        if ((mappedReadMethod == null) && (mappedWriteMethod == null)) {
            throw new IntrospectionException("Property '" + propertyName +
                    "' not found on " +
                    beanClass.getName());
        }
       
        findMappedPropertyType();
View Full Code Here

TOP

Related Classes of java.beans.IntrospectionException

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.