private void configureLenient( Class<? extends Annotation> annotationType, Annotation configuration) { configure(annotationType, configuration, ex -> {}); }
@Override public void configure(AnnotatedElement element) { delegate.configure(element); }
@Override public void configure(AnnotatedType annotatedType) { super.configure(annotatedType); List<AnnotatedType> annotatedComponentTypes = annotatedComponentTypes(annotatedType); if (annotatedComponentTypes.size() == components.size()) { for (int i = 0; i < components.size(); ++i) components.get(i).configure(annotatedComponentTypes.get(i)); } }
@Override public void configure(AnnotatedType annotatedType) { List<Weighted<Generator<?>>> candidates = new ArrayList<>(composed); for (Iterator<Weighted<Generator<?>>> it = candidates.iterator(); it.hasNext();) { try { it.next().item.configure(annotatedType); } catch (GeneratorConfigurationException e) { it.remove(); } } installCandidates(candidates, annotatedType); }
@Override public void configure(AnnotatedElement element) { List<Weighted<Generator<?>>> candidates = new ArrayList<>(composed); for (Iterator<Weighted<Generator<?>>> it = candidates.iterator(); it.hasNext();) { try { it.next().item.configure(element); } catch (GeneratorConfigurationException e) { it.remove(); } } installCandidates(candidates, element); }
@Override public void configure(AnnotatedType annotatedType) { Optional.ofNullable(annotatedType.getAnnotation(NullAllowed.class)).ifPresent(this::configure); delegate.configure(annotatedType); }
private void configureStrict( Class<? extends Annotation> annotationType, Annotation configuration) { configure( annotationType, configuration, ex -> { throw new GeneratorConfigurationException( String.format( "Generator %s does not understand configuration annotation %s", getClass().getName(), annotationType.getName()), ex); }); }
@Override public final <T extends Generator<?>> T make( Class<T> genType, Generator<?>... components) { T generator = instantiate(genType); generator.provide(this); generator.configure(genType); generator.addComponentGenerators(asList(components)); return generator; }
public Generator<?> produceGenerator(ParameterTypeContext parameter) { Generator<?> generator = generatorFor(parameter); if (!isPrimitiveType(parameter.annotatedType().getType()) && hasNullableAnnotation(parameter.annotatedElement())) generator = new NullableGenerator<>(generator); generator.provide(this); generator.configure(parameter.annotatedType()); if (parameter.topLevel()) generator.configure(parameter.annotatedElement()); return generator; }
private void configureLenient( Class<? extends Annotation> annotationType, Annotation configuration) { configure(annotationType, configuration, ex -> {}); }
@Override public void configure(AnnotatedType annotatedType) { super.configure(annotatedType); List<AnnotatedType> annotatedComponentTypes = annotatedComponentTypes(annotatedType); if (annotatedComponentTypes.size() == components.size()) { for (int i = 0; i < components.size(); ++i) components.get(i).configure(annotatedComponentTypes.get(i)); } }
@Override public void configure(AnnotatedElement element) { List<Weighted<Generator<?>>> candidates = new ArrayList<>(composed); for (Iterator<Weighted<Generator<?>>> it = candidates.iterator(); it.hasNext();) { try { it.next().item.configure(element); } catch (GeneratorConfigurationException e) { it.remove(); } } installCandidates(candidates, element); }
private Generator<?> produceGenerator(ParameterTypeContext parameter) { Generator<?> generator = generatorRepository.generatorFor(parameter); generator.provide(generatorRepository); generator.configure(parameter.annotatedType()); return generator; } }