com.nedap.archie.serializer.adl.constraints.CTemporalSerializer 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.constraints;
import com.nedap.archie.aom.primitives.CTemporal;
import com.nedap.archie.serializer.adl.ADLDefinitionSerializer;
/**
* @author markopi
*/
abstract public class CTemporalSerializer> extends COrderedSerializer {
public CTemporalSerializer(ADLDefinitionSerializer serializer) {
super(serializer);
}
@Override
protected void serializeBefore(T cobj) {
super.serializeBefore(cobj);
serializePatternedConstraint(cobj);
}
private void serializePatternedConstraint(T cobj) {
if (cobj.getPatternConstraint()!=null) {
builder.append(cobj.getPatternConstraint());
if (!cobj.getConstraint().isEmpty()) {
builder.append("/");
}
}
}
@Override
protected boolean shouldIncludeAssumedValue(T cobj) {
boolean result = super.shouldIncludeAssumedValue(cobj);
if (!result) return false;
return (cobj.getPatternConstraint()!=null ||
(cobj.getConstraint()!=null && !cobj.getConstraint().isEmpty()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy