public final void wrap ( final Element root , final String selector , final String wrapper ) { final Iterable < Element > elements ; // Selected elements checkNotNull ( root , "Received a null pointer as root element" ) ; checkNotNull ( selector , "Received a null pointer as selector" ) ; checkNotNull ( wrapper , "Received a null pointer as HTML wrap" ) ; // Selects and iterates over the elements elements = root . select ( selector ) ; for ( final Element element : elements ) { element . wrap ( wrapper ) ; } }
Finds a set of elements through a CSS selector and wraps them with the received wrapper element .