本文整理汇总了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);
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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[] {};
}
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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());
}
示例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;
}
示例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);
}
示例13: actualClass
import net.sf.cglib.proxy.Enhancer; //导入方法依赖的package包/类
public static Class actualClass(Class clazz) {
return Enhancer.isEnhanced(clazz) ? clazz.getSuperclass() : clazz;
}