/** * {@inheritDoc} */ public ElementMatcher<? super MethodDescription> resolve(TypeDescription typeDescription) { return matcher.resolve(typeDescription); } }
/** * {@inheritDoc} */ public ElementMatcher<? super FieldDescription> resolve(TypeDescription typeDescription) { return matcher.resolve(typeDescription); } }
/** * {@inheritDoc} */ public ElementMatcher<? super S> resolve(TypeDescription typeDescription) { ElementMatcher.Junction<S> matcher = any(); for (LatentMatcher<? super S> latentMatcher : matchers) { matcher = matcher.and(latentMatcher.resolve(typeDescription)); } return matcher; } }
/** * {@inheritDoc} */ public ElementMatcher<? super S> resolve(TypeDescription typeDescription) { ElementMatcher.Junction<S> matcher = none(); for (LatentMatcher<? super S> latentMatcher : matchers) { matcher = matcher.or(latentMatcher.resolve(typeDescription)); } return matcher; } }
/** * {@inheritDoc} */ public ElementMatcher<? super MethodDescription> resolve(TypeDescription typeDescription) { // Casting is required by JDK 6. return (ElementMatcher<? super MethodDescription>) isVirtual().and(not(isFinal())) .and(isVisibleTo(typeDescription)) .and(not(ignoredMethods.resolve(typeDescription))) .or(isDeclaredBy(typeDescription)); } }
/** * {@inheritDoc} */ public ElementMatcher<? super MethodDescription> resolve(TypeDescription typeDescription) { return (ElementMatcher<? super MethodDescription>) not(ignoredMethods.resolve(typeDescription)) .and(isVirtual().and(not(isFinal())).or(isDeclaredBy(typeDescription))) .or(isDeclaredBy(typeDescription).and(not(predefinedMethodSignatures))); } }
/** * {@inheritDoc} */ public DynamicType.Builder<?> transform(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassLoader classLoader, JavaModule module) { ClassFileLocator classFileLocator = new ClassFileLocator.Compound(this.classFileLocator, locationStrategy.classFileLocator(classLoader, module)); TypePool typePool = poolStrategy.typePool(classFileLocator, classLoader); AsmVisitorWrapper.ForDeclaredMethods asmVisitorWrapper = new AsmVisitorWrapper.ForDeclaredMethods(); for (Entry entry : entries) { asmVisitorWrapper = asmVisitorWrapper.invokable(entry.getMatcher().resolve(typeDescription), entry.resolve(advice, typePool, classFileLocator) .withAssigner(assigner) .withExceptionHandler(exceptionHandler)); } return builder.visit(asmVisitorWrapper); }
.and(returns(isVisibleTo(instrumentedType))) .and(hasParameters(whereNone(hasType(not(isVisibleTo(instrumentedType)))))) .and(ignoredMethods.resolve(instrumentedType)); List<MethodDescription> methods = new ArrayList<MethodDescription>(); for (MethodGraph.Node node : methodGraph.listNodes()) {
/** * {@inheritDoc} */ public DynamicType.Unloaded<T> make(TypeResolutionStrategy typeResolutionStrategy, TypePool typePool) { return TypeWriter.Default.<T>forDecoration(instrumentedType, classFileVersion, auxiliaryTypes, CompoundList.of(methodGraphCompiler.compile(instrumentedType) .listNodes() .asMethodList() .filter(not(ignoredMethods.resolve(instrumentedType))), instrumentedType.getDeclaredMethods().filter(not(isVirtual()))), typeAttributeAppender, asmVisitorWrapper, annotationValueFilterFactory, annotationRetention, auxiliaryTypeNamingStrategy, implementationContextFactory, typeValidation, classWriterStrategy, typePool, classFileLocator).make(typeResolutionStrategy.resolve()); } }