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


Java Enhancer.isEnhanced方法代碼示例

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


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

示例1: rootElement

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
/**
 * Injects the root webelement into an element.
 * @param root The root webelement.
 * @param element The element.
 * @since 0.3.0
 */
public static <E> void rootElement(WebElement root, E element) {
	if (element == null || root == null) return;
	if (element instanceof WebElement) return;
	
	for (Class<?> clazz = element.getClass(); !clazz.equals(Object.class);
			clazz = clazz.getSuperclass()) {
		
		if (Enhancer.isEnhanced(clazz)) continue;
		
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			setRootElementField(root, element, field);
		}
	}
}
 
開發者ID:wiselenium,項目名稱:wiselenium,代碼行數:22,代碼來源:RootInjector.java

示例2: serializedClass

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
@Override
public String serializedClass(final Class<?> type) {
    final String serializedName = super.serializedClass(type);
    if (type == null) {
        return serializedName;
    }
    final String typeName = type.getName();
    return typeName.equals(serializedName)
        && typeName.indexOf(DEFAULT_NAMING_MARKER) > 0
        && Enhancer.isEnhanced(type) ? alias : serializedName;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:12,代碼來源:CGLIBMapper.java

示例3: isProxy

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public boolean isProxy(Class<?> type) {
    if (type == null) {
        return false;
    }
    return type.getName().contains("$$EnhancerByCGLIB$$") || Enhancer.isEnhanced(type);
}
 
開發者ID:awenblue,項目名稱:powermock,代碼行數:10,代碼來源:ProxyFrameworkImpl.java

示例4: serializedClass

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
public String serializedClass(Class paramClass)
{
  String str1 = super.serializedClass(paramClass);
  if (paramClass == null)
    return str1;
  String str2 = paramClass.getName();
  if ((str2.equals(str1)) && (str2.indexOf(DEFAULT_NAMING_MARKER) > 0) && (Enhancer.isEnhanced(paramClass)))
    return this.alias;
  return str1;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:11,代碼來源:CGLIBMapper.java

示例5: getProxy

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public <T> T getProxy(TypeToken<T> type) {
    Class<? super T> cls = type.getRawType();

    if (isTerminal(type)) {
        return (T) Defaults.defaultValue(cls);
    }

    Enhancer e = new Enhancer();
    if (Enhancer.isEnhanced(cls)) {
        e.setSuperclass(cls.getSuperclass());
        e.setInterfaces(cls.getInterfaces());
    } else {
        e.setSuperclass(cls);
    }
    e.setCallbackFilter(FINALIZE_FILTER);
    e.setCallbacks(new Callback[] { NoOp.INSTANCE, new MethodInterceptor() {

        @Override
        public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
            invocations.add(new MethodInvocation<Object>(type, method, Arrays.asList(args)));

            return getProxy(type.resolveType(method.getGenericReturnType()));
        }

    } });

    try {
        return (T) e.create();
    } catch (Exception ex) {
        throw new RuntimeException("Error while creating proxy of " + type, ex);
    }
}
 
開發者ID:ruediste,項目名稱:c3java,代碼行數:34,代碼來源:MethodInvocationRecorder.java

示例6: getMockedClasses

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
private static Class[] getMockedClasses(final Object object) {
    if (Enhancer.isEnhanced(object.getClass())) {
        return new Class[] {object.getClass().getSuperclass()};
    } else if (Proxy.isProxyClass(object.getClass())) {
        return object.getClass().getInterfaces();
    } else {
        return new Class[] {};
    }
}
 
開發者ID:mattprovis,項目名稱:uitest,代碼行數:10,代碼來源:MocksRegistry.java

示例7: registerDependent

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
/**
 * Register dao to be called after updating an object of type clazz for updating search index of dependent objects managed by the given
 * dao.
 * @param clazz Type of modified object
 * @param dao Dao to notify.
 */
public void registerDependent(Class< ? extends BaseDO< ? >> clazz, BaseDao< ? > dao)
{
  if (Enhancer.isEnhanced(dao.getClass()) == true) {
    return;
  }
  Set<BaseDao< ? >> set = this.registeredDependents.get(clazz);
  if (set == null) {
    set = new HashSet<BaseDao< ? >>();
    this.registeredDependents.put(clazz, set);
  }
  set.add(dao);
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:19,代碼來源:BaseDaoReindexRegistry.java

示例8: rootDriver

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
/**
 * Injects the webdriver into a page.
 * @param root The webdriver.
 * @param element The element.
 * @since 0.3.0
 */
public static <E> void rootDriver(WebDriver root, E page) {
	if (page == null || root == null) return;
	
	for (Class<?> clazz = page.getClass(); !clazz.equals(Object.class);
			clazz = clazz.getSuperclass()) {
		
		if (Enhancer.isEnhanced(clazz)) continue;
		
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			setRootDriverField(root, page, field);
		}
	}
}
 
開發者ID:wiselenium,項目名稱:wiselenium,代碼行數:21,代碼來源:RootInjector.java

示例9: canConvert

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
@Override
public boolean canConvert(final Class<?> type) {
    return Enhancer.isEnhanced(type)
        && type.getName().indexOf(DEFAULT_NAMING_MARKER) > 0
        || type == CGLIBMapper.Marker.class;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:CGLIBEnhancedConverter.java

示例10: isEasyMocked

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
/**
 * Test if a object is a mock created by EasyMock or not.
 */
private static boolean isEasyMocked(Object mock) {
    return Enhancer.isEnhanced(mock.getClass()) || Proxy.isProxyClass(mock.getClass());
}
 
開發者ID:awenblue,項目名稱:powermock,代碼行數:7,代碼來源:PowerMock.java

示例11: canConvert

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
@Override
public boolean canConvert(final Class<?> type) {
    return Enhancer.isEnhanced(type) && type.getName().indexOf(DEFAULT_NAMING_MARKER) > 0
        || type == CGLIBMapper.Marker.class;
}
 
開發者ID:x-stream,項目名稱:xstream,代碼行數:6,代碼來源:CGLIBEnhancedConverter.java

示例12: canConvert

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
public boolean canConvert(Class paramClass)
{
  return ((Enhancer.isEnhanced(paramClass)) && (paramClass.getName().indexOf(DEFAULT_NAMING_MARKER) > 0)) || (paramClass == CGLIBMapper.Marker.class);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:5,代碼來源:CGLIBEnhancedConverter.java

示例13: actualClass

import net.sf.cglib.proxy.Enhancer; //導入方法依賴的package包/類
public static Class actualClass(Class clazz) {
    return Enhancer.isEnhanced(clazz) ? clazz.getSuperclass() : clazz;
}
 
開發者ID:xingyuli,項目名稱:some-ldap,代碼行數:4,代碼來源:ClassHelper.java


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