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:
for usage scenarios
-
-
Field Summary
Fields Modifier and Type Field Description static org.eclipse.core.runtime.IProgressMonitor
NPM
-
Constructor Summary
Constructors Constructor Description AbstractExportProjectProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.core.runtime.IStatus
fail(String message)
Produces an error in the applicationprotected String[]
getApplicationArguments()
List<String>
getParameters(String option)
List<String>
getParameters(String option, int expected)
Returns a list of strings representing the parameters to the specified option.protected Map<String,List<String>>
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 mapString
getSingleString(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
isPresent(String option)
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
-
-
-
-
Method Detail
-
getApplicationArguments
protected String[] getApplicationArguments()
- Returns:
- the application arguments
-
setApplicationArguments
public void setApplicationArguments(String[] arguments)
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
protected Map<String,List<String>> 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
public String getSingleString(String option) throws org.eclipse.core.runtime.CoreException
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
public List<String> getParameters(String option)
- Parameters:
option
-- Returns:
- the list of parameters given with this option
-
isPresent
public boolean isPresent(String option)
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
-
-