}
private void assembleBodyInheritance( final String name, final DecorationModel child, final DecorationModel parent,
final URLContainer urlContainer )
{
Body cBody = child.getBody();
Body pBody = parent.getBody();
if ( cBody != null || pBody != null )
{
if ( cBody == null )
{
cBody = new Body();
child.setBody( cBody );
}
if ( pBody == null )
{
pBody = new Body();
}
if ( cBody.getHead() == null )
{
cBody.setHead( pBody.getHead() );
}
else
{
cBody.setHead( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) cBody.getHead(), (Xpp3Dom) pBody.getHead() ) );
}
cBody.setLinks( mergeLinkItemLists( cBody.getLinks(), pBody.getLinks(), urlContainer, false ) );
if ( cBody.getBreadcrumbs().isEmpty() && !pBody.getBreadcrumbs().isEmpty() )
{
LinkItem breadcrumb = new LinkItem();
breadcrumb.setName( name );
breadcrumb.setHref( "" );
cBody.getBreadcrumbs().add( breadcrumb );
}
cBody.setBreadcrumbs( mergeLinkItemLists( cBody.getBreadcrumbs(), pBody.getBreadcrumbs(), urlContainer,
true ) );
cBody.setMenus( mergeMenus( cBody.getMenus(), pBody.getMenus(), urlContainer ) );
if ( cBody.getFooter() == null && pBody.getFooter() != null )
{
cBody.setFooter( pBody.getFooter() );
}
}
}