org.apache.jmeter.protocol.http.parser

## Class BaseParser

- java.lang.Object
- - org.apache.jmeter.protocol.http.parser.BaseParser

- All Implemented Interfaces:
    LinkExtractorParser
  Direct Known Subclasses:
    HTMLParser

      public abstract class BaseParser
      extends Object
      implements LinkExtractorParser

  BaseParser is the base class for `LinkExtractorParser` It is advised to make subclasses reusable across parsing, so `BaseParser` `isReusable()` returns true by default
  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseParser()` Constructor for BaseParser

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LinkExtractorParser` | `getParser(String parserClassName)` Factory method of parsers.
    `boolean` | `isReusable()` Parsers should over-ride this method if the parser class is re-usable, in which case the class will be cached for the next getParser() call.

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

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

    - ### Methods inherited from interface org.apache.jmeter.protocol.http.parser.LinkExtractorParser

      `getEmbeddedResourceURLs`

- - ### Constructor Detail

    - #### BaseParser

          protected BaseParser()

      Constructor for BaseParser

  - ### Method Detail

    - #### getParser

          public static LinkExtractorParser getParser(String parserClassName)
                                               throws LinkExtractorParseException

      Factory method of parsers. Instances might get cached, when `LinkExtractorParser.isReusable()` on the newly created instance equals `true`.
      Parameters:
        `parserClassName` - name of the class that should be used to create new parsers
      Returns:
        a possibly cached instance of the wanted `LinkExtractorParser`
      Throws:
        `LinkExtractorParseException` - when a new instance could not be instantiated

    - #### isReusable

          public boolean isReusable()

      Parsers should over-ride this method if the parser class is re-usable, in which case the class will be cached for the next getParser() call.
      Specified by:
        `isReusable` in interface `LinkExtractorParser`
      Returns:
        `true` if the Parser is reusable

Copyright © 1998-2021 Apache Software Foundation. All Rights Reserved.