热门标签 | 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()
)
);
}
}

推荐阅读
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社区 版权所有