Class MapBasedXPathFunctionResolver

    • Constructor Detail

      • MapBasedXPathFunctionResolver

        public MapBasedXPathFunctionResolver()
        Default ctor.
    • Method Detail

      • addUniqueFunction

        @Nonnull
        public com.helger.commons.state.EChange addUniqueFunction​(@Nonnull
                                                                  String sNamespaceURI,
                                                                  @Nonnull
                                                                  String sLocalPart,
                                                                  @Nonnegative
                                                                  int nArity,
                                                                  @Nonnull
                                                                  XPathFunction aFunction)
        Add a new function.
        Parameters:
        sNamespaceURI - The namespace URI of the function
        sLocalPart - The local part of the function
        nArity - The number of parameters of the function
        aFunction - The function to be used. May not be null.
        Returns:
        EChange
      • addUniqueFunction

        @Nonnull
        public com.helger.commons.state.EChange addUniqueFunction​(@Nonnull
                                                                  QName aName,
                                                                  @Nonnegative
                                                                  int nArity,
                                                                  @Nonnull
                                                                  XPathFunction aFunction)
        Add a new function.
        Parameters:
        aName - The qualified name of the function
        nArity - The number of parameters of the function
        aFunction - The function to be used. May not be null.
        Returns:
        EChange
      • addAllFrom

        @Nonnull
        public com.helger.commons.state.EChange addAllFrom​(@Nonnull
                                                           MapBasedXPathFunctionResolver aOther,
                                                           boolean bOverwrite)
        Add all functions from the other function resolver into this resolver.
        Parameters:
        aOther - The function resolver to import the functions from. May not be null.
        bOverwrite - if true existing functions will be overwritten with the new functions, otherwise the old functions are kept.
        Returns:
        EChange
      • removeFunction

        @Nonnull
        public com.helger.commons.state.EChange removeFunction​(@Nonnull
                                                               QName aName,
                                                               @Nonnegative
                                                               int nArity)
        Remove the function with the specified name.
        Parameters:
        aName - The name to be removed. May not be null.
        nArity - The number of parameters of the function. Must be ≥ 0.
        Returns:
        EChange
      • removeFunction

        @Nonnull
        public com.helger.commons.state.EChange removeFunction​(@Nullable
                                                               XPathFunctionKey aKey)
        Remove the function with the specified name.
        Parameters:
        aKey - The function key to be removed. May be null.
        Returns:
        EChange
      • removeFunctionsWithName

        @Nonnull
        public com.helger.commons.state.EChange removeFunctionsWithName​(@Nullable
                                                                        QName aName)
        Remove all functions with the same name. This can be helpful when the same function is registered for multiple parameters.
        Parameters:
        aName - The name to be removed. May be null.
        Returns:
        EChange.CHANGED if at least one function was removed.
      • getAllFunctions

        @Nonnull
        @ReturnsMutableCopy
        public com.helger.commons.collection.impl.ICommonsOrderedMap<XPathFunctionKey,​XPathFunction> getAllFunctions()
        Returns:
        A mutable copy of all contained functions. Never null but maybe empty.
      • getFunctionCount

        @Nonnegative
        public int getFunctionCount()
        Returns:
        The number of contained functions. Always ≥ 0.
      • clear

        @Nonnull
        public com.helger.commons.state.EChange clear()
        Remove all functions at once.
        Returns:
        EChange.CHANGED if at least one function was removed.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object