Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.MapLoader$EndClosure


    }

    /** 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


    @Override
    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

    private DataMap dataMap;

    public DataMap getDataMap() {
        if (dataMap == null) {
            MapLoader mapLoader = new MapLoader();
            dataMap = mapLoader.loadDataMap(getMapXml("sus-map.map.xml"));
        }
        return dataMap;
    }
View Full Code Here

        this.location = location;
    }

    public Object getObject() throws Exception {
        if (map == null) {
            map = new MapLoader().loadDataMap(location);
        }

        return map;
    }
View Full Code Here

        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

    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

    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

    }

    /** 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

        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

            return;
        }

        try {
            // configure resource locator to take absolute path
            MapLoader mapLoader = new MapLoader() {

                @Deprecated
                protected ResourceLocator configLocator() {
                    ResourceLocator locator = new ResourceLocator();
                    locator.setSkipAbsolutePath(false);
                    locator.setSkipClasspath(true);
                    locator.setSkipCurrentDirectory(true);
                    locator.setSkipHomeDirectory(true);
                    return locator;
                }
            };

            DataMap newMap = mapLoader.loadDataMap(dataMapFile.getAbsolutePath());
            DataChannelDescriptor domain = (DataChannelDescriptor)getProjectController().getProject().getRootNode();

            if (newMap.getName() != null) {
                newMap.setName(NamedObjectFactory.createName(
                        DataMap.class,
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.MapLoader$EndClosure

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.