Package org.apache.shindig.gadgets.preload

Examples of org.apache.shindig.gadgets.preload.PreloadedData


    // implementing equals.

    Preloads preloads = new Preloads() {

      public PreloadedData getData(final String key) {
        return new PreloadedData() {
          public Object toJson() {
            return preloadData.get(key);
          }
        };
      }
View Full Code Here


    final Collection<Object> someData = ImmutableList.of("string", (Object) 99, 4343434.345345d);

    // Other types are supported (anything valid for org.json.JSONObject), but equality comparisons
    // are more complicated because JSON doesn't implement interfaces like Collection or Map, or
    // implementing equals.
    PreloadedData preloadedData = new PreloadedData() {
      public Collection<Object> toJson() {
        return someData;
      }
    };
    Gadget gadget = makeDefaultGadget().setPreloads(ImmutableList.of(preloadedData));
View Full Code Here

    }
  }

  @Test
  public void failedPreloadHandledGracefully() throws Exception {
    PreloadedData preloadedData = new PreloadedData() {
      public Collection<Object> toJson() throws PreloadException {
        throw new PreloadException("test");
      }
    };
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.preload.PreloadedData

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.