Coverage Report - org.mule.tools.visualizer.postprocessors.NodeHiderPostProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
NodeHiderPostProcessor
27%
3/11
10%
1/10
4
 
 1  
 /*
 2  
  * $Id: NodeHiderPostProcessor.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.tools.visualizer.postprocessors;
 12  
 
 13  
 import org.mule.tools.visualizer.components.PostProcessor;
 14  
 import org.mule.tools.visualizer.config.GraphEnvironment;
 15  
 
 16  
 import com.oy.shared.lm.graph.Graph;
 17  
 import com.oy.shared.lm.graph.GraphNode;
 18  
 
 19  4
 public class NodeHiderPostProcessor implements PostProcessor
 20  
 {
 21  
 
 22  
     public void postProcess(Graph graph, GraphEnvironment env)
 23  
     {
 24  4
         if (env.getConfig().getMappings().size() > 0)
 25  
         {
 26  0
             GraphNode[] nodes = graph.getNodes();
 27  0
             for (int i = 0; i < nodes.length; i++)
 28  
             {
 29  0
                 GraphNode node = nodes[i];
 30  0
                 boolean hide = Boolean.valueOf(
 31  
                     env.getConfig().getMappings().getProperty(node.getInfo().getHeader() + ".hide", "false"))
 32  
                     .booleanValue();
 33  
 
 34  0
                 boolean hideWhenCombined = Boolean.valueOf(
 35  
                     env.getConfig().getMappings().getProperty(
 36  
                         node.getInfo().getHeader() + ".hideWhenCombined", "false")).booleanValue();
 37  0
                 if (hide || (env.isDoingCombinedGeneration() && hideWhenCombined))
 38  
                 {
 39  0
                     env.log("Hiding node '" + node.getInfo().getHeader() + "'");
 40  0
                     graph.removeNode(node);
 41  
                 }
 42  
             }
 43  
         }
 44  4
     }
 45  
 
 46  
 }