本文整理汇总了Java中net.bytebuddy.description.field.FieldDescription.Token方法的典型用法代码示例。如果您正苦于以下问题:Java FieldDescription.Token方法的具体用法?Java FieldDescription.Token怎么用?Java FieldDescription.Token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.bytebuddy.description.field.FieldDescription
的用法示例。
在下文中一共展示了FieldDescription.Token方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withField
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
@Override
public WithFlexibleName withField(FieldDescription.Token token) {
return new Default(this.name,
modifiers,
superClass,
typeVariables,
interfaceTypes,
CompoundList.of(fieldTokens, token.accept(Generic.Visitor.Substitutor.ForDetachment.of(this))),
methodTokens,
annotationDescriptions,
typeInitializer,
loadedTypeInitializer,
declaringType,
enclosingMethod,
enclosingType,
declaredTypes,
memberClass,
anonymousClass,
localClass);
}
示例2: transform
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
@Override
public FieldDescription.Token transform(TypeDescription instrumentedType, FieldDescription.Token target) {
return new FieldDescription.Token(target.getName(),
resolver.resolve(target.getModifiers()),
target.getType(),
target.getAnnotations());
}
示例3: FieldDefinitionAdapter
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
/**
* Creates a new field definition adapter.
*
* @param token The token representing the current field definition.
*/
protected FieldDefinitionAdapter(FieldDescription.Token token) {
this(FieldAttributeAppender.ForInstrumentedField.INSTANCE,
Transformer.NoOp.<FieldDescription>make(),
FieldDescription.NO_DEFAULT_VALUE,
token);
}
示例4: annotateField
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
@Override
public Optional<U> annotateField(Collection<? extends AnnotationDescription> annotations) {
return new FieldDefinitionAdapter(fieldAttributeAppenderFactory, transformer, defaultValue, new FieldDescription.Token(token.getName(),
token.getModifiers(),
token.getType(),
CompoundList.of(token.getAnnotations(), new ArrayList<AnnotationDescription>(annotations))));
}
示例5: Default
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
/**
* Creates a new instrumented type.
*
* @param name The binary name of the instrumented type.
* @param modifiers The modifiers of the instrumented type.
* @param typeVariables The instrumented type's type variables in their tokenized form.
* @param superClass The generic super type of the instrumented type.
* @param interfaceTypes A list of interfaces of the instrumented type.
* @param fieldTokens A list of field tokens describing the fields of the instrumented type.
* @param methodTokens A list of method tokens describing the methods of the instrumented type.
* @param annotationDescriptions A list of annotations of the annotated type.
* @param typeInitializer The type initializer of the instrumented type.
* @param loadedTypeInitializer The loaded type initializer of the instrumented type.
* @param declaringType The declaring type of the instrumented type or {@code null} if no such type exists.
* @param enclosingMethod The enclosing method of the instrumented type or {@code null} if no such type exists.
* @param enclosingType The enclosing type of the instrumented type or {@code null} if no such type exists.
* @param declaredTypes A list of types that are declared by this type.
* @param memberClass {@code true} if this type is a member class.
* @param anonymousClass {@code true} if this type is a anonymous class.
* @param localClass {@code true} if this type is a local class.
*/
protected Default(String name,
int modifiers,
Generic superClass,
List<? extends TypeVariableToken> typeVariables,
List<? extends Generic> interfaceTypes,
List<? extends FieldDescription.Token> fieldTokens,
List<? extends MethodDescription.Token> methodTokens,
List<? extends AnnotationDescription> annotationDescriptions,
TypeInitializer typeInitializer,
LoadedTypeInitializer loadedTypeInitializer,
TypeDescription declaringType,
MethodDescription enclosingMethod,
TypeDescription enclosingType,
List<? extends TypeDescription> declaredTypes,
boolean memberClass,
boolean anonymousClass,
boolean localClass) {
this.name = name;
this.modifiers = modifiers;
this.typeVariables = typeVariables;
this.superClass = superClass;
this.interfaceTypes = interfaceTypes;
this.fieldTokens = fieldTokens;
this.methodTokens = methodTokens;
this.annotationDescriptions = annotationDescriptions;
this.typeInitializer = typeInitializer;
this.loadedTypeInitializer = loadedTypeInitializer;
this.declaringType = declaringType;
this.enclosingMethod = enclosingMethod;
this.enclosingType = enclosingType;
this.declaredTypes = declaredTypes;
this.memberClass = memberClass;
this.anonymousClass = anonymousClass;
this.localClass = localClass;
}
示例6: testModifierTransformation
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
@Test
public void testModifierTransformation() throws Exception {
FieldDescription.Token transformed = new Transformer.ForField.FieldModifierTransformer(ModifierContributor.Resolver.of(modifierContributor))
.transform(instrumentedType, fieldToken);
assertThat(transformed.getName(), is(FOO));
assertThat(transformed.getModifiers(), is((MODIFIERS & ~RANGE) | MASK));
assertThat(transformed.getType(), is(fieldType));
}
示例7: testFieldTokenIsVisited
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
@Test
public void testFieldTokenIsVisited() throws Exception {
FieldDescription.Token token = mock(FieldDescription.Token.class);
InstrumentedType instrumentedType = makePlainInstrumentedType();
assertThat(instrumentedType.withField(token), is(instrumentedType));
verify(token).accept(TypeDescription.Generic.Visitor.Substitutor.ForDetachment.of(instrumentedType));
verifyNoMoreInteractions(token);
}
示例8: defineField
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
@Override
public FieldDefinition.Optional.Valuable<U> defineField(String name, TypeDefinition type, int modifiers) {
return new FieldDefinitionAdapter(new FieldDescription.Token(name, modifiers, type.asGenericType()));
}
示例9: ForFieldToken
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
/**
* Creates a new latent matcher for a field token.
*
* @param token A token representing the field being matched.
*/
public ForFieldToken(FieldDescription.Token token) {
this.token = token;
}
示例10: ForField
import net.bytebuddy.description.field.FieldDescription; //导入方法依赖的package包/类
/**
* Creates a new simple field transformer.
*
* @param transformer The token transformer to apply to a transformed field.
*/
public ForField(Transformer<FieldDescription.Token> transformer) {
this.transformer = transformer;
}