Class ProjectionCLI
- java.lang.Object
-
- org.openstreetmap.josm.data.projection.ProjectionCLI
-
- All Implemented Interfaces:
CLIModule
public class ProjectionCLI extends Object implements CLIModule
Command line interface for projecting coordinates.- Since:
- 12792
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
argInverse
private boolean
argSwitchInput
private boolean
argSwitchOutput
static ProjectionCLI
INSTANCE
The unique instance
-
Constructor Summary
Constructors Constructor Description ProjectionCLI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static CustomProjection
createProjection(String params)
String
getActionKeyword()
Get the action keyword that the user needs to provide as first command line argument to invoke this module.private static String
getHelp()
static void
main(String[] args)
Main class to run just the projection CLI.private static double
parseDouble(String s)
private EastNorth
parseEastNorth(String s, ToDoubleFunction<String> parser)
void
processArguments(String[] argArray)
Process the remaining command line arguments and run any of the requested actions.private void
processInput(CustomProjection fromProj, CustomProjection toProj, BufferedReader reader)
private void
run(String fromStr, String toStr, List<String> files)
private static void
showHelp()
Displays help on the console
-
-
-
Field Detail
-
INSTANCE
public static final ProjectionCLI INSTANCE
The unique instance
-
argInverse
private boolean argInverse
-
argSwitchInput
private boolean argSwitchInput
-
argSwitchOutput
private boolean argSwitchOutput
-
-
Constructor Detail
-
ProjectionCLI
public ProjectionCLI()
-
-
Method Detail
-
getActionKeyword
public String getActionKeyword()
Description copied from interface:CLIModule
Get the action keyword that the user needs to provide as first command line argument to invoke this module.- Specified by:
getActionKeyword
in interfaceCLIModule
- Returns:
- the action keyword of this module
-
processArguments
public void processArguments(String[] argArray)
Description copied from interface:CLIModule
Process the remaining command line arguments and run any of the requested actions.- Specified by:
processArguments
in interfaceCLIModule
- Parameters:
argArray
- command line arguments without the initial action keyword
-
showHelp
private static void showHelp()
Displays help on the console
-
run
private void run(String fromStr, String toStr, List<String> files) throws ProjectionConfigurationException, IOException
-
processInput
private void processInput(CustomProjection fromProj, CustomProjection toProj, BufferedReader reader) throws IOException
- Throws:
IOException
-
createProjection
private static CustomProjection createProjection(String params) throws ProjectionConfigurationException
- Throws:
ProjectionConfigurationException
-
parseEastNorth
private EastNorth parseEastNorth(String s, ToDoubleFunction<String> parser)
-
parseDouble
private static double parseDouble(String s)
-
-