private static ComponentBuilder<?> builderFromGenerator( Generator<?> source, ComponentDescriptor descriptor, BeneratorContext context) { boolean nullability = DescriptorUtil.isNullable(descriptor, context); Double nullQuota = descriptor.getNullQuota(); if (nullQuota != null && nullQuota != 0) source = context.getGeneratorFactory().applyNullSettings(source, nullability, nullQuota); TypeDescriptor typeDescriptor = descriptor.getTypeDescriptor(); String scope = (typeDescriptor != null ? typeDescriptor.getScope() : null); if (descriptor instanceof ArrayElementDescriptor) { int index = ((ArrayElementDescriptor) descriptor).getIndex(); return new ArrayElementBuilder(index, source, scope); } else return new PlainEntityComponentBuilder(descriptor.getName(), source, scope); }