示例#1
0
    	public static SpringMvcMappings springMvcMappings(this String xmlFile)
    	{
    		var mvcMappings = new SpringMvcMappings(xmlFile);

			var urlBeans = mvcMappings.springBeans.urlBeans(); 
			var beans_byId = mvcMappings.springBeans.beans_byId();
			 
			foreach(var urlBean in urlBeans)
			{ 
				var controller = new SpringMvcController()
										{
											HttpRequestUrl = urlBean.name,
											JavaClass = [email protected]							
										};
				foreach(var _property in urlBean.property)	
					controller.Properties.add(_property.name, _property.value + 
															 ((([email protected]).valid()) ? "ref:{0}".format([email protected]) : "" ));
				
				if (controller.JavaClass.inValid() && beans_byId.hasKey(urlBean.parent))
				{
					controller.JavaClass = beans_byId[urlBean.parent][email protected];								
					foreach(var _property in beans_byId[urlBean.parent].property)	
						controller.Properties.add(_property.name, _property.value + 
															 ((([email protected]).valid()) ? "ref:{0}".format([email protected]) : "" ));
				
				} 
				
				if (controller.JavaClass.valid())
					controller.FileName = "{0}.java".format(controller.JavaClass.replace(".","\\")); 
					
				controller.CommandName = controller.Properties["commandName"];
				controller.CommandClass= controller.Properties["commandClass"];  
				
				mvcMappings.Controllers.Add(controller); 
			}
			return mvcMappings;
    	}
示例#2
0
		public static SpringMvcMappings map_ControllerBean(this SpringMvcMappings mvcMappings, string httpRequestUrl, beans.beanLocalType urlBean)
		{
			var controller = new SpringMvcController()
									{
										HttpRequestUrl = httpRequestUrl, 
										JavaClass = [email protected]							
									};
			foreach(var _property in urlBean.property)	
				controller.Properties.add(_property.name, _property.value + 
														 ((([email protected]).valid()) ? "ref:{0}".format([email protected]) : "" ));

//not used in the current case
//var beans_byId = mvcMappings.springBeans.beans_byId();			 				
/*				if (controller.JavaClass.inValid() && beans_byId.hasKey(urlBean.parent))
			{
				controller.JavaClass = beans_byId[urlBean.parent][email protected];								
				foreach(var _property in beans_byId[urlBean.parent].property)	
					controller.Properties.add(_property.name, _property.value + 
														 ((([email protected]).valid()) ? "ref:{0}".format([email protected]) : "" ));
			
			} 
*/				
			if (controller.JavaClass.valid())
				controller.FileName = "{0}.java".format(controller.JavaClass.replace(".","\\")); 
				
			controller.CommandName = controller.Properties["commandName"];
			controller.CommandClass= controller.Properties["commandClass"];  
			
			mvcMappings.Controllers.Add(controller); 
			
			return mvcMappings;
    	}