Package org.waveprotocol.pst.model

Examples of org.waveprotocol.pst.model.MessageProperties


   */
  public void run() throws PstException {
    List<PstException.TemplateException> exceptions = Lists.newArrayList();
    for (File template : templates) {
      try {
        MessageProperties properties = createProperties(template);
        String groupName = stripSuffix(".st", template.getName());
        String templateName = properties.hasTemplateName() ?
            properties.getTemplateName() : "";
        StringTemplateGroup group = new StringTemplateGroup(groupName + "Group", dir(template));
        StringTemplate st = group.getInstanceOf(groupName);
        for (Descriptor messageDescriptor : fd.getMessageTypes()) {
          Message message = new Message(messageDescriptor, templateName, properties);
          st.reset();
          st.setAttribute("m", message);
          write(st, new File(
              outputDir.getPath() + File.separator +
              message.getFullJavaType().replace('.', File.separatorChar) + "." +
              (properties.hasFileExtension() ? properties.getFileExtension() : "java")));
        }
      } catch (Exception e) {
        exceptions.add(new PstException.TemplateException(template.getPath(), e));
      }
    }
View Full Code Here


  private MessageProperties createProperties(File template)
      throws FileNotFoundException, IOException {
    File propertiesFile =
        new File(template.getParentFile().getPath() + File.separator + "properties");
    MessageProperties properties = propertiesFile.exists()
        ? MessageProperties.createFromFile(propertiesFile) : MessageProperties.createEmpty();
    properties.setUseInt52(useInt52);
    return properties;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.pst.model.MessageProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.