/** * @param accumulator * @param data * @throws UnableToCompleteException */ private void descendIntoSubEditor(List<EditorData> accumulator, EditorData data) throws UnableToCompleteException { EditorModel superModel = parentModel; while (superModel != null) { if (superModel.editorType.isAssignableFrom(data.getEditorType()) || data.getEditorType().isAssignableFrom(superModel.editorType)) { poison(cycleErrorMessage(data.getEditorType(), superModel.getPath(), data.getPath())); return; } superModel = superModel.parentModel; } if (data.isDelegateRequired()) { EditorModel subModel = new EditorModel(this, data.getEditorType(), data, calculateEditedType(logger, data.getEditorType())); accumulator.addAll(accumulator.indexOf(data) + 1, Arrays.asList(subModel.getEditorData())); poisoned |= subModel.poisoned; } }
/** * @param accumulator * @param data * @throws UnableToCompleteException */ private void descendIntoSubEditor(List<EditorData> accumulator, EditorData data) throws UnableToCompleteException { EditorModel superModel = parentModel; while (superModel != null) { if (superModel.editorType.isAssignableFrom(data.getEditorType()) || data.getEditorType().isAssignableFrom(superModel.editorType)) { poison(cycleErrorMessage(data.getEditorType(), superModel.getPath(), data.getPath())); return; } superModel = superModel.parentModel; } if (data.isDelegateRequired()) { EditorModel subModel = new EditorModel(this, data.getEditorType(), data, calculateEditedType(logger, data.getEditorType())); accumulator.addAll(accumulator.indexOf(data) + 1, Arrays.asList(subModel.getEditorData())); poisoned |= subModel.poisoned; } }
if (d.isDelegateRequired()) { String fieldName = nameFactory.createName(d.getPropertyName() + "Delegate"); if (d.isDelegateRequired()) { sw.println("if (editor.%s != null) {", d.getSimpleExpression()); sw.indent(); if (d.isDelegateRequired()) { sw.println("if (%s != null) ", delegateFields.get(d)); editorContextName, editorContextName, d.getSimpleExpression(), d.getDeclaredPath()); if (d.isDelegateRequired()) { sw.println("ctx.setEditorDelegate(%s);", delegateFields.get(d)); sw.println("ctx.traverse(visitor, %s);", d.isDelegateRequired() ? delegateFields.get(d) : "null"); sw.outdent();
if (d.isDelegateRequired()) { String fieldName = nameFactory.createName(d.getPropertyName() + "Delegate"); if (d.isDelegateRequired()) { sw.println("if (editor.%s != null) {", d.getSimpleExpression()); sw.indent(); if (d.isDelegateRequired()) { sw.println("if (%s != null) ", delegateFields.get(d)); editorContextName, editorContextName, d.getSimpleExpression(), d.getDeclaredPath()); if (d.isDelegateRequired()) { sw.println("ctx.setEditorDelegate(%s);", delegateFields.get(d)); sw.println("ctx.traverse(visitor, %s);", d.isDelegateRequired() ? delegateFields.get(d) : "null"); sw.outdent();