org.modeshape.jcr.query.xpath

## Class XPath.NameTest

- java.lang.Object
- - org.modeshape.jcr.query.xpath.XPath.Component
  - - org.modeshape.jcr.query.xpath.XPath.NodeTest
    - - org.modeshape.jcr.query.xpath.XPath.NameTest

- Enclosing class:
    XPath

      public static class XPath.NameTest
      extends XPath.NodeTest

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XPath.NameTest(String prefixTest, String localTest)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `String` | `getLocalTest()`
    `String` | `getPrefixTest()`
    `int` | `hashCode()`
    `boolean` | `isWildcard()` Return whether this represents a wildcard, meaning both `getPrefixTest()` and `getLocalTest()` are null.
    `boolean` | `matches(String prefix, String local)` Determine if this name test exactly matches the supplied prefix and local name values.
    `String` | `toString()`

    - ### Methods inherited from class org.modeshape.jcr.query.xpath.XPath.Component

      `collapse`

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

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

- - ### Constructor Detail

    - #### XPath.NameTest

          public XPath.NameTest(String prefixTest,
                        String localTest)

  - ### Method Detail

    - #### getPrefixTest

          public String getPrefixTest()

      Returns:
        the prefix criteria, or null if the prefix criteria is a wildcard

    - #### getLocalTest

          public String getLocalTest()

      Returns:
        the local name criteria, or null if the local name criteria is a wildcard

    - #### matches

          public boolean matches(String prefix,
                        String local)

      Determine if this name test exactly matches the supplied prefix and local name values.
      Parameters:
        `prefix` - the prefix; may be null
        `local` - the local name; may be null
      Returns:
        true if this name matches the supplied values, or false otherwise.

    - #### isWildcard

          public boolean isWildcard()

      Return whether this represents a wildcard, meaning both `getPrefixTest()` and `getLocalTest()` are null.
      Returns:
        true if this is a wildcard name test.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.