if( currentBuilder!=null ) {
Method[] methods = currentBuilder.getMethods();
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
Fluent annotation = method.getAnnotation(Fluent.class);
if( annotation!=null && annotation.callOnElementEnd() ) {
if( method.getParameterTypes().length > 0 ) {
throw new RuntimeException("Only methods with no parameters can annotated with @Fluent(callOnElementEnd=true): "+method);
}