Examples of MapLoader


Examples of org.apache.cayenne.map.MapLoader

        for (int i = 0; i < maps.length; i++) {
            InputStream stream = getClass().getClassLoader().getResourceAsStream(
                    DATA_MAPS_REQUIREING_SCHEMA_SETUP[i]);
            InputSource in = new InputSource(stream);
            in.setSystemId(DATA_MAPS_REQUIREING_SCHEMA_SETUP[i]);
            maps[i] = new MapLoader().loadDataMap(in);
        }

        this.domain = new DataDomain("temp");
        domain.setEventManager(new DefaultEventManager(2));
        domain.setEntitySorter(new AshwoodEntitySorter());
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

        StringWriter out = new StringWriter();
        PrintWriter outWriter = new PrintWriter(out);
        originalMap.encodeAsXML(outWriter);
        outWriter.flush();
        StringReader in = new StringReader(out.toString());
        map = new MapLoader().loadDataMap(new InputSource(in));
       
        // map must operate in an EntityResolve namespace...
        EntityResolver testResolver = new EntityResolver();
        testResolver.addDataMap(map);
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

    protected MapLoader getMapLoader() {
        // it is worth caching the map loader, as it precompiles some XML operations
        // starting from release 3.0
        if (mapLoader == null) {
            mapLoader = new MapLoader();
        }

        return mapLoader;
    }
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

    private File[] additionalDataMapFiles;
    private DataMap mainDataMap;

    DataMap getMainDataMap() throws MalformedURLException {
        if (mainDataMap == null) {
            MapLoader mapLoader = new MapLoader();

            DataMap mainDataMap = loadDataMap(mapLoader, mainDataMapFile);

            if (additionalDataMapFiles != null) {
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

    }

        /** Loads and returns DataMap based on <code>map</code> attribute. */
    protected DataMap loadDataMap() throws Exception {
        InputSource in = new InputSource(map.getCanonicalPath());
        return new MapLoader().loadDataMap(in);
    }
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

        for (int i = 0; i < maps.length; i++) {
            InputStream stream = getClass().getClassLoader().getResourceAsStream(
                    DATA_MAPS_REQUIREING_SCHEMA_SETUP[i]);
            InputSource in = new InputSource(stream);
            in.setSystemId(DATA_MAPS_REQUIREING_SCHEMA_SETUP[i]);
            maps[i] = new MapLoader().loadDataMap(in);
        }

        this.domain = new DataDomain("temp");
        domain.setEventManager(new DefaultEventManager(2));
        domain.setEntitySorter(new AshwoodEntitySorter());
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

    private static Log logger = LogFactory.getLog(XMLDataMapLoader.class);

    public DataMap load(Resource configurationResource) throws CayenneRuntimeException {

        MapLoader mapLoader = new MapLoader();
        URL url = configurationResource.getURL();

        InputStream in = null;

        DataMap map;

        try {
            in = url.openStream();

            map = mapLoader.loadDataMap(new InputSource(in));
        }
        catch (Exception e) {
            throw new CayenneRuntimeException(
                    "Error loading configuration from %s",
                    e,
View Full Code Here

Examples of org.nutz.ioc.loader.map.MapLoader

  static Ioc2 I(String... ss) {
    String json = "{";
    json += Lang.concat(',', ss);
    json += "}";
    return new NutIoc(new MapLoader(json));
  }
View Full Code Here

Examples of org.nutz.ioc.loader.map.MapLoader

    s += "b:{type:'org.nutz.ioc.json.RecurReferJsonIocTest$RB',";
    s += "fields:{nm:'B', ra:{refer:'a'}}";
    s += "}";
    s += "}";

    Ioc ioc = new NutIoc(new MapLoader(s));
    RA a = ioc.get(RA.class, "a");
    assertEquals("A", a.nm);
    assertEquals("B", a.rb.nm);

    RB b = ioc.get(RB.class, "b");
View Full Code Here

Examples of org.nutz.ioc.loader.map.MapLoader

public class IocCustomizedValueTypeTest {

  @Test
  public void test_simple_customized() {
    String json = "{xb:{name:{cc:'XiaoBai'}}}";
    Ioc2 ioc = new NutIoc(new MapLoader(json));
    ioc.addValueProxyMaker(new ValueProxyMaker() {
      public ValueProxy make(IocMaking ing, IocValue iv) {
        if ("cc".equalsIgnoreCase(iv.getType())) {
          return new StaticValue("CC:" + iv.getValue());
        }
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.