Examples of StringTemplate


Examples of org.antlr.stringtemplate.StringTemplate

  {
    // "ALTER TABLE $childTableName$ " +
    // "ADD $constraint$ $constraintName$ FOREIGN KEY ( $childColumn; separator=\",\"$ ) " +
    // "REFERENCES $parentTableName$ ( $parentColumn; separator=\",\"$ )";

    StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE);
    HashMap<String, String> fkValuesMap = DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName);
    fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT");
    fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);
    fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName);

    StringTemplate childIndexST = null;
    HashMap<String, String> ckIndexValuesMap = null;

    if (autoFKIndex)
    {
      // "CREATE $unique$ $storageOption$ INDEX $indexName$ " +
      // "ON $tableName$ ( $columnName; separator=\",\"$ )";

      childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);
      ckIndexValuesMap = new HashMap<String, String>();
      ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx");
    }

    return DialectUtils.getAddForeignKeyConstraintSQL(fkST,
View Full Code Here

Examples of org.antlr.stringtemplate.StringTemplate

    // "ALTER TABLE $tableName$ " +
    // "ADD CONSTRAINT $constraintName$ UNIQUE ($columnName; separator=\",\"$)";

    String templateStr = ST_ADD_UNIQUE_CONSTRAINT_STYLE_TWO;

    StringTemplate st = new StringTemplate(templateStr);

    HashMap<String, String> valuesMap =
      DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, tableName, ST_CONSTRAINT_NAME_KEY, constraintName);

    return new String[] { DialectUtils.getAddUniqueConstraintSQL(st,
View Full Code Here

Examples of org.apache.openejb.util.StringTemplate

                    logger.error("Illegal " + JNDINAME_FORMAT + " contains a colon ':'.  Everything before the colon will be removed, '" + format + "' ");
                    format = format.substring(index + 1);
                }
            }

            this.template = new StringTemplate(format);

            beanInfos = new HashMap<String, EnterpriseBeanInfo>();
            for (EnterpriseBeanInfo beanInfo : ejbJarInfo.enterpriseBeans) {
                beanInfos.put(beanInfo.ejbDeploymentId, beanInfo);
            }
View Full Code Here

Examples of org.codehaus.swizzle.stream.StringTemplate

    private final Map<String,String> ejbAddresses = new TreeMap<String,String>();
    private final Map<String,String> servletAddresses = new TreeMap<String,String>();

    public WsService() {
        String format = SystemInstance.get().getProperty(WS_ADDRESS_FORMAT, "/{ejbDeploymentId}");
        this.wsAddressTemplate = new StringTemplate(format);
    }
View Full Code Here

Examples of org.g4studio.core.tplengine.StringTemplate

    dto.put("any", TagHelper.checkEmpty(any));
    dto.put("style", TagHelper.checkEmpty(style));
    dto.put("cls", TagHelper.checkEmpty(cls));
    String tpl = "<div id=*$key* #if(${cls}!=*off*)class=*${cls}*#end #if(${style}!=*off*)style=*${style}*#end #if(${any}!=*off*)${any}#end>";
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new StringTemplate(TagHelper.replaceStringTemplate(tpl));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
      pageContext.getOut().write(writer.toString());
    } catch (IOException e) {
      log.error(G4Constants.Exception_Head + e.getMessage());
View Full Code Here

Examples of org.springframework.templating.StringTemplate

 
  public SimpleMailMessage convert(ResetPasswordRequest request) {
    SimpleMailMessage mailMessage = new SimpleMailMessage();
    mailMessage.setFrom("Greenhouse <noreply@springsource.com>");
    mailMessage.setTo(request.getAccount().getEmail());
    StringTemplate textTemplate;
    mailMessage.setSubject("Reset your Greenhouse password");
    textTemplate = resetTemplateFactory.getStringTemplate();
    textTemplate.put("firstName", request.getAccount().getFirstName());   
    textTemplate.put("resetUrl", resetUriTemplate.expand(request.getToken()));
    mailMessage.setText(textTemplate.render());
    return mailMessage;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.