Examples of WildcardHelper


Examples of com.opensymphony.xwork2.util.WildcardHelper

     * @param classPackageName name of class package
     * @return false if class package is on the {@link #excludePackages} list
     */
    protected boolean checkExcludePackages(String classPackageName) {
        if(excludePackages != null && excludePackages.length > 0) {
            WildcardHelper wildcardHelper = new WildcardHelper();

            //we really don't care about the results, just the boolean
            Map<String, String> matchMap = new HashMap<String, String>();

            for(String packageExclude : excludePackages) {
                int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
                if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

Examples of com.opensymphony.xwork2.util.WildcardHelper

                return false;
            }
        }
       
        // test the methods using pattern matching
        WildcardHelper wildcard = new WildcardHelper();
        String methodCopy ;
        if (method == null ) { // no method specified
            methodCopy = "";
        }
        else {
            methodCopy = new String(method);
        }
        for (String pattern : includeMethods) {
            if (pattern.contains("*")) {
                int[] compiledPattern = wildcard.compilePattern(pattern);
                HashMap<String,String> matchedPatterns = new HashMap<String, String>();
                boolean matches = wildcard.match(matchedPatterns, methodCopy, compiledPattern);
                if (matches) {
                    return true; // run it, includeMethods takes precedence
                }
            }
            else {
                if (pattern.equals(methodCopy)) {
                    return true; // run it, includeMethods takes precedence
                }
            }
        }
        if (excludeMethods.contains("*") ) {
            return false;
        }

        // CHECK ME: Previous implementation used include method
        for ( String pattern : excludeMethods) {
            if (pattern.contains("*")) {
                int[] compiledPattern = wildcard.compilePattern(pattern);
                HashMap<String,String> matchedPatterns = new HashMap<String, String>();
                boolean matches = wildcard.match(matchedPatterns, methodCopy, compiledPattern);
                if (matches) {
                    // if found, and wasn't included earlier, don't run it
                    return false;
                }
            }
View Full Code Here

Examples of com.opensymphony.xwork2.util.WildcardHelper

    protected boolean includeClassNameInActionScan(String className) {

        String classPackageName = StringUtils.substringBeforeLast(className, ".");

        if(excludePackages != null && excludePackages.length > 0) {
            WildcardHelper wildcardHelper = new WildcardHelper();

            //we really don't care about the results, just the boolean
            Map<String, String> matchMap = new HashMap<String, String>();

            for(String packageExclude : excludePackages) {
                int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
                if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
                    return false;
                }
            }
        }
View Full Code Here

Examples of com.opensymphony.xwork2.util.WildcardHelper

     * @param classPackageName name of class package
     * @return false if class package is on the {@link #excludePackages} list
     */
    protected boolean checkExcludePackages(String classPackageName) {
        if(excludePackages != null && excludePackages.length > 0) {
            WildcardHelper wildcardHelper = new WildcardHelper();

            //we really don't care about the results, just the boolean
            Map<String, String> matchMap = new HashMap<String, String>();

            for(String packageExclude : excludePackages) {
                int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
                if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

Examples of com.opensymphony.xwork2.util.WildcardHelper

     * @param classPackageName name of class package
     * @return false if class package is on the {@link #excludePackages} list
     */
    protected boolean checkExcludePackages(String classPackageName) {
        if(excludePackages != null && excludePackages.length > 0) {
            WildcardHelper wildcardHelper = new WildcardHelper();

            //we really don't care about the results, just the boolean
            Map<String, String> matchMap = new HashMap<String, String>();

            for(String packageExclude : excludePackages) {
                int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
                if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

Examples of com.opensymphony.xwork2.util.WildcardHelper

     * @param classPackageName name of class package
     * @return false if class package is on the {@link #excludePackages} list
     */
    protected boolean checkExcludePackages(String classPackageName) {
        if(excludePackages != null && excludePackages.length > 0) {
            WildcardHelper wildcardHelper = new WildcardHelper();

            //we really don't care about the results, just the boolean
            Map<String, String> matchMap = new HashMap<String, String>();

            for(String packageExclude : excludePackages) {
                int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
                if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

Examples of org.apache.tiles.util.WildcardHelper

        Definition def = new Definition();
        def.setName("testDef*.message*");
        def.setTemplateAttribute(Attribute.createTemplateAttribute("/test{1}.jsp"));
        def.putAttribute("body", new Attribute("message{2}"));
        DefinitionPatternMatcher patternMatcher = new WildcardDefinitionPatternMatcher(
                "testDef*.message*", def, new WildcardHelper());
        Definition result = patternMatcher.createDefinition("testDefOne.messageTwo");
        assertNotNull(result);
        assertEquals("testDefOne.messageTwo", result.getName());
        assertEquals("/testOne.jsp", result.getTemplateAttribute().getValue());
        assertEquals("messageTwo", result.getAttribute("body").getValue());
View Full Code Here

Examples of org.apache.tiles.util.WildcardHelper

        Definition def = new Definition();
        def.setName("testDef*.message*");
        def.setTemplateAttribute(Attribute.createTemplateAttribute("/test{1}.jsp"));
        def.putAttribute("body", new Attribute("message{2}"));
        DefinitionPatternMatcher patternMatcher = new WildcardDefinitionPatternMatcher(
                "testDef*.message*", def, new WildcardHelper());
        Definition result = patternMatcher.createDefinition("testDefOne.messageTwo");
        assertNotNull(result);
        assertEquals("testDefOne.messageTwo", result.getName());
        assertEquals("/testOne.jsp", result.getTemplateAttribute().getValue());
        assertEquals("messageTwo", result.getAttribute("body").getValue());
View Full Code Here

Examples of org.apache.tiles.util.WildcardHelper

        Definition def = new Definition();
        def.setName("testDef*.message*");
        def.setTemplateAttribute(Attribute.createTemplateAttribute("/test{1}.jsp"));
        def.putAttribute("body", new Attribute("message{2}"));
        DefinitionPatternMatcher patternMatcher = new WildcardDefinitionPatternMatcher(
                "testDef*.message*", def, new WildcardHelper());
        Definition result = patternMatcher.createDefinition("testDefOne.messageTwo");
        assertNotNull(result);
        assertEquals("testDefOne.messageTwo", result.getName());
        assertEquals("/testOne.jsp", result.getTemplateAttribute().getValue());
        assertEquals("messageTwo", result.getAttribute("body").getValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.