All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nh.micro.controller.MicroControllerPlugin Maven / Gradle / Ivy

There is a newer version: 1.0.5-RELEASE
Show newest version
package com.nh.micro.controller;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

import com.nh.micro.rule.engine.core.IGroovyLoadPlugin;

import groovy.lang.GroovyObject;



/**
 * 
 * @author ninghao
 *
 */
public class MicroControllerPlugin implements IGroovyLoadPlugin {

	@Override
	public GroovyObject execPlugIn(String name, GroovyObject groovyObject,
			GroovyObject proxyObject) {
		Annotation[] annos=groovyObject.getClass().getAnnotations();
		MicroUrlMapping anno=groovyObject.getClass().getAnnotation(MicroUrlMapping.class);
		String root="";
		if(anno!=null){
			root=anno.name();
			//MicroControllerMap.setUrl(root, name);
		}else{
			return proxyObject;
		}
		Method[] methods=groovyObject.getClass().getMethods();
		int size=methods.length;
		for(int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy