Class ProjectionCLI
- java.lang.Object
-
- org.openstreetmap.josm.data.projection.ProjectionCLI
-
- All Implemented Interfaces:
CLIModule
public class ProjectionCLI extends java.lang.Object implements CLIModule
Command line interface for projecting coordinates.- Since:
- 12792
-
-
Field Summary
Fields Modifier and Type Field Description private booleanargInverseprivate booleanargSwitchInputprivate booleanargSwitchOutputstatic ProjectionCLIINSTANCEThe 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 CustomProjectioncreateProjection(java.lang.String params)java.lang.StringgetActionKeyword()Get the action keyword that the user needs to provide as first command line argument to invoke this module.private static java.lang.StringgetHelp()static voidmain(java.lang.String[] args)Main class to run just the projection CLI.private static doubleparseDouble(java.lang.String s)private EastNorthparseEastNorth(java.lang.String s, java.util.function.ToDoubleFunction<java.lang.String> parser)voidprocessArguments(java.lang.String[] argArray)Process the remaining command line arguments and run any of the requested actions.private voidprocessInput(CustomProjection fromProj, CustomProjection toProj, java.io.BufferedReader reader)private voidrun(java.lang.String fromStr, java.lang.String toStr, java.util.List<java.lang.String> files)private static voidshowHelp()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 java.lang.String getActionKeyword()
Description copied from interface:CLIModuleGet the action keyword that the user needs to provide as first command line argument to invoke this module.- Specified by:
getActionKeywordin interfaceCLIModule- Returns:
- the action keyword of this module
-
processArguments
public void processArguments(java.lang.String[] argArray)
Description copied from interface:CLIModuleProcess the remaining command line arguments and run any of the requested actions.- Specified by:
processArgumentsin interfaceCLIModule- Parameters:
argArray- command line arguments without the initial action keyword
-
showHelp
private static void showHelp()
Displays help on the console
-
getHelp
private static java.lang.String getHelp()
-
run
private void run(java.lang.String fromStr, java.lang.String toStr, java.util.List<java.lang.String> files) throws ProjectionConfigurationException, java.io.IOException
- Throws:
ProjectionConfigurationExceptionjava.io.IOException
-
processInput
private void processInput(CustomProjection fromProj, CustomProjection toProj, java.io.BufferedReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
createProjection
private static CustomProjection createProjection(java.lang.String params) throws ProjectionConfigurationException
- Throws:
ProjectionConfigurationException
-
parseEastNorth
private EastNorth parseEastNorth(java.lang.String s, java.util.function.ToDoubleFunction<java.lang.String> parser)
-
parseDouble
private static double parseDouble(java.lang.String s)
-
main
public static void main(java.lang.String[] args)
Main class to run just the projection CLI.- Parameters:
args- command line arguments
-
-