Package com.google.template.soy.msgs

Examples of com.google.template.soy.msgs.SoyMsgException


        // Start 'file': Save the target locale string.
        if (targetLocaleString == null) {
          targetLocaleString = atts.getValue("target-language");
        } else {
          if (!atts.getValue("target-language").equals(targetLocaleString)) {
            throw new SoyMsgException(
                "If XLIFF input contains multiple 'file' elements, they must have the same" +
                " 'target-language'.");
          }
        }

      } else if (qName.equals("trans-unit")) {
        // Start 'trans-unit': Save the message id.
        String id = atts.getValue("id");
        try {
          currMsgId = Long.parseLong(id);
        } catch (NumberFormatException e) {
          throw new SoyMsgException(
              "Invalid message id '" + id + "' could not have been generated by the Soy compiler.");
        }

      } else if (qName.equals("target")) {
        // Start 'target': Prepare to collect the message parts (coming next).
        currMsgParts = Lists.newArrayList();
        currRawTextPart = null;
        isInMsg = true;

      } else if (isInMsg) {
        if (!qName.equals("x")) {
          throw new SoyMsgException(
              "In messages extracted by the Soy compiler, all placeholders should be element 'x'" +
              " (found element '" + qName + "' in message).");
        }
        // Placeholder in message: Save the preceding raw text (if any) and then save the
        // placeholder name.
View Full Code Here


      throws SoyMsgException {

    try {
      return XliffParser.parseXliffTargetMsgs(inputFileContent);
    } catch (SAXException e) {
      throw new SoyMsgException(e);
    }
  }
View Full Code Here

  public SoyMsgPluralCaseSpec(int explicitValue) {
    if (explicitValue >= 0) {
      type = Type.EXPLICIT;
      this.explicitValue = explicitValue;
    } else {
      throw new SoyMsgException("Negative plural case value.");
    }
  }
View Full Code Here

TOP

Related Classes of com.google.template.soy.msgs.SoyMsgException

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.