Package net.sf.saxon.pattern

## Class UnionQNameTest

- java.lang.Object
- - net.sf.saxon.pattern.UnionQNameTest

- All Implemented Interfaces:
    `QNameTest`

      public class UnionQNameTest
      extends java.lang.Object
      implements QNameTest

  A QNameTest that is the union of a number of supplied QNameTests

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `UnionQNameTest​(java.util.List<QNameTest> tests)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `exportQNameTest()` | Export the QNameTest as a string for use in a SEF file (typically in a catch clause).
    `java.lang.String` | `generateJavaScriptNameTest​(int targetVersion)` | Generate Javascript code to test if a name matches the test.
    `boolean` | `matches​(StructuredQName qname)` | Test whether the QNameTest matches a given QName
    `java.lang.String` | `toString()` | The toString() method defines the format used in a package export, so it must be re-parseable

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

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

- - ### Constructor Detail

    - #### UnionQNameTest

          public UnionQNameTest​(java.util.List<QNameTest> tests)

  - ### Method Detail

    - #### matches

          public boolean matches​(StructuredQName qname)

      Test whether the QNameTest matches a given QName
      Specified by:
        `matches` in interface `QNameTest`
      Parameters:
        `qname` - the QName to be matched
      Returns:
        true if the name matches, false if not

    - #### toString

          public java.lang.String toString()

      The toString() method defines the format used in a package export, so it must be re-parseable
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation: the individual qname tests, separated by vertical bar

    - #### exportQNameTest

          public java.lang.String exportQNameTest()

      Export the QNameTest as a string for use in a SEF file (typically in a catch clause).
      Specified by:
        `exportQNameTest` in interface `QNameTest`
      Returns:
        a string representation of the QNameTest, suitable for use in export files. The format is a sequence of alternatives separated by vertical bars, where each alternative is one of '*', '*:localname', 'Q{uri}*', or 'Q{uri}local'.

    - #### generateJavaScriptNameTest

          public java.lang.String generateJavaScriptNameTest​(int targetVersion)

      Generate Javascript code to test if a name matches the test.
      Specified by:
        `generateJavaScriptNameTest` in interface `QNameTest`
      Parameters:
        `targetVersion` - the version of Saxon-JS being targeted
      Returns:
        JS code as a string. The generated code will be used as the body of a JS function in which the argument name "q" is an XdmQName object holding the name. The XdmQName object has properties uri and local.