当前位置: 首页>>代码示例>>Java>>正文


Java Visibility.PUBLIC属性代码示例

本文整理汇总了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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:18,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:20,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:17,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:23,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:15,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:12,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:12,代码来源:TypeWriterMethodPoolRecordTest.java

示例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);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:14,代码来源:TypeWriterMethodPoolRecordTest.java

示例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));
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:10,代码来源:TypeWriterMethodPoolRecordTest.java


注:本文中的net.bytebuddy.description.modifier.Visibility.PUBLIC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。