ParseCurlCommandAction (Apache JMeter dist API)
Description: declaration: package: org.apache.jmeter.protocol.http.gui.action, class: ParseCurlCommandAction

Package org.apache.jmeter.protocol.http.gui.action

# Class ParseCurlCommandAction

java.lang.Object
org.apache.jmeter.gui.action.AbstractAction
org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction

All Implemented Interfaces:
  `ActionListener`, `EventListener`, `Command`, `MenuCreator`

@AutoService({Command.class,MenuCreator.class}) public class ParseCurlCommandAction extends AbstractAction implements MenuCreator, ActionListener
Opens a popup where user can enter a cURL command line and create a test plan from it

Since:
  5.1

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.jmeter.gui.plugin.MenuCreator

  `MenuCreator.MENU_LOCATION`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `IMPORT_CURL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParseCurlCommandAction()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `actionPerformed(ActionEvent e)`
  `String`
  `createCommentText(BasicCurlParser.Request request)`
  `void`
  `doAction(ActionEvent e)`
  `Set<String>`
  `getActionNames()`
  `JMenuItem[]`
  `getMenuItemsAtLocation(MenuCreator.MENU_LOCATION location)`
  MenuItems to be added in location menu
  `JMenu[]`
  `getTopLevelMenus()`
  `void`
  `localeChanged()`
  Update Top Level menu on Locale Change
  `boolean`
  `localeChanged(MenuElement menu)`
  `List<BasicCurlParser.Request>`
  `parseCommands(boolean isReadFromFile, List<String> commandsList)`
  `List<String>`
  `readFromFile(String pathname)`
  `List<String>`
  `readFromTextPanel(String commands)`

  ### Methods inherited from class org.apache.jmeter.gui.action.AbstractAction

  `getParentFrame, popupCheckExistingFileListener, popupShouldSave`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### IMPORT_CURL

    public static final String IMPORT_CURL
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ParseCurlCommandAction

    public ParseCurlCommandAction()

- ## Method Details

  - ### doAction

    public void doAction(ActionEvent e)
    Specified by:
      `doAction` in interface `Command`
    Overrides:
      `doAction` in class `AbstractAction`
    See Also:
      - `Command.doAction(ActionEvent)`

  - ### getMenuItemsAtLocation

    public JMenuItem[] getMenuItemsAtLocation(MenuCreator.MENU_LOCATION location)
    Description copied from interface: `MenuCreator`
    MenuItems to be added in location menu
    Specified by:
      `getMenuItemsAtLocation` in interface `MenuCreator`
    Parameters:
      `location` - in top menu
    Returns:
      array of `JMenuItem`

  - ### actionPerformed

    public void actionPerformed(ActionEvent e)
    Specified by:
      `actionPerformed` in interface `ActionListener`

  - ### parseCommands

    public List<BasicCurlParser.Request> parseCommands(boolean isReadFromFile, List<String> commandsList)

  - ### getActionNames

    public Set<String> getActionNames()
    Specified by:
      `getActionNames` in interface `Command`

  - ### getTopLevelMenus

    public JMenu[] getTopLevelMenus()
    Specified by:
      `getTopLevelMenus` in interface `MenuCreator`
    Returns:
      array of JMenu to be put as top level menu between Options and Help

  - ### localeChanged

    public boolean localeChanged(MenuElement menu)
    Specified by:
      `localeChanged` in interface `MenuCreator`
    Parameters:
      `menu` - MenuElement
    Returns:
      true if menu was concerned by Locale change

  - ### localeChanged

    public void localeChanged()
    Description copied from interface: `MenuCreator`
    Update Top Level menu on Locale Change
    Specified by:
      `localeChanged` in interface `MenuCreator`

  - ### readFromFile

    public List<String> readFromFile(String pathname) throws IOException
    Throws:
      `IOException`

  - ### readFromTextPanel

    public List<String> readFromTextPanel(String commands)

  - ### createCommentText

    public String createCommentText(BasicCurlParser.Request request)