/** * Method addMenu. * * @param menu */ public void addMenu( Menu menu ) { getMenus().add( menu ); } //-- void addMenu( Menu )
/** * Method removeMenu. * * @param menu */ public void removeMenu( Menu menu ) { getMenus().remove( menu ); } //-- void removeMenu( Menu )
/** * @param key not null */ public void removeMenuRef( String key ) { if ( body != null ) { for ( java.util.Iterator<Menu> i = body.getMenus().iterator(); i.hasNext(); ) { Menu menu = i.next(); if ( key.equals( menu.getRef() ) ) { i.remove(); } } } }
/** * Method toString. * * @return String */ public java.lang.String toString() { StringBuilder buf = new StringBuilder( 128 ); buf.append( "head = '" ); buf.append( getHead() ); buf.append( "'" ); buf.append( "\n" ); buf.append( "links = '" ); buf.append( getLinks() ); buf.append( "'" ); buf.append( "\n" ); buf.append( "breadcrumbs = '" ); buf.append( getBreadcrumbs() ); buf.append( "'" ); buf.append( "\n" ); buf.append( "menus = '" ); buf.append( getMenus() ); buf.append( "'" ); buf.append( "\n" ); buf.append( "footer = '" ); buf.append( getFooter() ); buf.append( "'" ); return buf.toString(); } //-- java.lang.String toString()
/** * @param key not null * @return the menu ref defined by the given key. */ public Menu getMenuRef( String key ) { if ( menusByRef == null ) { menusByRef = new java.util.HashMap<String, Menu>(); if ( body != null ) { for ( Menu menu : body.getMenus() ) { if ( menu.getRef() != null ) { menusByRef.put( menu.getRef(), menu ); } } } } return menusByRef.get( key ); }
/** * Method equals. * * @param other * @return boolean */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof Body ) ) { return false; } Body that = (Body) other; boolean result = true; result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) ); result = result && ( getLinks() == null ? that.getLinks() == null : getLinks().equals( that.getLinks() ) ); result = result && ( getBreadcrumbs() == null ? that.getBreadcrumbs() == null : getBreadcrumbs().equals( that.getBreadcrumbs() ) ); result = result && ( getMenus() == null ? that.getMenus() == null : getMenus().equals( that.getMenus() ) ); result = result && ( getFooter() == null ? that.getFooter() == null : getFooter().equals( that.getFooter() ) ); return result; } //-- boolean equals( Object )
java.util.List menus = body.getMenus(); if ( menus == null )
for ( Menu menu : decoration.getBody().getMenus() )