use of io.fixprotocol._2020.orchestra.repository.GroupRefType in project fix-orchestra by FIXTradingCommunity.
the class DocGenerator method generateMembers.
private void generateMembers(final List<Object> members, final STWriter writer) {
for (final Object member : members) {
if (member instanceof FieldRefType) {
final FieldType field = getField(((FieldRefType) member).getId().intValue());
final ST stField = stGroup.getInstanceOf("fieldMember");
stField.add("field", field);
if (((FieldRefType) member).getSupported() == SupportType.SUPPORTED) {
stField.add("presence", getFieldPresence((FieldRefType) member));
} else {
stField.add("presence", supportedMap.get(((FieldRefType) member).getSupported()));
}
stField.add("assign", ((FieldRefType) member).getAssign());
stField.write(writer, templateErrorListener);
} else if (member instanceof GroupRefType) {
final GroupType component = getGroup(((GroupRefType) member).getId().intValue());
final ST stComponent = stGroup.getInstanceOf("componentMember");
stComponent.add("component", component);
if (((ComponentRefType) member).getSupported() == SupportType.SUPPORTED) {
stComponent.add("presence", ((ComponentRefType) member).getPresence().value().toLowerCase());
} else {
stComponent.add("presence", supportedMap.get(((ComponentRefType) member).getSupported()));
}
stComponent.write(writer, templateErrorListener);
} else if (member instanceof ComponentRefType) {
final ComponentType component = getComponent(((ComponentRefType) member).getId().intValue());
final ST stComponent = stGroup.getInstanceOf("componentMember");
stComponent.add("component", component);
if (((ComponentRefType) member).getSupported() == SupportType.SUPPORTED) {
stComponent.add("presence", ((ComponentRefType) member).getPresence().value().toLowerCase());
} else {
stComponent.add("presence", supportedMap.get(((ComponentRefType) member).getSupported()));
}
stComponent.write(writer, templateErrorListener);
}
}
}
use of io.fixprotocol._2020.orchestra.repository.GroupRefType in project fix-orchestra by FIXTradingCommunity.
the class RepositoryCompressor method walk.
private void walk(List<Object> list) {
for (final Object obj : list) {
if (obj instanceof GroupRefType) {
final GroupRefType groupRef = (GroupRefType) obj;
final GroupType group = getGroup(groupRef.getId());
if (group == null) {
logger.error("Group missing for groupRef; ID={}", groupRef.getId().intValue());
return;
}
fieldIdList.add(group.getNumInGroup().getId());
groupIdList.add(groupRef.getId());
// recursion on referenced component
walk(getGroupMembers(groupRef.getId()));
} else if (obj instanceof ComponentRefType) {
final ComponentRefType componentRef = (ComponentRefType) obj;
componentIdList.add(componentRef.getId());
// recursion on referenced component
walk(getComponentMembers(componentRef.getId()));
} else if (obj instanceof FieldRefType) {
final FieldRefType fieldRef = (FieldRefType) obj;
fieldIdList.add(fieldRef.getId());
}
}
}
Aggregations