热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

net.bytebuddy.matcher.ElementMatchers.isSynthetic()方法的使用及代码示例

本文整理了Java中net.bytebuddy.matcher.ElementMatchers.isSynthetic()方法的一些代码示例,展示了Elem

本文整理了Java中net.bytebuddy.matcher.ElementMatchers.isSynthetic()方法的一些代码示例,展示了ElementMatchers.isSynthetic()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ElementMatchers.isSynthetic()方法的具体详情如下:
包路径:net.bytebuddy.matcher.ElementMatchers
类名称:ElementMatchers
方法名:isSynthetic

ElementMatchers.isSynthetic介绍

[英]Matches a ModifierReviewable that is synthetic.
[中]匹配合成的ModifierViewable。

代码示例

代码示例来源:origin: redisson/redisson

/**
* {@inheritDoc}
*/
public Builder withHashCodeEquals() {
return method(isHashCode())
.intercept(HashCodeMethod.usingDefaultOffset().withIgnoredFields(isSynthetic()))
.method(isEquals())
.intercept(EqualsMethod.isolated().withIgnoredFields(isSynthetic()));
}

代码示例来源:origin: redisson/redisson

/**
* Creates a new Byte Buddy instance with a default configuration that is suitable for most use cases.
*
* @param classFileVersion The class file version to use for types that are not based on an existing class file.
*/
public ByteBuddy(ClassFileVersion classFileVersion) {
this(classFileVersion,
new NamingStrategy.SuffixingRandom(BYTE_BUDDY_DEFAULT_PREFIX),
new AuxiliaryType.NamingStrategy.SuffixingRandom(BYTE_BUDDY_DEFAULT_SUFFIX),
AnnotationValueFilter.Default.APPEND_DEFAULTS,
AnnotationRetention.ENABLED,
Implementation.Context.Default.Factory.INSTANCE,
MethodGraph.Compiler.DEFAULT,
InstrumentedType.Factory.Default.MODIFIABLE,
TypeValidation.ENABLED,
ClassWriterStrategy.Default.CONSTANT_POOL_RETAINING,
new LatentMatcher.Resolved(isSynthetic().or(isDefaultFinalizer())));
}

代码示例来源:origin: hibernate/hibernate-orm

private ProxyDefinitionHelpers() {
this.groovyGetMetaClassFilter = isSynthetic().and( named( "getMetaClass" )
.and( returns( td -> "groovy.lang.MetaClass".equals( td.getName() ) ) ) );
this.virtualNotFinalizerFilter = isVirtual().and( not( isFinalizer() ) );
this.hibernateGeneratedMethodFilter = nameStartsWith( "$$_hibernate_" ).and( isVirtual() );
PrivilegedAction delegateToInterceptorDispatcherMethodDelegatiOnPrivilegedAction=
new PrivilegedAction() {
@Override
public MethodDelegation run() {
return MethodDelegation.to( ProxyConfiguration.InterceptorDispatcher.class );
}
};
this.delegateToInterceptorDispatcherMethodDelegation = System.getSecurityManager() != null
? AccessController.doPrivileged( delegateToInterceptorDispatcherMethodDelegationPrivilegedAction )
: delegateToInterceptorDispatcherMethodDelegationPrivilegedAction.run();
PrivilegedAction interceptorFieldAccessorPrivilegedAction =
new PrivilegedAction() {
@Override
public FieldAccessor.PropertyConfigurable run() {
return FieldAccessor.ofField( ProxyConfiguration.INTERCEPTOR_FIELD_NAME )
.withAssigner( Assigner.DEFAULT, Assigner.Typing.DYNAMIC );
}
};
this.interceptorFieldAccessor = System.getSecurityManager() != null
? AccessController.doPrivileged( interceptorFieldAccessorPrivilegedAction )
: interceptorFieldAccessorPrivilegedAction.run();
}

代码示例来源:origin: stagemonitor/stagemonitor

protected ElementMatcher.Junction getTypeMatcher() {
return getIncludeTypeMatcher()
.and(not(isInterface()))
.and(not(isSynthetic()))
.and(not(getExtraExcludeTypeMatcher()));
}

代码示例来源:origin: redisson/redisson

/**
* {@inheritDoc}
*/
public DynamicType.Builder apply(DynamicType.Builder builder, TypeDescription typeDescription, ClassFileLocator classFileLocator) {
Enhance enhance = typeDescription.getDeclaredAnnotations().ofType(Enhance.class).loadSilent();
if (typeDescription.getDeclaredMethods().filter(isToString()).isEmpty()) {
builder = builder.method(isToString()).intercept(ToStringMethod.prefixedBy(enhance.prefix().getPrefixResolver())
.withIgnoredFields(enhance.includeSyntheticFields()
? ElementMatchers.none()
: ElementMatchers.isSynthetic())
.withIgnoredFields(isAnnotatedWith(Exclude.class)));
}
return builder;
}

代码示例来源:origin: redisson/redisson

new RawMatcher.Disjunction(
new RawMatcher.ForElementMatchers(any(), isBootstrapClassLoader().or(isExtensionClassLoader())),
new RawMatcher.ForElementMatchers(nameStartsWith("net.bytebuddy.").or(nameStartsWith("sun.reflect.")).or(isSynthetic()))),
Transformation.Ignored.INSTANCE);

代码示例来源:origin: stagemonitor/stagemonitor

protected ElementMatcher.Junction getMethodElementMatcher() {
return not(isConstructor())
.and(not(isAbstract()))
.and(not(isNative()))
.and(not(isFinal()))
.and(not(isSynthetic()))
.and(not(isTypeInitializer()))
.and(getExtraMethodElementMatcher());
}

代码示例来源:origin: redisson/redisson

.withIgnoredFields(enhance.includeSyntheticFields()
? ElementMatchers.none()
: ElementMatchers.isSynthetic())
.withIgnoredFields(new ValueMatcher(ValueHandling.Sort.IGNORE))
.withNonNullableFields(nonNullable(new ValueMatcher(ValueHandling.Sort.REVERSE_NULLABILITY))));
.withIgnoredFields(enhance.includeSyntheticFields()
? ElementMatchers.none()
: ElementMatchers.isSynthetic())
.withIgnoredFields(new ValueMatcher(ValueHandling.Sort.IGNORE))
.withNonNullableFields(nonNullable(new ValueMatcher(ValueHandling.Sort.REVERSE_NULLABILITY)))

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

/**
* Ctor.
* @param type Type to call method on.
*/
public SmtInvokeAtomEqual(final TypeDescription type) {
super(
type,
new ConjunctionMatcher<>(
isSynthetic(),
named("atom$equal")
)
);
}
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

/**
* Ctor.
*
* @param type Type to call method on.
*/
public SmtInvokeAtomHashCode(final TypeDescription type) {
super(
type,
new ConjunctionMatcher<>(
isSynthetic(),
named("atom$hashCode")
)
);
}
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

/**
* Ctor.
*
* @param type Type to call method on.
*/
public SmtInvokeAtomToStringNatural(final TypeDescription type) {
super(
type,
new ConjunctionMatcher<>(
isSynthetic(),
named("atom$toString$natural")
)
);
}
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

/**
* Ctor.
*
* @param type Type to call method on.
*/
public SmtInvokeAtomToString(final TypeDescription type) {
super(
type,
new ConjunctionMatcher<>(
isSynthetic(),
named("atom$toString")
)
);
}
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

@Override
public final boolean matches(final TypeDescription target) {
return target.getDeclaredFields()
.filter(not(isSynthetic()))
.filter(f -> f.getType().isArray())
.isEmpty();
}
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

private ProxyDefinitionHelpers() {
this.groovyGetMetaClassFilter = isSynthetic().and( named( "getMetaClass" )
.and( returns( td -> "groovy.lang.MetaClass".equals( td.getName() ) ) ) );
this.virtualNotFinalizerFilter = isVirtual().and( not( isFinalizer() ) );
this.hibernateGeneratedMethodFilter = nameStartsWith( "$$_hibernate_" ).and( isVirtual() );
PrivilegedAction delegateToInterceptorDispatcherMethodDelegatiOnPrivilegedAction=
new PrivilegedAction() {
@Override
public MethodDelegation run() {
return MethodDelegation.to( ProxyConfiguration.InterceptorDispatcher.class );
}
};
this.delegateToInterceptorDispatcherMethodDelegation = System.getSecurityManager() != null
? AccessController.doPrivileged( delegateToInterceptorDispatcherMethodDelegationPrivilegedAction )
: delegateToInterceptorDispatcherMethodDelegationPrivilegedAction.run();
PrivilegedAction interceptorFieldAccessorPrivilegedAction =
new PrivilegedAction() {
@Override
public FieldAccessor.PropertyConfigurable run() {
return FieldAccessor.ofField( ProxyConfiguration.INTERCEPTOR_FIELD_NAME )
.withAssigner( Assigner.DEFAULT, Assigner.Typing.DYNAMIC );
}
};
this.interceptorFieldAccessor = System.getSecurityManager() != null
? AccessController.doPrivileged( interceptorFieldAccessorPrivilegedAction )
: interceptorFieldAccessorPrivilegedAction.run();
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

@Override
public final boolean matches(TypeDescription target) {
return target.getDeclaredMethods()
.filter(not(isConstructor()))
.filter(not(isSynthetic()))
.isEmpty();
}
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

@Override
public final boolean matches(TypeDescription target) {
MethodList declaredMethods = target.getDeclaredMethods()
.filter(isStatic())
.filter(not(isSynthetic()));
if(target.isEnum()) {
declaredMethods = declaredMethods
.filter(not(ENUM_METHODS_MATCHER));
}
return declaredMethods.isEmpty();
}
}

代码示例来源:origin: elastic/apm-agent-java

.and(not(isAbstract()))
.and(not(isNative()))
.and(not(isSynthetic()))
.and(not(isTypeInitializer()));

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

/**
* Ctor
*/
public GenerateObjectMethodsPlugin() {
super(
new BtApplyIfMatches(
new ConjunctionMatcher<>(
not(isInterface()),
not(isAnnotation()),
not(isSynthetic()),
new AnnotatedAtom(),
not(new ExplicitlyExtendingAnything())
),
new BtValidated(
new ValAtom(),
new BtSequence(
new BtGenerateEquals(),
new BtGenerateHashCode(),
new BtGenerateToString()
)
)
)
);
}
}

代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis

/**
* Ctor.
*/
public AnnotateClassesPlugin() {
super(
new BtApplyIfMatches(
new ConjunctionMatcher<>(
not(isInterface()),
not(isAnnotation()),
not(isSynthetic()),
not(new AnnotatedAtom()),
not(new AnnotatedNonAtom()),
new ThisOrSuperClassMatcher(
new DisjunctionMatcher<>(
new AnnotatedAtom(),
new ImplementsNoInterfaces(),
new ImplementsInterfaceWhichMatches(
new AnnotatedAtom()
)
)
)
),
new BtAnnotateAtom()
)
);
}
}

推荐阅读
  • Ihaveaworkfolderdirectory.我有一个工作文件夹目录。holderDir.glob(*)>holder[ProjectOne, ... [详细]
  • 使用圣杯布局模式实现网站首页的内容布局
    本文介绍了使用圣杯布局模式实现网站首页的内容布局的方法,包括HTML部分代码和实例。同时还提供了公司新闻、最新产品、关于我们、联系我们等页面的布局示例。商品展示区包括了车里子和农家生态土鸡蛋等产品的价格信息。 ... [详细]
  • 本文整理了Java中java.lang.NoSuchMethodError.getMessage()方法的一些代码示例,展示了NoSuchMethodErr ... [详细]
  • Commit1ced2a7433ea8937a1b260ea65d708f32ca7c95eintroduceda+Clonetraitboundtom ... [详细]
  • baresip android编译、运行教程1语音通话
    本文介绍了如何在安卓平台上编译和运行baresip android,包括下载相关的sdk和ndk,修改ndk路径和输出目录,以及创建一个c++的安卓工程并将目录考到cpp下。详细步骤可参考给出的链接和文档。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • FeatureRequestIsyourfeaturerequestrelatedtoaproblem?Please ... [详细]
  • Go Cobra命令行工具入门教程
    本文介绍了Go语言实现的命令行工具Cobra的基本概念、安装方法和入门实践。Cobra被广泛应用于各种项目中,如Kubernetes、Hugo和Github CLI等。通过使用Cobra,我们可以快速创建命令行工具,适用于写测试脚本和各种服务的Admin CLI。文章还通过一个简单的demo演示了Cobra的使用方法。 ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • Postgresql备份和恢复的方法及命令行操作步骤
    本文介绍了使用Postgresql进行备份和恢复的方法及命令行操作步骤。通过使用pg_dump命令进行备份,pg_restore命令进行恢复,并设置-h localhost选项,可以完成数据的备份和恢复操作。此外,本文还提供了参考链接以获取更多详细信息。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • 本文介绍了关系型数据库和NoSQL数据库的概念和特点,列举了主流的关系型数据库和NoSQL数据库,同时描述了它们在新闻、电商抢购信息和微博热点信息等场景中的应用。此外,还提供了MySQL配置文件的相关内容。 ... [详细]
  • 目前Miniconda3的主要版本已经不支持python3.6,以Windows为例,在官网Miniconda—Condadocumentation中只有python3.7 ... [详细]
author-avatar
桥之西海_744
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有