Package com.google.template.soy.data

Examples of com.google.template.soy.data.SoyDataException


  }


  @Override public void put(String keyStr, SoyData value) {
    if (keyStr.indexOf('.') >= 0) {
      throw new SoyDataException(
          "Attempted to put multi-part key string into AugmentedSoyMapData. Please ensure that" +
          " all of your 'param' commands only use top-level keys.");
    }
    super.putSingle(keyStr, value);
  }
View Full Code Here


  @Deprecated
  public UndefinedData() {}


  @Override public String toString() {
    throw new SoyDataException("Attempted to coerce undefined value into a string.");
  }
View Full Code Here

   */
  public void put(Object... data) {

    // TODO: Perhaps change to only convert varargs to Map, and do put(Map) elsewhere.
    if (data.length % 2 != 0) {
      throw new SoyDataException(
          "Varargs to put(...) must have an even number of arguments (key-value pairs).");
    }
    for (int i = 0; i < data.length; i += 2) {
      try {
        put((String) data[i], SoyData.createFromExistingData(data[i + 1]));
      } catch (ClassCastException cce) {
        throw new SoyDataException(
            "Attempting to add a mapping containing a non-string key (key type " +
            data[i].getClass().getName() + ").");
      }
    }
  }
View Full Code Here

    CollectionData collectionData = this;
    for (int i = 0; i <= numKeys - 2; ++i) {

      SoyData nextSoyData = collectionData.getSingle(keys.get(i));
      if (nextSoyData != null && !(nextSoyData instanceof CollectionData)) {
        throw new SoyDataException(
            "Failed to evaluate key string \"" + keyStr + "\" for put().");
      }
      CollectionData nextCollectionData = (CollectionData) nextSoyData;

      if (nextCollectionData == null) {
View Full Code Here

TOP

Related Classes of com.google.template.soy.data.SoyDataException

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.