Search in sources :

Example 1 with StateMachineType

use of io.fixprotocol._2020.orchestra.repository.StateMachineType in project fix-orchestra by FIXTradingCommunity.

the class DocGenerator method generateActorDetail.

private void generateActorDetail(final Path messagesDocPath, final Path messagesImgPath, final ActorType actor) throws Exception {
    final List<Object> stateMachines = actor.getFieldOrFieldRefOrComponent().stream().filter(o -> o instanceof StateMachineType).collect(Collectors.toList());
    final Path path = messagesDocPath.resolve(String.format("%s.html", actor.getName()));
    try (final STWriterWrapper writer = getWriter(path)) {
        final ST stActor = stGroup.getInstanceOf("actorStart");
        stActor.add("actor", actor);
        stActor.write(writer, templateErrorListener);
        final List<Object> members = actor.getFieldOrFieldRefOrComponent();
        generateMembers(members, writer);
        final ST stActor2 = stGroup.getInstanceOf("actorPart2");
        stActor2.add("actor", actor);
        stActor2.write(writer, templateErrorListener);
        for (final Object stateMachine : stateMachines) {
            final ST stStates = stGroup.getInstanceOf("stateMachine");
            stStates.add("states", stateMachine);
            stStates.write(writer, templateErrorListener);
        }
    }
    for (final Object stateMachine : stateMachines) {
        imgGenerator.generateUMLStateMachine(messagesImgPath, pathManager, (StateMachineType) stateMachine, templateErrorListener);
    }
}
Also used : ComponentType(io.fixprotocol._2020.orchestra.repository.ComponentType) STWriter(org.stringtemplate.v4.STWriter) STMessage(org.stringtemplate.v4.misc.STMessage) GroupRefType(io.fixprotocol._2020.orchestra.repository.GroupRefType) FieldRuleType(io.fixprotocol._2020.orchestra.repository.FieldRuleType) MessageType(io.fixprotocol._2020.orchestra.repository.MessageType) STGroup(org.stringtemplate.v4.STGroup) Map(java.util.Map) ValidationEventHandler(javax.xml.bind.ValidationEventHandler) Path(java.nio.file.Path) Repository(io.fixprotocol._2020.orchestra.repository.Repository) SimpleLiteral(org.purl.dc.elements._1.SimpleLiteral) ComponentRefType(io.fixprotocol._2020.orchestra.repository.ComponentRefType) SupportType(io.fixprotocol._2020.orchestra.repository.SupportType) FlowType(io.fixprotocol._2020.orchestra.repository.FlowType) Collectors(java.util.stream.Collectors) JAXBException(javax.xml.bind.JAXBException) Categories(io.fixprotocol._2020.orchestra.repository.Categories) PresenceT(io.fixprotocol._2020.orchestra.repository.PresenceT) ValidationEvent(javax.xml.bind.ValidationEvent) List(java.util.List) ST(org.stringtemplate.v4.ST) FieldRefType(io.fixprotocol._2020.orchestra.repository.FieldRefType) StateMachineType(io.fixprotocol._2020.orchestra.repository.StateMachineType) CodeSetType(io.fixprotocol._2020.orchestra.repository.CodeSetType) FieldType(io.fixprotocol._2020.orchestra.repository.FieldType) Writer(java.io.Writer) Optional(java.util.Optional) CodeType(io.fixprotocol._2020.orchestra.repository.CodeType) STGroupFile(org.stringtemplate.v4.STGroupFile) NoIndentWriter(org.stringtemplate.v4.NoIndentWriter) HashMap(java.util.HashMap) CategoryType(io.fixprotocol._2020.orchestra.repository.CategoryType) Datatype(io.fixprotocol._2020.orchestra.repository.Datatype) ResponseType(io.fixprotocol._2020.orchestra.repository.ResponseType) JAXBContext(javax.xml.bind.JAXBContext) PrintStream(java.io.PrintStream) Unmarshaller(javax.xml.bind.Unmarshaller) Files(java.nio.file.Files) Actors(io.fixprotocol._2020.orchestra.repository.Actors) JAXBElement(javax.xml.bind.JAXBElement) IOException(java.io.IOException) MessageRefType(io.fixprotocol._2020.orchestra.repository.MessageRefType) FileInputStream(java.io.FileInputStream) STErrorListener(org.stringtemplate.v4.STErrorListener) File(java.io.File) Responses(io.fixprotocol._2020.orchestra.repository.MessageType.Responses) ActorType(io.fixprotocol._2020.orchestra.repository.ActorType) CatComponentTypeT(io.fixprotocol._2020.orchestra.repository.CatComponentTypeT) Comparator(java.util.Comparator) InputStream(java.io.InputStream) GroupType(io.fixprotocol._2020.orchestra.repository.GroupType) Path(java.nio.file.Path) ST(org.stringtemplate.v4.ST) StateMachineType(io.fixprotocol._2020.orchestra.repository.StateMachineType)

Aggregations

ActorType (io.fixprotocol._2020.orchestra.repository.ActorType)1 Actors (io.fixprotocol._2020.orchestra.repository.Actors)1 CatComponentTypeT (io.fixprotocol._2020.orchestra.repository.CatComponentTypeT)1 Categories (io.fixprotocol._2020.orchestra.repository.Categories)1 CategoryType (io.fixprotocol._2020.orchestra.repository.CategoryType)1 CodeSetType (io.fixprotocol._2020.orchestra.repository.CodeSetType)1 CodeType (io.fixprotocol._2020.orchestra.repository.CodeType)1 ComponentRefType (io.fixprotocol._2020.orchestra.repository.ComponentRefType)1 ComponentType (io.fixprotocol._2020.orchestra.repository.ComponentType)1 Datatype (io.fixprotocol._2020.orchestra.repository.Datatype)1 FieldRefType (io.fixprotocol._2020.orchestra.repository.FieldRefType)1 FieldRuleType (io.fixprotocol._2020.orchestra.repository.FieldRuleType)1 FieldType (io.fixprotocol._2020.orchestra.repository.FieldType)1 FlowType (io.fixprotocol._2020.orchestra.repository.FlowType)1 GroupRefType (io.fixprotocol._2020.orchestra.repository.GroupRefType)1 GroupType (io.fixprotocol._2020.orchestra.repository.GroupType)1 MessageRefType (io.fixprotocol._2020.orchestra.repository.MessageRefType)1 MessageType (io.fixprotocol._2020.orchestra.repository.MessageType)1 Responses (io.fixprotocol._2020.orchestra.repository.MessageType.Responses)1 PresenceT (io.fixprotocol._2020.orchestra.repository.PresenceT)1