mirror of https://github.com/apache/archiva.git
add for loop
This commit is contained in:
parent
ef3ac5c1ee
commit
90c5e0eb20
|
@ -34,7 +34,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Olivier Lamy
|
* @author Olivier Lamy
|
||||||
|
@ -71,17 +70,13 @@ public class RestDocsServlet
|
||||||
|
|
||||||
Elements links = body.select( "a[href]" );
|
Elements links = body.select( "a[href]" );
|
||||||
|
|
||||||
for ( Iterator<Element> elementIterator = links.iterator(); elementIterator.hasNext(); )
|
for ( Element link : links ) {
|
||||||
{
|
|
||||||
Element link = elementIterator.next();
|
|
||||||
link.attr( "href", "#" + startPath + "/" + link.attr( "href" ) );
|
link.attr( "href", "#" + startPath + "/" + link.attr( "href" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Elements codes = body.select( "code" );
|
Elements codes = body.select( "code" );
|
||||||
|
|
||||||
for ( Iterator<Element> elementIterator = codes.iterator(); elementIterator.hasNext(); )
|
for ( Element code : codes ) {
|
||||||
{
|
|
||||||
Element code = elementIterator.next();
|
|
||||||
code.attr( "class", code.attr( "class" ) + " nice-code" );
|
code.attr( "class", code.attr( "class" ) + " nice-code" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,25 +84,19 @@ public class RestDocsServlet
|
||||||
|
|
||||||
Elements headers = body.select( "h1" );
|
Elements headers = body.select( "h1" );
|
||||||
|
|
||||||
for ( Iterator<Element> elementIterator = headers.iterator(); elementIterator.hasNext(); )
|
for ( Element header : headers ) {
|
||||||
{
|
|
||||||
Element header = elementIterator.next();
|
|
||||||
header.tagName( "h3" );
|
header.tagName( "h3" );
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = body.select( "h2" );
|
headers = body.select( "h2" );
|
||||||
|
|
||||||
for ( Iterator<Element> elementIterator = headers.iterator(); elementIterator.hasNext(); )
|
for ( Element header : headers ) {
|
||||||
{
|
|
||||||
Element header = elementIterator.next();
|
|
||||||
header.tagName( "h4" );
|
header.tagName( "h4" );
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = body.select( "h3" );
|
headers = body.select( "h3" );
|
||||||
|
|
||||||
for ( Iterator<Element> elementIterator = headers.iterator(); elementIterator.hasNext(); )
|
for ( Element header : headers ) {
|
||||||
{
|
|
||||||
Element header = elementIterator.next();
|
|
||||||
header.tagName( "h5" );
|
header.tagName( "h5" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue