Search in sources :

Example 1 with JavaTypeCreationProcess

use of com.tngtech.archunit.core.importer.DomainBuilders.JavaTypeCreationProcess in project ArchUnit by TNG.

the class JavaClassProcessor method visitField.

@Override
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
    if (importAborted()) {
        return super.visitField(access, name, desc, signature, value);
    }
    JavaClassDescriptor rawType = JavaClassDescriptorImporter.importAsmTypeFromDescriptor(desc);
    Optional<JavaTypeCreationProcess<JavaField>> genericType = JavaFieldTypeSignatureImporter.parseAsmFieldTypeSignature(signature, declarationHandler);
    DomainBuilders.JavaFieldBuilder fieldBuilder = new DomainBuilders.JavaFieldBuilder().withName(name).withType(genericType, rawType).withModifiers(JavaModifier.getModifiersForField(access)).withDescriptor(desc);
    declarationHandler.onDeclaredField(fieldBuilder, rawType.getFullyQualifiedClassName());
    return new FieldProcessor(fieldBuilder, declarationHandler);
}
Also used : JavaTypeCreationProcess(com.tngtech.archunit.core.importer.DomainBuilders.JavaTypeCreationProcess) JavaClassDescriptor(com.tngtech.archunit.core.domain.JavaClassDescriptor)

Aggregations

JavaClassDescriptor (com.tngtech.archunit.core.domain.JavaClassDescriptor)1 JavaTypeCreationProcess (com.tngtech.archunit.core.importer.DomainBuilders.JavaTypeCreationProcess)1