org.apache.jmeter.protocol.http.parser

## Class HtmlParsingUtils

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

-     public final class HtmlParsingUtils
      extends java.lang.Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.w3c.dom.Document` | `createEmptyDoc()`
    `static HTTPSamplerBase` | `createUrlFromAnchor(java.lang.String parsedUrlString, java.net.URL context)` Create a new Sampler based on an HREF string plus a contextual URL object.
    `static java.util.List<HTTPSamplerBase>` | `createURLFromForm(org.w3c.dom.Node doc, java.net.URL context)`
    `static void` | `extractStyleURLs(java.net.URL baseUrl, URLCollection urls, java.lang.String styleTagStr)`
    `static org.w3c.dom.Node` | `getDOM(java.lang.String text)` Returns a node representing a whole xml given an xml document.
    `static org.w3c.tidy.Tidy` | `getParser()` Returns `tidy` as HTML parser.
    `static boolean` | `isAnchorMatched(HTTPSamplerBase newLink, HTTPSamplerBase config)` Check if anchor matches by checking against: - protocol - domain - path - parameter names
    `static boolean` | `isArgumentMatched(Argument arg, Argument patternArg)` Arguments match if the input name matches the corresponding pattern name and the input value matches the pattern value, where the matching is done first using String equals, and then Regular Expression matching if the equals test fails.
    `static boolean` | `isEqualOrMatches(java.lang.String arg, java.lang.String pat)` Match the input argument against the pattern using String.equals() or pattern matching if that fails using case-insensitive matching.
    `static boolean` | `isEqualOrMatches(java.lang.String arg, java.lang.String pat, org.apache.oro.text.regex.Perl5Matcher matcher, org.apache.oro.text.PatternCacheLRU cache)` Match the input argument against the pattern using String.equals() or pattern matching if that fails.
    `static boolean` | `isEqualOrMatchesCaseBlind(java.lang.String arg, java.lang.String pat)` Match the input argument against the pattern using String.equals() or pattern matching if that fails using case-insensitive matching.
    `static boolean` | `isEqualOrMatchesCaseBlind(java.lang.String arg, java.lang.String pat, org.apache.oro.text.regex.Perl5Matcher matcher, org.apache.oro.text.PatternCacheLRU cache)` Match the input argument against the pattern using String.equals() or pattern matching if that fails using case-insensitive matching.

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

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

- - ### Method Detail

    - #### isAnchorMatched

          public static boolean isAnchorMatched(HTTPSamplerBase newLink,
                                                HTTPSamplerBase config)

      Check if anchor matches by checking against: - protocol - domain - path - parameter names
      Parameters:
        `newLink` - target to match
        `config` - pattern to match against
      Returns:
        true if target URL matches pattern URL

    - #### isArgumentMatched

          public static boolean isArgumentMatched(Argument arg,
                                                  Argument patternArg)

      Arguments match if the input name matches the corresponding pattern name and the input value matches the pattern value, where the matching is done first using String equals, and then Regular Expression matching if the equals test fails.
      Parameters:
        `arg` - - input Argument
        `patternArg` - - pattern to match against
      Returns:
        true if both name and value match

    - #### isEqualOrMatches

          public static boolean isEqualOrMatches(java.lang.String arg,
                                                 java.lang.String pat,
                                                 org.apache.oro.text.regex.Perl5Matcher matcher,
                                                 org.apache.oro.text.PatternCacheLRU cache)

      Match the input argument against the pattern using String.equals() or pattern matching if that fails.
      Parameters:
        `arg` - input string
        `pat` - pattern string
        `matcher` - Perl5Matcher
        `cache` - PatternCache
      Returns:
        true if input matches the pattern

    - #### isEqualOrMatchesCaseBlind

          public static boolean isEqualOrMatchesCaseBlind(java.lang.String arg,
                                                          java.lang.String pat,
                                                          org.apache.oro.text.regex.Perl5Matcher matcher,
                                                          org.apache.oro.text.PatternCacheLRU cache)

      Match the input argument against the pattern using String.equals() or pattern matching if that fails using case-insensitive matching.
      Parameters:
        `arg` - input string
        `pat` - pattern string
        `matcher` - Perl5Matcher
        `cache` - PatternCache
      Returns:
        true if input matches the pattern

    - #### isEqualOrMatches

          public static boolean isEqualOrMatches(java.lang.String arg,
                                                 java.lang.String pat)

      Match the input argument against the pattern using String.equals() or pattern matching if that fails using case-insensitive matching.
      Parameters:
        `arg` - input string
        `pat` - pattern string
      Returns:
        true if input matches the pattern

    - #### isEqualOrMatchesCaseBlind

          public static boolean isEqualOrMatchesCaseBlind(java.lang.String arg,
                                                          java.lang.String pat)

      Match the input argument against the pattern using String.equals() or pattern matching if that fails using case-insensitive matching.
      Parameters:
        `arg` - input string
        `pat` - pattern string
      Returns:
        true if input matches the pattern

    - #### getParser

          public static org.w3c.tidy.Tidy getParser()

      Returns `tidy` as HTML parser.
      Returns:
        a `tidy` HTML parser

    - #### getDOM

          public static org.w3c.dom.Node getDOM(java.lang.String text)

      Returns a node representing a whole xml given an xml document.
      Parameters:
        `text` - an xml document
      Returns:
        a node representing a whole xml

    - #### createEmptyDoc

          public static org.w3c.dom.Document createEmptyDoc()

    - #### createUrlFromAnchor

          public static HTTPSamplerBase createUrlFromAnchor(java.lang.String parsedUrlString,
                                                            java.net.URL context)
                                                     throws java.net.MalformedURLException

      Create a new Sampler based on an HREF string plus a contextual URL object. Given that an HREF string might be of three possible forms, some processing is required.
      Parameters:
        `parsedUrlString` - the url from the href
        `context` - the context in which the href was found. This is used to extract url information that might be missing in `parsedUrlString`
      Returns:
        sampler with filled in information about the fully parsed url
      Throws:
        `java.net.MalformedURLException` - when the given url (`parsedUrlString` plus `context` is malformed)

    - #### createURLFromForm

          public static java.util.List<HTTPSamplerBase> createURLFromForm(org.w3c.dom.Node doc,
                                                                          java.net.URL context)

    - #### extractStyleURLs

          public static void extractStyleURLs(java.net.URL baseUrl,
                                              URLCollection urls,
                                              java.lang.String styleTagStr)

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