Java Code Examples for org.stringtemplate.v4.STErrorListener

The following examples show how to use org.stringtemplate.v4.STErrorListener. These examples are extracted from open source projects. 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 Project: fix-orchestra   Source File: ImgGenerator.java    License: 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 2
Source Project: fix-orchestra   Source File: ImgGenerator.java    License: 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 Project: fix-orchestra   Source File: ImgGenerator.java    License: 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 4
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 5
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 6
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 7
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 8
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 9
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 10
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 11
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 12
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 13
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 14
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 15
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 16
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 17
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 18
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 19
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
    this.listener = listener;
}
 
Example 20
Source Project: codebuff   Source File: ErrorManager.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ErrorManager(STErrorListener listener) {
	this.listener = listener;
}