Package dk.brics.jwig

Examples of dk.brics.jwig.URLPattern


        sb.append("}\n");
        return sb.toString();
    }

    private String getURLPattern(SootClass cl) {
        URLPattern up = JwigResolver.get().getJavaClass(cl)
                .getAnnotation(URLPattern.class);
        if (up == null)
            return "";
        return "[" + up.value() + "]";
    }
View Full Code Here


    private String getURLPattern(SootMethod method) {
        if (!method.isPublic() || method.isStatic())
            return "";
        Method m = JwigResolver.get().getJavaMethod(method);
        URLPattern up = m.getAnnotation(URLPattern.class);
        if (up == null)
            return "";
        return "[" + up.value() + "]";
    }
View Full Code Here

        }
        return false;
    }

    private boolean hasURLPatternAnnotation(Method method) {
        URLPattern annotation = method.getAnnotation(URLPattern.class);
        return annotation != null;
    }
View Full Code Here

    // added by esbena
    public static int getPriority(Method method) {
        Priority priorityAnnotation = method.getAnnotation(Priority.class);
        final int priority;
        if (priorityAnnotation == null) {
            URLPattern patternAnnotation = method
                    .getAnnotation(URLPattern.class);
            final String pattern;
            if (patternAnnotation != null)
                pattern = patternAnnotation.value();
            else
                pattern = method.getName();
            priority = MyPatternMatcher.computeDefaultPriority(pattern);
        } else
            priority = priorityAnnotation.value();
View Full Code Here

public class UnusedFilter extends AbstractFeedback {

    public UnusedFilter(SootMethod method) {
        Method javaMethod = JwigResolver.get().getJavaMethod(method);
        // will always exist as the method is a filter!
        URLPattern annotation = javaMethod.getAnnotation(URLPattern.class);
        String pattern = annotation.value();
        this.message = "The filter defined by: " + method.getSignature()
                + " (with the URLPattern: '" + pattern + "') is unused";
    }
View Full Code Here

     *            as the class to analyze
     * @return the set of webapp parameter names for this class.
     */
    private Set<String> getWebAppParams(SootClass classs) {
        Class<?> webapp = resolver.getJavaClass(classs);
        URLPattern pattern = webapp.getAnnotation(URLPattern.class);
        if (pattern != null)
            return new HashSet<String>(new MyPatternMatcher(pattern.value(),
                    false).getParameters());
        return new HashSet<String>();
    }
View Full Code Here

     * @return the {@link Automaton} representing the {@link URLPattern} of the
     *         {@link WebApp}
     */
    private Automaton constructURLPatternAutomaton(
            Class<? extends WebApp> webAppClass) {
        URLPattern urlPattern = webAppClass.getAnnotation(URLPattern.class);
        String pattern;
        if (urlPattern != null)
            pattern = urlPattern.value();
        else
            /**
             * the same default as
             * {@link RequestManager#introspectWebAppClass(Class)}.
             */
 
View Full Code Here

     *            as the WebMethod to analyze
     * @return the {@link Automaton} representing the {@link URLPattern} of the
     *         WebMethod
     */
    private Automaton constructURLPatternAutomaton(Method method) {
        URLPattern urlPattern = method.getAnnotation(URLPattern.class);
        String pattern;
        if (urlPattern != null)
            pattern = urlPattern.value();
        else
            pattern = method.getName();
        final Automaton converted = new URLPatternToAutomatonConverter()
                .convert(pattern);

View Full Code Here

TOP

Related Classes of dk.brics.jwig.URLPattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.