Class CollectingNameClassPairCallbackHandler<T>

    • Constructor Detail

      • CollectingNameClassPairCallbackHandler

        public CollectingNameClassPairCallbackHandler()
    • Method Detail

      • getList

        public java.util.List<T> getList()
        Get the assembled list.
        Returns:
        the list of all assembled objects.
      • handleNameClassPair

        public final void handleNameClassPair​(javax.naming.NameClassPair nameClassPair)
                                       throws javax.naming.NamingException
        Pass on the supplied NameClassPair to getObjectFromNameClassPair(NameClassPair) and add the result to the internal list.
        Specified by:
        handleNameClassPair in interface NameClassPairCallbackHandler
        Parameters:
        nameClassPair - the NameClassPair returned from the NamingEnumeration.
        Throws:
        javax.naming.NamingException - if an error occurs.
      • getObjectFromNameClassPair

        public abstract T getObjectFromNameClassPair​(javax.naming.NameClassPair nameClassPair)
                                              throws javax.naming.NamingException
        Handle a NameClassPair and transform it to an Object of the desired type and with data from the NameClassPair.
        Parameters:
        nameClassPair - a NameClassPair from a search operation.
        Returns:
        an object constructed from the data in the NameClassPair.
        Throws:
        javax.naming.NamingException - if an error occurs.