code: private Stat createStat(final WComponent comp) {
  		Stat stat = new Stat();
  
  		stat.setClassName(comp.getClass().getName());
  
  		stat.setName(comp.getId());
  		if (stat.getName() == null) {
  			stat.setName("Unknown");
  		}
  
  		if (comp instanceof AbstractWComponent) {
  			Object obj = AbstractWComponent.replaceWComponent((AbstractWComponent) comp);
  
  			if (obj instanceof AbstractWComponent.WComponentRef) {
  				stat.setRef(obj.toString());
  			}
  		}
  
  		ComponentModel model = (ComponentModel) uic.getModel(comp);
  
  		stat.setModelState(Stat.MDL_NONE);
  
  		if (model != null) {
  			if (comp.isDefaultState()) {
  				stat.setModelState(Stat.MDL_DEFAULT);
  			} else {
  				addSerializationStat(model, stat);
  			}
  		}
  
  		return stat;
  	}
docs: Creates statistics for a component in the given context.
  
  @param comp the component.
  @return the stats for the given component in the given context.