@Test public void testConstructorRemoval() throws Exception { Class<?> type = new ByteBuddy() .redefine(Sample.class) .visit(new MemberRemoval().stripConstructors(takesArguments(0))) .make() .load(ClassLoadingStrategy.BOOTSTRAP_LOADER, ClassLoadingStrategy.Default.WRAPPER) .getLoaded(); try { type.getDeclaredConstructor(); fail(); } catch (NoSuchMethodException ignored) { } assertThat(type.getDeclaredConstructor(Void.class), notNullValue(Constructor.class)); }
public MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher) { return stripInvokables(isConstructor().and(matcher)); }
MemberRemoval extends AsmVisitorWrapper.AbstractBase { public MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher) { return stripInvokables(isConstructor().and(matcher)); } }
MemberRemoval extends AsmVisitorWrapper.AbstractBase { public MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher) { return stripInvokables(isConstructor().and(matcher)); } MemberRemoval(); protected  MemberRemoval(ElementMatcher.Junction<FieldDescription.InDefinedShape> fieldMatcher,
                            ElementMatcher.Junction<MethodDescription> methodMatcher); }
MemberRemoval extends AsmVisitorWrapper.AbstractBase { public MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher) { return stripInvokables(isConstructor().and(matcher)); } MemberRemoval(); protected  MemberRemoval(ElementMatcher.Junction<FieldDescription.InDefinedShape> fieldMatcher,
                            ElementMatcher.Junction<MethodDescription> methodMatcher); MemberRemoval stripFields(ElementMatcher<? super FieldDescription.InDefinedShape> matcher); MemberRemoval stripMethods(ElementMatcher<? super MethodDescription> matcher); MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher); MemberRemoval stripInvokables(ElementMatcher<? super MethodDescription> matcher); ClassVisitor wrap(TypeDescription instrumentedType,
                             ClassVisitor classVisitor,
                             Implementation.Context implementationContext,
                             TypePool typePool,
                             FieldList<FieldDescription.InDefinedShape> fields,
                             MethodList<?> methods,
                             int writerFlags,
                             int readerFlags); }
MemberRemoval extends AsmVisitorWrapper.AbstractBase { public MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher) { return stripInvokables(isConstructor().and(matcher)); } MemberRemoval(); protected  MemberRemoval(ElementMatcher.Junction<FieldDescription.InDefinedShape> fieldMatcher,
                            ElementMatcher.Junction<MethodDescription> methodMatcher); MemberRemoval stripFields(ElementMatcher<? super FieldDescription.InDefinedShape> matcher); MemberRemoval stripMethods(ElementMatcher<? super MethodDescription> matcher); MemberRemoval stripConstructors(ElementMatcher<? super MethodDescription> matcher); MemberRemoval stripInvokables(ElementMatcher<? super MethodDescription> matcher); ClassVisitor wrap(TypeDescription instrumentedType,
                             ClassVisitor classVisitor,
                             Implementation.Context implementationContext,
                             TypePool typePool,
                             FieldList<FieldDescription.InDefinedShape> fields,
                             MethodList<?> methods,
                             int writerFlags,
                             int readerFlags);  }