org.stringtemplate.v4.STErrorListener Java Examples

The following examples show how to use org.stringtemplate.v4.STErrorListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImgGenerator.java    From fix-orchestra with Apache License 2.0 6 votes vote down vote up
private void generateResponses(List<ResponseType> responseList, STWriter writer,
    STErrorListener errorListener) {
  for (int i = 0; i < responseList.size(); i++) {
    final ResponseType response = responseList.get(i);
    final List<Object> responses = response.getMessageRefOrAssignOrTrigger();
    for (int j = 0; j < responses.size(); j++) {
      final Object responseRef = responses.get(j);
      if (responseRef instanceof MessageRefType) {
        final MessageRefType messageRef = (MessageRefType) responseRef;
        final ST st = stGroup.getInstanceOf("messageResponse");
        st.add("messageName", messageRef.getName());
        st.add("scenarioName", messageRef.getScenario());
        st.add("async", response.getSync() == Synchronization.ASYNCHRONOUS);
        st.add("name", response.getName());
        st.add("isFirstAlt", i == 0 && responseList.size() > 1 && j == 0);
        st.add("isAlt", (i != 0) && responseList.size() > 1 && j == 0);
        st.write(writer, errorListener);
      }
    }
  }
}
 
Example #2
Source File: ImgGenerator.java    From fix-orchestra with Apache License 2.0 6 votes vote down vote up
public void generateUMLSequence(Path messagesImgPath, PathManager fileSystemManager, MessageType message, FlowType flow,
    List<ResponseType> responseList, STErrorListener errorListener) throws IOException {
  final StringWriter stringWriter = new StringWriter();
  final NoIndentWriter writer = new NoIndentWriter(stringWriter);

  final ST stSequence = stGroup.getInstanceOf("sequence");
  stSequence.add("message", message);
  stSequence.add("flow", flow);
  stSequence.write(writer, errorListener);
  generateResponses(responseList, writer, errorListener);
  final ST stEnd = stGroup.getInstanceOf("sequenceEnd");
  stEnd.add("message", message);
  stEnd.write(writer, errorListener);

  final String umlString = stringWriter.toString();

  final SourceStringReader reader = new SourceStringReader(umlString);
  final Path path = messagesImgPath.resolve(String.format("%s-%s.png", message.getName(), message.getScenario()));
  final OutputStream out = fileSystemManager.getOutputStream(path);
  reader.generateImage(out);
  out.flush();
}
 
Example #3
Source File: ImgGenerator.java    From fix-orchestra with Apache License 2.0 6 votes vote down vote up
public void generateUMLStateMachine(Path messagesImgPath, PathManager fileSystemManager, StateMachineType stateMachine,
    STErrorListener errorListener) throws IOException {
  final StringWriter stringWriter = new StringWriter();
  final NoIndentWriter writer = new NoIndentWriter(stringWriter);

  final ST stStates = stGroup.getInstanceOf("stateMachine");
  stStates.add("stateMachine", stateMachine);
  stStates.write(writer, errorListener);

  final String umlString = stringWriter.toString();

  final SourceStringReader reader = new SourceStringReader(umlString);
  final Path path = messagesImgPath.resolve(String.format("%s.png", stateMachine.getName()));
  final OutputStream out = fileSystemManager.getOutputStream(path);
  reader.generateImage(out);
  out.flush();
}
 
Example #4
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #5
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
	this.listener = listener;
}
 
Example #6
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #7
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #8
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #9
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #10
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #11
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #12
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #13
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #14
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #15
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #16
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #17
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #18
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #19
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example #20
Source File: ErrorManager.java    From codebuff with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}