當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyDescriptor.getPropertyEditorClass方法代碼示例

本文整理匯總了Java中java.beans.PropertyDescriptor.getPropertyEditorClass方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyDescriptor.getPropertyEditorClass方法的具體用法?Java PropertyDescriptor.getPropertyEditorClass怎麽用?Java PropertyDescriptor.getPropertyEditorClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.beans.PropertyDescriptor的用法示例。


在下文中一共展示了PropertyDescriptor.getPropertyEditorClass方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: equals

import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
/**
 * Compare the given {@link PropertyDescriptor} against the given {@link Object} and
 * return {@code true} if they are objects are equivalent, i.e. both are {@code
 * PropertyDescriptor}s whose read method, write method, property types, property
 * editor and flags are equivalent.
 * @see PropertyDescriptor#equals(Object)
 */
public static boolean equals(PropertyDescriptor pd1, Object obj) {
	if (pd1 == obj) {
		return true;
	}
	if (obj != null && obj instanceof PropertyDescriptor) {
		PropertyDescriptor pd2 = (PropertyDescriptor) obj;
		if (!compareMethods(pd1.getReadMethod(), pd2.getReadMethod())) {
			return false;
		}
		if (!compareMethods(pd1.getWriteMethod(), pd2.getWriteMethod())) {
			return false;
		}
		if (pd1.getPropertyType() == pd2.getPropertyType() &&
				pd1.getPropertyEditorClass() == pd2.getPropertyEditorClass() &&
				pd1.isBound() == pd2.isBound() && pd1.isConstrained() == pd2.isConstrained()) {
			return true;
		}
	}
	return false;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:28,代碼來源:ExtendedBeanInfo.java

示例2: _mergePropertyDescriptors

import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
/**
 * Merge information from two PropertyDescriptors into a third
 * PropertyDescriptor.
 * In the event of other conflicts, the second argument
 * <code>primaryDescriptor</code> is given priority over the first argument
 * <code>secondaryDescriptor</code>.
 * <p>
 * @param secondaryDescriptor  The lower priority PropertyDescriptor
 * @param primaryDescriptor  The higher priority PropertyDescriptor
 * @param mergedDescriptor The PropertyDescriptor to merge the information
 *                         into.
 */
private static void _mergePropertyDescriptors(
  PropertyDescriptor secondaryDescriptor,
  PropertyDescriptor primaryDescriptor,
  PropertyDescriptor mergedDescriptor
  )
{
  // merge the superclasses
  _mergeFeatureDescriptors(secondaryDescriptor,
                           primaryDescriptor,
                           mergedDescriptor);

  //
  // merge the property editor class
  //
  Class<?> editorClass = primaryDescriptor.getPropertyEditorClass();

  // Give priority to the primary propertyEditor.
  if (editorClass == null)
  {
    editorClass = secondaryDescriptor.getPropertyEditorClass();
  }

  mergedDescriptor.setPropertyEditorClass(editorClass);

  // merge the bound property
  mergedDescriptor.setBound(secondaryDescriptor.isBound() |
                            primaryDescriptor.isBound());

  // merge the constrained property
  mergedDescriptor.setConstrained(secondaryDescriptor.isConstrained() |
                                  primaryDescriptor.isConstrained());
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:45,代碼來源:JavaIntrospector.java

示例3: buildGenericTypeAwarePropertyDescriptor

import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
private PropertyDescriptor buildGenericTypeAwarePropertyDescriptor(Class<?> beanClass, PropertyDescriptor pd) {
	try {
		return new GenericTypeAwarePropertyDescriptor(beanClass, pd.getName(), pd.getReadMethod(),
				pd.getWriteMethod(), pd.getPropertyEditorClass());
	}
	catch (IntrospectionException ex) {
		throw new FatalBeanException("Failed to re-introspect class [" + beanClass.getName() + "]", ex);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:CachedIntrospectionResults.java

示例4: compare

import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
private static boolean compare(PropertyDescriptor pd1, PropertyDescriptor pd2) {
    if (!compare(pd1.getReadMethod(), pd2.getReadMethod())) {
        System.out.println("read methods not equal");
        return false;
    }
    if (!compare(pd1.getWriteMethod(), pd2.getWriteMethod())) {
        System.out.println("write methods not equal");
        return false;
    }
    if (pd1.getPropertyType() != pd2.getPropertyType()) {
        System.out.println("property type not equal");
        return false;
    }
    if (pd1.getPropertyEditorClass() != pd2.getPropertyEditorClass()) {
        System.out.println("property editor class not equal");
        return false;
    }
    if (pd1.isBound() != pd2.isBound()) {
        System.out.println("bound value not equal");
        return false;
    }
    if (pd1.isConstrained() != pd2.isConstrained()) {
        System.out.println("constrained value not equal");
        return false;
    }
    return true;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:28,代碼來源:Test4634390.java


注:本文中的java.beans.PropertyDescriptor.getPropertyEditorClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。