本文整理汇总了Java中net.bytebuddy.description.modifier.Visibility.PUBLIC属性的典型用法代码示例。如果您正苦于以下问题:Java Visibility.PUBLIC属性的具体用法?Java Visibility.PUBLIC怎么用?Java Visibility.PUBLIC使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.bytebuddy.description.modifier.Visibility
的用法示例。
在下文中一共展示了Visibility.PUBLIC属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDefinedMethodWithParameters
@Test
public void testDefinedMethodWithParameters() throws Exception {
when(parameterDescription.hasModifiers()).thenReturn(true);
when(parameterDescription.isNamed()).thenReturn(true);
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody(methodDescription,
methodAttributeAppender,
Visibility.PUBLIC);
assertThat(record.getSort(), is(TypeWriter.MethodPool.Record.Sort.DEFINED));
record.apply(classVisitor, implementationContext, annotationValueFilterFactory);
verify(classVisitor).visitMethod(MODIFIERS, FOO, BAR, QUX, new String[]{BAZ});
verifyNoMoreInteractions(classVisitor);
verify(methodVisitor).visitParameter(FOO, MODIFIERS);
verify(methodVisitor).visitEnd();
verifyNoMoreInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verify(methodAttributeAppender).apply(methodVisitor, methodDescription, annotationValueFilter);
verifyNoMoreInteractions(methodAttributeAppender);
}
示例2: testImplementedMethod
@Test
public void testImplementedMethod() throws Exception {
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody(methodDescription,
byteCodeAppender,
methodAttributeAppender,
Visibility.PUBLIC);
assertThat(record.getSort(), is(TypeWriter.MethodPool.Record.Sort.IMPLEMENTED));
record.apply(classVisitor, implementationContext, annotationValueFilterFactory);
verify(classVisitor).visitMethod(MODIFIERS, FOO, BAR, QUX, new String[]{BAZ});
verifyNoMoreInteractions(classVisitor);
verify(methodVisitor).visitCode();
verify(methodVisitor).visitMaxs(ONE, TWO);
verify(methodVisitor).visitEnd();
verifyNoMoreInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verify(methodAttributeAppender).apply(methodVisitor, methodDescription, annotationValueFilter);
verifyNoMoreInteractions(methodAttributeAppender);
verify(byteCodeAppender).apply(methodVisitor, implementationContext, methodDescription);
verifyNoMoreInteractions(byteCodeAppender);
}
示例3: testImplementedMethodBodyOnly
@Test
public void testImplementedMethodBodyOnly() throws Exception {
when(parameterDescription.hasModifiers()).thenReturn(true);
when(parameterDescription.isNamed()).thenReturn(true);
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody(methodDescription,
byteCodeAppender,
methodAttributeAppender,
Visibility.PUBLIC);
record.applyBody(methodVisitor, implementationContext, annotationValueFilterFactory);
verify(methodVisitor).visitCode();
verify(methodVisitor).visitMaxs(ONE, TWO);
verifyZeroInteractions(implementationContext);
verify(methodAttributeAppender).apply(methodVisitor, methodDescription, annotationValueFilter);
verifyNoMoreInteractions(methodAttributeAppender);
verify(byteCodeAppender).apply(methodVisitor, implementationContext, methodDescription);
verifyNoMoreInteractions(byteCodeAppender);
}
示例4: testImplementedMethodWithParameters
@Test
public void testImplementedMethodWithParameters() throws Exception {
when(parameterDescription.hasModifiers()).thenReturn(true);
when(parameterDescription.isNamed()).thenReturn(true);
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody(methodDescription,
byteCodeAppender,
methodAttributeAppender,
Visibility.PUBLIC);
assertThat(record.getSort(), is(TypeWriter.MethodPool.Record.Sort.IMPLEMENTED));
record.apply(classVisitor, implementationContext, annotationValueFilterFactory);
verify(classVisitor).visitMethod(MODIFIERS, FOO, BAR, QUX, new String[]{BAZ});
verifyNoMoreInteractions(classVisitor);
verify(methodVisitor).visitParameter(FOO, MODIFIERS);
verify(methodVisitor).visitCode();
verify(methodVisitor).visitMaxs(ONE, TWO);
verify(methodVisitor).visitEnd();
verifyNoMoreInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verify(methodAttributeAppender).apply(methodVisitor, methodDescription, annotationValueFilter);
verifyNoMoreInteractions(methodAttributeAppender);
verify(byteCodeAppender).apply(methodVisitor, implementationContext, methodDescription);
verifyNoMoreInteractions(byteCodeAppender);
}
示例5: testDefinedMethod
@Test
public void testDefinedMethod() throws Exception {
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody(methodDescription,
methodAttributeAppender,
Visibility.PUBLIC);
assertThat(record.getSort(), is(TypeWriter.MethodPool.Record.Sort.DEFINED));
record.apply(classVisitor, implementationContext, annotationValueFilterFactory);
verify(classVisitor).visitMethod(MODIFIERS, FOO, BAR, QUX, new String[]{BAZ});
verifyNoMoreInteractions(classVisitor);
verify(methodVisitor).visitEnd();
verifyNoMoreInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verify(methodAttributeAppender).apply(methodVisitor, methodDescription, annotationValueFilter);
verifyNoMoreInteractions(methodAttributeAppender);
}
示例6: testDefinedMethodHeadOnly
@Test
public void testDefinedMethodHeadOnly() throws Exception {
when(parameterDescription.hasModifiers()).thenReturn(true);
when(parameterDescription.isNamed()).thenReturn(true);
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody(methodDescription,
methodAttributeAppender,
Visibility.PUBLIC);
record.applyHead(methodVisitor);
verifyZeroInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verifyZeroInteractions(methodAttributeAppender);
}
示例7: testDefinedMethodBodyOnly
@Test
public void testDefinedMethodBodyOnly() throws Exception {
when(parameterDescription.hasModifiers()).thenReturn(true);
when(parameterDescription.isNamed()).thenReturn(true);
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody(methodDescription,
methodAttributeAppender,
Visibility.PUBLIC);
record.applyBody(methodVisitor, implementationContext, annotationValueFilterFactory);
verifyZeroInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verify(methodAttributeAppender).apply(methodVisitor, methodDescription, annotationValueFilter);
}
示例8: testImplementedMethodHeadOnly
@Test
public void testImplementedMethodHeadOnly() throws Exception {
when(parameterDescription.hasModifiers()).thenReturn(true);
when(parameterDescription.isNamed()).thenReturn(true);
TypeWriter.MethodPool.Record record = new TypeWriter.MethodPool.Record.ForDefinedMethod.WithBody(methodDescription,
byteCodeAppender,
methodAttributeAppender,
Visibility.PUBLIC);
record.applyHead(methodVisitor);
verifyNoMoreInteractions(methodVisitor);
verifyZeroInteractions(implementationContext);
verifyZeroInteractions(methodAttributeAppender);
verifyZeroInteractions(byteCodeAppender);
}
示例9: testAccessorBridgePrependingTakesDelegateVisibility
@Test
public void testAccessorBridgePrependingTakesDelegateVisibility() throws Exception {
Visibility visibility = Visibility.PUBLIC;
when(delegate.getVisibility()).thenReturn(visibility);
assertThat(new TypeWriter.MethodPool.Record.AccessBridgeWrapper(delegate,
instrumentedType,
bridgeTarget,
Collections.singleton(typeToken),
methodAttributeAppender).getVisibility(), is(visibility));
}