@Test public void shouldAddNotFoundField() { JFieldRef var = rule.getOrAddNotFoundVar(type); assertThat(var, notNullValue()); }
JFieldRef getOrAddNotFoundVar(JDefinedClass jclass) { jclass.field(PROTECTED | STATIC | FINAL, Object.class, NOT_FOUND_VALUE_FIELD, _new(jclass.owner()._ref(Object.class))); return jclass.staticRef(NOT_FOUND_VALUE_FIELD); }
DynamicPropertiesRule implements Rule<JDefinedClass, JDefinedClass> { JFieldRef getOrAddNotFoundVar(JDefinedClass jclass) { jclass.field(PROTECTED | STATIC | FINAL, Object.class, NOT_FOUND_VALUE_FIELD, _new(jclass.owner()._ref(Object.class))); return jclass.staticRef(NOT_FOUND_VALUE_FIELD); } }
DynamicPropertiesRule implements Rule<JDefinedClass, JDefinedClass> { JFieldRef getOrAddNotFoundVar(JDefinedClass jclass) { jclass.field(PROTECTED | STATIC | FINAL, Object.class, NOT_FOUND_VALUE_FIELD, _new(jclass.owner()._ref(Object.class))); return jclass.staticRef(NOT_FOUND_VALUE_FIELD); } DynamicPropertiesRule(RuleFactory ruleFactory); }
DynamicPropertiesRule implements Rule<JDefinedClass, JDefinedClass> { JFieldRef getOrAddNotFoundVar(JDefinedClass jclass) { jclass.field(PROTECTED | STATIC | FINAL, Object.class, NOT_FOUND_VALUE_FIELD, _new(jclass.owner()._ref(Object.class))); return jclass.staticRef(NOT_FOUND_VALUE_FIELD); } DynamicPropertiesRule(RuleFactory ruleFactory); @Override JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema currentSchema); }
DynamicPropertiesRule implements Rule<JDefinedClass, JDefinedClass> { JFieldRef getOrAddNotFoundVar(JDefinedClass jclass) { jclass.field(PROTECTED | STATIC | FINAL, Object.class, NOT_FOUND_VALUE_FIELD, _new(jclass.owner()._ref(Object.class))); return jclass.staticRef(NOT_FOUND_VALUE_FIELD); } DynamicPropertiesRule(RuleFactory ruleFactory); @Override JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema currentSchema); static final String NOT_FOUND_VALUE_FIELD; static final String SETTER_NAME; static final String GETTER_NAME; static final String BUILDER_NAME; static final String DEFINED_SETTER_NAME; static final String DEFINED_GETTER_NAME; }