Class AbstractExportProjectProvider
java.lang.Object
org.eclipse.cdt.core.index.export.AbstractExportProjectProvider
- All Implemented Interfaces:
IExportProjectProvider
- Direct Known Subclasses:
ExternalExportProjectProvider
public abstract class AbstractExportProjectProvider
extends Object
implements IExportProjectProvider
An IExportProjectProvider implementation intended to be sub-classed by clients. It
provides convenience methods for obtaining options and their parameters from the
command-line.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.core.runtime.IStatus
Produces an error in the applicationprotected String[]
getParameters
(String option) getParameters
(String option, int expected) Returns a list of strings representing the parameters to the specified option.Returns a mapping from string option to parameter string list
For example, if -option p1 p2 p3 appears on the command line, then the mapping option=>[p1,p2,p3] will be present in the mapgetSingleString
(String option) Gets an option's single parameter, or throws a CoreException should the option not be present, or if it does not have exactly one parameterboolean
Returns whether the specified option appears in the application argumentsvoid
setApplicationArguments
(String[] arguments) This method will be called by the export framework before any other method in this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.cdt.core.index.export.IExportProjectProvider
createProject, getExportProperties, getLocationConverter
-
Field Details
-
NPM
public static final org.eclipse.core.runtime.IProgressMonitor NPM
-
-
Constructor Details
-
AbstractExportProjectProvider
public AbstractExportProjectProvider()
-
-
Method Details
-
getApplicationArguments
- Returns:
- the application arguments
-
setApplicationArguments
Description copied from interface:IExportProjectProvider
This method will be called by the export framework before any other method in this class. It passes the application argument received by the export application- Specified by:
setApplicationArguments
in interfaceIExportProjectProvider
- Parameters:
arguments
- the application arguments- See Also:
-
Platform.getApplicationArgs()
-
getParsedArgs
Returns a mapping from string option to parameter string list
For example, if -option p1 p2 p3 appears on the command line, then the mapping option=>[p1,p2,p3] will be present in the map- Returns:
- a mapping from string option to parameter string list
-
getSingleString
Gets an option's single parameter, or throws a CoreException should the option not be present, or if it does not have exactly one parameter- Parameters:
option
-- Returns:
- an option's single parameter
- Throws:
org.eclipse.core.runtime.CoreException
- should the specified option not be present, or if it does not have exactly one parameter
-
getParameters
- Parameters:
option
-- Returns:
- the list of parameters given with this option
-
isPresent
Returns whether the specified option appears in the application arguments- Parameters:
option
- the option to check for- Returns:
- whether the specified option appears in the application arguments
-
getParameters
public List<String> getParameters(String option, int expected) throws org.eclipse.core.runtime.CoreException Returns a list of strings representing the parameters to the specified option. If the number of parameters does not match the expected number, an command-line error message is shown to the user.- Parameters:
option
-expected
- the number of parameters expected- Throws:
org.eclipse.core.runtime.CoreException
-
fail
public org.eclipse.core.runtime.IStatus fail(String message) throws org.eclipse.core.runtime.CoreException Produces an error in the application- Parameters:
message
- an error message suitable for the user- Returns:
- does not return
- Throws:
org.eclipse.core.runtime.CoreException
- Throws a CoreException with an ERROR status
-