Spring Framework LocalVariableTableParameterNameDiscoverer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework LocalVariableTableParameterNameDiscoverer class.

This code example shows how to use the following methods:
import org.springframework.security.access.prepost.PreInvocationAuthorizationAdvice; 
import org.springframework.security.core.Authentication; 
import org.springframework.util.ClassUtils;
 
public class PythonInterpreterPreInvocationAdvice implements PreInvocationAuthorizationAdvice{ 
    private final ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
 
    public boolean before(Authentication authentication, MethodInvocation mi, PreInvocationAttribute preAttr) {
        PythonInterpreterPreInvocationAttribute pythonAttr = (PythonInterpreterPreInvocationAttribute) preAttr;
        String script = pythonAttr.getScript();
 
        PythonInterpreter python = new PythonInterpreter();
        python.set("authentication", authentication);
        python.set("args", createArgumentMap(mi));
        python.set("method", mi.getMethod().getName());
        Resource scriptResource = new PathMatchingResourcePatternResolver().getResource(script);
 
        try { 
            python.execfile(scriptResource.getInputStream());
        } catch (IOException e) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 */ 
public class AnnotationServiceMethodAdapter implements ServiceMethodAdapter { 
 
    protected final Logger logger = LoggerFactory.getLogger(getClass());
 
    private ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
 
    /** 
     * 调用ROP服务方法 
     * 
     * @param ropRequest 
     * @return 
     */ 
    public Object invokeServiceMethod(RopRequest ropRequest) {
        try { 
            RopRequestContext ropRequestContext = ropRequest.getRopRequestContext();
            //分析上下文中的错误 
            ServiceMethodHandler serviceMethodHandler = ropRequestContext.getServiceMethodHandler();
            if (logger.isDebugEnabled()) { 
                logger.debug("执行" + serviceMethodHandler.getHandler().getClass() +
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
     * Intended for testing. Don't use in practice as it creates a new parameter resolver 
     * for each instance. Use the constructor which takes the resolver, as an argument thus 
     * allowing for caching. 
     */ 
    public CustomMethodSecurityEvaluationContext(final Authentication user, final MethodInvocation mi) {
        this(user, mi, new LocalVariableTableParameterNameDiscoverer());
    } 
 
    public CustomMethodSecurityEvaluationContext(final Authentication user, final MethodInvocation mi,
                    final ParameterNameDiscoverer parameterNameDiscoverer) {
        this.mi = mi;
        this.parameterNameDiscoverer = parameterNameDiscoverer;
    } 
 
    @Override 
    public Object lookupVariable(final String name) {
        Object variable = super.lookupVariable(name);
        if (variable != null) {
            return variable;
        } 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	private final Set<Class<? extends Annotation>> annotationTypes;
 
	private volatile String channelAttributeName = "channel";
 
	private final ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
 
 
	public MethodAnnotationPublisherMetadataSource() { 
		this(Collections.<Class<? extends Annotation>>singleton(Publisher.class));
	} 
 
	public MethodAnnotationPublisherMetadataSource(Set<Class<? extends Annotation>> annotationTypes) {
		Assert.notEmpty(annotationTypes, "annotationTypes must not be empty");
		this.annotationTypes = annotationTypes;
	} 
 
 
	public void setChannelAttributeName(String channelAttributeName) {
		Assert.hasText(channelAttributeName, "channelAttributeName must not be empty");
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		MethodSecurityExpressionHandler { 
 
	private final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
	 
	// base class does not have a getter so we had to copy the same code here 
	private ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
	 
	@Override 
	public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) {
        this.parameterNameDiscoverer = parameterNameDiscoverer;
    } 
	 
	private Logger logger = java.util.logging.Logger.getLogger(ExtendedMethodSecurityExpressionHandler.class.getName());
 
	@PostConstruct 
	public void overrideDefaults() { 
		setPermissionEvaluator(new CustomDenyAllPermissionEvaluator()); 
	} 
	 
	/** 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * @author Guido Steinacker 
 * @since 03.10.12 
 */ 
public final class MethodHelper { 
 
    private static final ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
    public static final Annotation[][] EMPTY_ANNOTATIONS = new Annotation[1][];
    static { 
        EMPTY_ANNOTATIONS[0] = new Annotation[0];
    } 
 
    /** 
     * Discovers parameter infos of a Method. 
     * 
     * Debug information must not be removed from the class files, otherwise the name of the method parameters can 
     * not be resolved. 
     * 
     * @param method the Method 
     * @return list of ParameterInfo in the correct ordering. 
     */ 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	@Before 
	public void setUp() throws Exception { 
		resolver = new RequestParamMethodArgumentResolver(null, true); 
 
		ParameterNameDiscoverer paramNameDiscoverer = new LocalVariableTableParameterNameDiscoverer(); 
 
		Method method = getClass().getMethod("params", String.class, String[].class, 
				Map.class, MultipartFile.class, List.class, MultipartFile[].class, 
				Part.class, List.class, Part[].class, Map.class, 
				String.class, MultipartFile.class, List.class, Part.class, 
				MultipartFile.class, String.class, String.class, Optional.class); 
 
		paramNamedDefaultValueString = new MethodParameter(method, 0); 
		paramNamedStringArray = new MethodParameter(method, 1); 
		paramNamedMap = new MethodParameter(method, 2); 
		paramMultipartFile = new MethodParameter(method, 3); 
		paramMultipartFileList = new MethodParameter(method, 4); 
		paramMultipartFileArray = new MethodParameter(method, 5); 
		paramPart = new MethodParameter(method, 6); 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
import java.lang.reflect.Method;
 
abstract class ParamFromAnnotationBuilderCommons implements ParamFromAnnotationBuilder { 
 
    private static final Logger logger = LoggerFactory.getLogger(ParamFromAnnotationBuilderFactory.class); 
    private static final ParameterNameDiscoverer PARAMETER_NAME_DISCOVERER = new LocalVariableTableParameterNameDiscoverer();
 
    final GrammarsDiscoverer grammarsDiscoverer;
 
    protected ParamFromAnnotationBuilderCommons(GrammarsDiscoverer grammarsDiscoverer) {
        this.grammarsDiscoverer = grammarsDiscoverer;
    } 
 
    String discoverParamName(Method javaMethod, int paramIndex, String explicitName) {
        String name = explicitName;
        if (name.isEmpty()) {
            final String[] parameterNames = PARAMETER_NAME_DISCOVERER.getParameterNames(javaMethod);
            if (parameterNames != null) {
                name = parameterNames[paramIndex];
            } else { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public static final Object NO_RESULT = new Object();
 
	private final SpelExpressionParser parser = new SpelExpressionParser();
 
	// shared param discoverer since it caches data internally 
	private final ParameterNameDiscoverer paramNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
	 
	private final Map<String, Method> targetMethodCache = new ConcurrentHashMap<String, Method>(64);
	 
	private final Map<String, Expression> _expressions = new ConcurrentHashMap<String, Expression>(64);
	 
	/** 
	 * Create an {@link EvaluationContext}. 
	 * 
	 * @param caches the current caches 
	 * @param method the method 
	 * @param args the method arguments 
	 * @param target the target object 
	 * @param targetClass the target class 
	 * @param result the return value (can be {@code null}) or 
4
CodeRank
Experience pair programming with AI  Get Codota for Java