Examples of MapLoader


Examples of org.apache.cayenne.map.MapLoader

public class CAY_236Test extends BasicCase {

    private static final String TABLE1_BY = "\u0442\u0430\u0431\u043bi\u0446\u04301";

    public void testLoadUTF8() throws Exception {
        MapLoader loader = new MapLoader();

        // the idea here is to avoid passing the reader to the loader, and make sure the
        // loader does the right thing (i.e. loads UTF-8 encoded file) itself.
        DataMap map = loader.loadDataMap("i18n/by/DataMap.map.xml");
        assertNotNull(map.getDbEntity(TABLE1_BY));
    }
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

        DataMap map = loader.loadDataMap("i18n/by/DataMap.map.xml");
        assertNotNull(map.getDbEntity(TABLE1_BY));
    }

    public void testStoreUTF8() throws Exception {
        MapLoader loader = new MapLoader();

        // the idea here is to avoid passing the reader to the loader, and make sure the
        // loader does the right thing (i.e. loads UTF-8 encoded file) itself.
        DataMap map = loader.loadDataMap("i18n/by/DataMap.map.xml");

        File mapFile = new File(getTestDir(), "CAY_236Map.map.xml");
        TestProjectFile file = new TestProjectFile(map, "DataMap", mapFile);
        file.saveTemp();
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

     */
    protected void postInitialize(File projectFile) {
        if (projectFile != null) {
            try {
                InputStream in = new FileInputStream(projectFile.getCanonicalFile());
                map = new MapLoader().loadDataMap(new InputSource(in));

                String fileName = resolveSymbolicName(projectFile);
                logObj.error("resolving: " + projectFile + " to " + fileName);
                String mapName = (fileName != null && fileName
                        .endsWith(DataMapFile.LOCATION_SUFFIX))
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

            getStatus().addFailedMap(mapName, location, "map location not found");
            return null;
        }

        try {
            DataMap map = new MapLoader().loadDataMap(new InputSource(mapIn));

            logObj.info("loaded <map name='"
                    + mapName
                    + "' location='"
                    + location
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

   
    /** Loads and returns a DataMap by File. */
    public DataMap loadDataMap(File mapName) throws Exception {
        InputSource in = new InputSource(mapName.toURL().toString());
        if(mapLoader == null) {
            mapLoader = new MapLoader();
        }
        return mapLoader.loadDataMap(in);
    }
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

     */
    protected void postInitialize(File projectFile) {
        if (projectFile != null) {
            try {
                InputStream in = new FileInputStream(projectFile.getCanonicalFile());
                map = new MapLoader().loadDataMap(new InputSource(in));

                String fileName = resolveSymbolicName(projectFile);
                String mapName = (fileName != null && fileName
                        .endsWith(DataMapFile.LOCATION_SUFFIX))
                        ? fileName.substring(0, fileName.length()
View Full Code Here

Examples of org.apache.cayenne.map.MapLoader

    }

    /** Loads and returns a DataMap by File. */
    protected DataMap loadDataMap(File mapName) throws Exception {
        InputSource in = new InputSource(mapName.getCanonicalPath());
        return new MapLoader().loadDataMap(in);
    }
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
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.