@Test public void testNoParsers(@TuneProvider Tune tune) { FieldSpec.Builder builder = FieldSpec.builder(String.class, "test"); FieldModel model = mock(FieldModel.class); when(model.getNamedAs()).thenReturn("nothing"); new NamedAsRule(tune, null).process(builder, model); FieldSpec spec = builder.build(); assertEquals("test", spec.name, "Wrong name found."); assertEquals(0, spec.annotations.size(), "Annotations found."); }
@Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (isNullOrEmpty(fieldModel.getNamedAs())) { return; } tune.getAnnotatorStyles().forEach(style -> style.processNamedAsRule(fieldSpec, fieldModel)); }
NamedAsRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (isNullOrEmpty(fieldModel.getNamedAs())) { return; } tune.getAnnotatorStyles().forEach(style -> style.processNamedAsRule(fieldSpec, fieldModel)); } }
NamedAsRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (isNullOrEmpty(fieldModel.getNamedAs())) { return; } tune.getAnnotatorStyles().forEach(style -> style.processNamedAsRule(fieldSpec, fieldModel)); } NamedAsRule(Tune tune, MetaInfo metaInfo); }
NamedAsRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (isNullOrEmpty(fieldModel.getNamedAs())) { return; } tune.getAnnotatorStyles().forEach(style -> style.processNamedAsRule(fieldSpec, fieldModel)); } NamedAsRule(Tune tune, MetaInfo metaInfo); @Override void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel); }
NamedAsRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (isNullOrEmpty(fieldModel.getNamedAs())) { return; } tune.getAnnotatorStyles().forEach(style -> style.processNamedAsRule(fieldSpec, fieldModel)); } NamedAsRule(Tune tune, MetaInfo metaInfo); @Override void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel);  }