/**
* @return application
* @see com.sun.jersey.server.wadl.WadlGenerator#createApplication()
*/
public Application createApplication() {
final Application result = _delegate.createApplication();
if ( result.getGrammars() != null ) {
LOG.info( "The wadl application created by the delegate ("+ _delegate +") already contains a grammars element," +
" we're adding elements of the provided grammars file." );
if ( !_grammars.getAny().isEmpty() ) {
result.getGrammars().getAny().addAll( _grammars.getAny() );
}
if ( !_grammars.getDoc().isEmpty() ) {
result.getGrammars().getDoc().addAll( _grammars.getDoc() );
}
if ( !_grammars.getInclude().isEmpty() ) {
result.getGrammars().getInclude().addAll( _grammars.getInclude() );
}
}
else {
result.setGrammars( _grammars );
}
return result;
}