本文整理匯總了Java中java.beans.IndexedPropertyDescriptor.getIndexedReadMethod方法的典型用法代碼示例。如果您正苦於以下問題:Java IndexedPropertyDescriptor.getIndexedReadMethod方法的具體用法?Java IndexedPropertyDescriptor.getIndexedReadMethod怎麽用?Java IndexedPropertyDescriptor.getIndexedReadMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.IndexedPropertyDescriptor
的用法示例。
在下文中一共展示了IndexedPropertyDescriptor.getIndexedReadMethod方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _cloneIndexedPropertyDescriptor
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
private static IndexedPropertyDescriptor _cloneIndexedPropertyDescriptor(
IndexedPropertyDescriptor oldDescriptor
)
{
try
{
IndexedPropertyDescriptor newDescriptor = new IndexedPropertyDescriptor(
oldDescriptor.getName(),
oldDescriptor.getReadMethod(),
oldDescriptor.getWriteMethod(),
oldDescriptor.getIndexedReadMethod(),
oldDescriptor.getIndexedWriteMethod());
// copy the rest of the attributes
_copyPropertyDescriptor(oldDescriptor, newDescriptor);
return newDescriptor;
}
catch (Exception e)
{
_LOG.severe(e);
return null;
}
}
示例2: create
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
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: testIndexedPropertyDescriptor
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
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());
}
}
示例4: hasIPD
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
public static boolean hasIPD(IndexedPropertyDescriptor ipd) {
if (null == ipd.getIndexedPropertyType()) {
return false;
}
return (null != ipd.getIndexedReadMethod())
|| (null != ipd.getIndexedWriteMethod());
}
示例5: assertArrayPropertyValuesAreEqual
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
private void assertArrayPropertyValuesAreEqual(final Object o1, final Object o2, final IndexedPropertyDescriptor propertyDescriptor,
final BeanInfo beanInfo, final List<Difference> differences) throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException {
final Method getter = propertyDescriptor.getIndexedReadMethod();
Method lengthGetter = null;
for (final PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
if (pd.getName().equals(propertyDescriptor.getName() + "Length")) {
lengthGetter = pd.getReadMethod();
}
}
if (lengthGetter != null) {
final int length = ((Integer) lengthGetter.invoke(o1)).intValue();
final int length2 = ((Integer) lengthGetter.invoke(o1)).intValue();
this.propertyStack.push("length");
BeanDiff.addDiff(differences, createDiff(o1.getClass(), propertyDescriptor.getName(), length, length2));
this.propertyStack.pop();
for (int i = 0; i < length; i++) {
this.propertyStack.push("[" + i + "]");
final Object val1 = getter.invoke(o1, i);
final Object val2 = getter.invoke(o2, i);
if (val1 != null && val2 != null && val1.getClass().getPackage().getName().startsWith(this.packagePrefix)) {
findDifferences(val1, val2, differences);
} else {
BeanDiff.addDiff(differences, createDiff(o1.getClass(), propertyDescriptor.getName(), val1, val2));
}
this.propertyStack.pop();
}
} else {
createArrayDiff(o1, o2, differences);
}
}
示例6: SimpleIndexedPropertyDescriptor
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original) throws IntrospectionException {
this(original.getName(), original.getReadMethod(), original.getWriteMethod(),
original.getIndexedReadMethod(), original.getIndexedWriteMethod());
copyNonMethodProperties(original, this);
}
示例7: SimpleIndexedPropertyDescriptor
import java.beans.IndexedPropertyDescriptor; //導入方法依賴的package包/類
public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original) throws IntrospectionException {
this(original.getName(), original.getReadMethod(), original.getWriteMethod(),
original.getIndexedReadMethod(), original.getIndexedWriteMethod());
PropertyDescriptorUtils.copyNonMethodProperties(original, this);
}