Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
It's not clear for me what is the difference in spring security between : @PreAuthorize("hasRole('ROLE_USER')") public void create(Contact contact) And @Secured("ROLE_USER") public void create(Contact contact) I understand PreAuthorize can work with spring el but in my sample, is there a real difference ?
In Java6, imagine I have the following method signature: public void makeSandwich(Bread slice1, Bread slice2, List<Filling> fillings, boolean mustard) I would like to know, at runtime, the value that was passed on to slice2 or any other parameter, the important bit here is that I want to get the value by parameter name. I know how to get the list of parameter types with getParameterTy...
In Spring, the two following statements are, if I'm not mistaken, identical: @RequestParam("type") String type @RequestParam String type How can spring know the variable name of 'type' (second version). I was under the impression that this information was removed from the class files unless compiled with the -g flag (include debug information).
I am considering using Spring Security annotations for my application, with the EL (expression language) feature. For example: @PreAuthorize("hasPermission(#contact, 'admin')") public void deletePermission(Contact contact, Sid recipient, Permission permission); I need the EL capability because I have built my own ACL implementation. However, to use this capability with the "#contact" type ...
 /*
  * Copyright 2002-2006 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.core;
Interface to discover parameter names for methods and constructors.

Parameter name discovery is not always possible, but various strategies are available to try, such as looking for debug information that may have been emitted at compile time, and looking for argname annotation values optionally accompanying AspectJ annotated methods.

Author(s):
Rod Johnson
Adrian Colyer
Since:
2.0
public interface ParameterNameDiscoverer {

Return parameter names for this method, or null if they cannot be determined.

Parameters:
method method to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot
Return parameter names for this constructor, or null if they cannot be determined.

Parameters:
ctor constructor to find parameter names for
Returns:
an array of parameter names if the names can be resolved, or null if they cannot
New to GrepCode? Check out our FAQ X