com.nedap.archie.serializer.adl.ADLTemplateSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aom Show documentation
Show all versions of aom Show documentation
An OpenEHR archetype object model implementation, plus parser
package com.nedap.archie.serializer.adl;
import com.nedap.archie.aom.Archetype;
import com.nedap.archie.aom.Template;
import com.nedap.archie.aom.TemplateOverlay;
import com.nedap.archie.rminfo.RMObjectMapperProvider;
import java.util.function.Function;
/**
* @author markopi
*/
class ADLTemplateSerializer extends ADLAuthoredArchetypeSerializer {
public ADLTemplateSerializer(Template archetype, Function flatArchetypeProvider, RMObjectMapperProvider rmObjectMapperProvider) {
super(archetype, flatArchetypeProvider, rmObjectMapperProvider);
}
@Override
protected String headTag() {
return "template";
}
@Override
protected String serialize() {
super.serialize();
archetype.getTemplateOverlays().forEach(this::appendTemplateOverlay);
return builder.toString();
}
private void appendTemplateOverlay(TemplateOverlay templateOverlay) {
builder.newline()
.append("------------------------------------------------------------------------").newline()
.append(ADLArchetypeSerializer.serialize(templateOverlay, flatArchetypeProvider, rmObjectMapperProvider));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy