
org.ow2.mind.cli.SrcPathOptionHandler Maven / Gradle / Ivy
The newest version!
/**
* Copyright (C) 2010 STMicroelectronics
*
* This file is part of "Mind Compiler" is free software: you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
* Contact: [email protected]
*
* Authors: Matthieu Leclercq
* Contributors:
*/
package org.ow2.mind.cli;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.ow2.mind.plugin.util.Assert;
/**
* This Handler parses the "src-path" option, creates a corresponding
* classloader and register it in the context.
*/
public class SrcPathOptionHandler implements CommandOptionHandler {
/** The ID of the "src-path" option. */
public static final String SRC_PATH_ID = "org.ow2.mind.mindc.SrcPath";
private static final String CLASSLOADER_CONTEXT_KEY = "classloader";
/**
* Returns the source class loader that has been registered in the given
* context.
*
* @param context the current context.
* @return the source class loader
*/
public static ClassLoader getSourceClassLoader(
final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy