Package org.apache.cayenne.map

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


    }

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

    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

  }

  /** Loads and returns DataMap based on <code>map</code> attribute. */
  protected DataMap loadDataMap() throws Exception {
    final InputSource in = new InputSource(map.getCanonicalPath());
    return new MapLoader().loadDataMap(in);
  }
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

        // TODO: andrus 11.27.2009 - deprecate MapLoader and implement a loader
        // here. MapLoader is in the wrong place, exposes ContentHandler methods and
        // implements if/else contextless matching of tags... should use something like
        // SAXNestedTagHandler instead.
        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

            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

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.