本文整理了Java中net.bytebuddy.matcher.ElementMatchers.isSynthetic()
方法的一些代码示例,展示了ElementMatchers.isSynthetic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ElementMatchers.isSynthetic()
方法的具体详情如下:
包路径:net.bytebuddy.matcher.ElementMatchers
类名称: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
}
代码示例来源: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
new PrivilegedAction
@Override
public MethodDelegation run() {
return MethodDelegation.to( ProxyConfiguration.InterceptorDispatcher.class );
}
};
this.delegateToInterceptorDispatcherMethodDelegation = System.getSecurityManager() != null
? AccessController.doPrivileged( delegateToInterceptorDispatcherMethodDelegationPrivilegedAction )
: delegateToInterceptorDispatcherMethodDelegationPrivilegedAction.run();
PrivilegedAction
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
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.
: ElementMatchers.
.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.")).
Transformation.Ignored.INSTANCE);
代码示例来源:origin: stagemonitor/stagemonitor
protected ElementMatcher.Junction
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.
: ElementMatchers.
.withIgnoredFields(new ValueMatcher(ValueHandling.Sort.IGNORE))
.withNonNullableFields(nonNullable(new ValueMatcher(ValueHandling.Sort.REVERSE_NULLABILITY))));
.withIgnoredFields(enhance.includeSyntheticFields()
? ElementMatchers.
: ElementMatchers.
.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
new PrivilegedAction
@Override
public MethodDelegation run() {
return MethodDelegation.to( ProxyConfiguration.InterceptorDispatcher.class );
}
};
this.delegateToInterceptorDispatcherMethodDelegation = System.getSecurityManager() != null
? AccessController.doPrivileged( delegateToInterceptorDispatcherMethodDelegationPrivilegedAction )
: delegateToInterceptorDispatcherMethodDelegationPrivilegedAction.run();
PrivilegedAction
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
.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()
)
);
}
}