当前位置: 首页>>代码示例>>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;未经允许,请勿转载。