java.beans.IndexedPropertyDescriptor#getIndexedWriteMethod ( )源码实例Demo

下面列出了java.beans.IndexedPropertyDescriptor#getIndexedWriteMethod ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: Test4634390.java
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
源代码2 项目: hottub   文件: Test4634390.java
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
源代码3 项目: TencentKona-8   文件: Test4634390.java
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
源代码4 项目: jdk8u-dev-jdk   文件: Test4634390.java
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
源代码5 项目: openjdk-jdk8u   文件: Test4634390.java
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
源代码6 项目: openjdk-8   文件: Test4634390.java
private static PropertyDescriptor create(PropertyDescriptor pd) {
    try {
        if (pd instanceof IndexedPropertyDescriptor) {
            IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
            return new IndexedPropertyDescriptor(
                    ipd.getName(),
                    ipd.getReadMethod(),
                    ipd.getWriteMethod(),
                    ipd.getIndexedReadMethod(),
                    ipd.getIndexedWriteMethod());
        } else {
            return new PropertyDescriptor(
                    pd.getName(),
                    pd.getReadMethod(),
                    pd.getWriteMethod());
        }
    }
    catch (IntrospectionException exception) {
        exception.printStackTrace();
        return null;
    }
}
 
源代码7 项目: openjdk-8   文件: Test4619536.java
public static boolean hasIPD(IndexedPropertyDescriptor ipd) {
    if (null == ipd.getIndexedPropertyType()) {
        return false;
    }
    return (null != ipd.getIndexedReadMethod())
        || (null != ipd.getIndexedWriteMethod());
}
 
源代码8 项目: commons-jxpath   文件: ValueUtils.java
/**
 * Modifies the index'th element of the bean's property represented by
 * the supplied property descriptor. Converts the value to the required
 * type if necessary.
 * @param bean to edit
 * @param propertyDescriptor indicating what to set
 * @param index int
 * @param value to set
 */
public static void setValue(Object bean,
        PropertyDescriptor propertyDescriptor, int index, Object value) {
    if (propertyDescriptor instanceof IndexedPropertyDescriptor) {
        try {
            IndexedPropertyDescriptor ipd =
                (IndexedPropertyDescriptor) propertyDescriptor;
            Method method = ipd.getIndexedWriteMethod();
            if (method != null) {
                method.invoke(
                    bean,
                        new Integer(index),
                        convert(value, ipd.getIndexedPropertyType()));
                return;
            }
        }
        catch (Exception ex) {
            throw new RuntimeException(
                "Cannot access property: "
                    + propertyDescriptor.getName()
                    + ", "
                    + ex.getMessage());
        }
    }
    // We will fall through if there is no indexed read
    Object collection = getValue(bean, propertyDescriptor);
    if (isCollection(collection)) {
        setValue(collection, index, value);
    }
    else if (index == 0) {
        setValue(bean, propertyDescriptor, value);
    }
    else {
        throw new RuntimeException(
            "Not a collection: " + propertyDescriptor.getName());
    }
}
 
源代码9 项目: TencentKona-8   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码10 项目: jdk8u_jdk   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码11 项目: jdk8u60   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码12 项目: hottub   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码13 项目: openjdk-8-source   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码14 项目: openjdk-8-source   文件: Test4619536.java
public static boolean hasIPD(IndexedPropertyDescriptor ipd) {
    if (null == ipd.getIndexedPropertyType()) {
        return false;
    }
    return (null != ipd.getIndexedReadMethod())
        || (null != ipd.getIndexedWriteMethod());
}
 
源代码15 项目: openjdk-jdk8u-backup   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码16 项目: openjdk-8   文件: Test4918902.java
private static void testIndexedPropertyDescriptor(Class type, Class read, Class write) {
    IndexedPropertyDescriptor ipd = BeanUtils.getIndexedPropertyDescriptor(type, "foo");
    if (!read.equals(ipd.getIndexedReadMethod().getDeclaringClass())) {
        throw new Error("unexpected read method: " + ipd.getIndexedReadMethod());
    }
    if (!write.equals(ipd.getIndexedWriteMethod().getDeclaringClass())) {
        throw new Error("unexpected write method: " + ipd.getIndexedWriteMethod());
    }
}
 
源代码17 项目: jdk8u-dev-jdk   文件: Test4619536.java
public static boolean hasIPD(IndexedPropertyDescriptor ipd) {
    if (null == ipd.getIndexedPropertyType()) {
        return false;
    }
    return (null != ipd.getIndexedReadMethod())
        || (null != ipd.getIndexedWriteMethod());
}
 
源代码18 项目: java-technology-stack   文件: ExtendedBeanInfo.java
public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original) throws IntrospectionException {
	this(original.getName(), original.getReadMethod(), original.getWriteMethod(),
			original.getIndexedReadMethod(), original.getIndexedWriteMethod());
	PropertyDescriptorUtils.copyNonMethodProperties(original, this);
}
 
源代码19 项目: lams   文件: ExtendedBeanInfo.java
public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original) throws IntrospectionException {
	this(original.getName(), original.getReadMethod(), original.getWriteMethod(),
			original.getIndexedReadMethod(), original.getIndexedWriteMethod());
	PropertyDescriptorUtils.copyNonMethodProperties(original, this);
}
 
源代码20 项目: blog_demos   文件: ExtendedBeanInfo.java
public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original) throws IntrospectionException {
	this(original.getName(), original.getReadMethod(), original.getWriteMethod(),
			original.getIndexedReadMethod(), original.getIndexedWriteMethod());
	copyNonMethodProperties(original, this);
}