test_class.file: api/src/test/java/org/gatein/management/api/PathTemplateFilterTest.java
test_class.identifier: PathTemplateFilterTest
test_case.body: @Test
     public void testAllowNullsOnParse() throws ParseException
     {
        PathTemplateFilter filter = PathTemplateFilter.parse(null);
        Assert.assertNotNull(filter);
  
        // No attributes means no filter, so PathAddress should accept filter.
        Assert.assertTrue(PathAddress.pathAddress("some", "path").accepts(filter));
     }
test_case.class_method_signature: PathTemplateFilterTest.testAllowNullsOnParse()
test_case.full_signature: @Test public void testAllowNullsOnParse()
test_case.identifier: testAllowNullsOnParse
test_case.invocations: parse assertNotNull assertTrue accepts pathAddress
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAllowNullsOnParse()
focal_class.declarator: PATH_TEMPLATE_REGEX = "\\s*([\\w\\.-]*)\\s*:\\s*(!)?([^!]*)"
focal_class.modifier: private static final
focal_class.original_string: private static final String PATH_TEMPLATE_REGEX = "\\s*([\\w\\.-]*)\\s*:\\s*(!)?([^!]*)";
focal_class.type: String
focal_class.var_name: PATH_TEMPLATE_REGEX
focal_class.declarator: PATH_TEMPLATE_PATTERN = Pattern.compile(PATH_TEMPLATE_REGEX)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATH_TEMPLATE_PATTERN = Pattern.compile(PATH_TEMPLATE_REGEX);
focal_class.type: Pattern
focal_class.var_name: PATH_TEMPLATE_PATTERN
focal_class.declarator: WILDCARD = "*"
focal_class.modifier: private static final
focal_class.original_string: private static final String WILDCARD = "*";
focal_class.type: String
focal_class.var_name: WILDCARD
focal_class.declarator: NO_OP_FILTER = new PathTemplateFilter()
     {
        @Override
        FilteredAddress filter(PathAddress address)
        {
           return new FilteredAddress()
           {
              @Override
              public boolean isFiltered()
              {
                 return true;
              }
  
              @Override
              public boolean matches()
              {
                 return true;
              }
           };
        }
  
        @Override
        public boolean hasPathTemplate(String pathTemplateName)
        {
           return false;
        }
     }
focal_class.modifier: private static final
focal_class.original_string: private static final PathTemplateFilter NO_OP_FILTER = new PathTemplateFilter()
     {
        @Override
        FilteredAddress filter(PathAddress address)
        {
           return new FilteredAddress()
           {
              @Override
              public boolean isFiltered()
              {
                 return true;
              }
  
              @Override
              public boolean matches()
              {
                 return true;
              }
           };
        }
  
        @Override
        public boolean hasPathTemplate(String pathTemplateName)
        {
           return false;
        }
     };
focal_class.type: PathTemplateFilter
focal_class.var_name: NO_OP_FILTER
focal_class.file: api/src/main/java/org/gatein/management/api/PathTemplateFilter.java
focal_class.identifier: PathTemplateFilter
focal_class.class_method_signature: PathTemplateFilter.filter(PathAddress address)
focal_class.full_signature: abstract FilteredAddress filter(PathAddress address)
focal_class.identifier: filter
focal_class.modifiers: abstract
focal_class.parameters: (PathAddress address)
focal_class.return: FilteredAddress
focal_class.signature: FilteredAddress filter(PathAddress address)
focal_class.class_method_signature: PathTemplateFilter.hasPathTemplate(String pathTemplateName)
focal_class.full_signature: public abstract boolean hasPathTemplate(String pathTemplateName)
focal_class.identifier: hasPathTemplate
focal_class.modifiers: public abstract
focal_class.parameters: (String pathTemplateName)
focal_class.return: boolean
focal_class.signature: boolean hasPathTemplate(String pathTemplateName)
focal_class.class_method_signature: PathTemplateFilter.parse(List<String> attributes)
focal_class.full_signature: public static PathTemplateFilter parse(List<String> attributes)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (List<String> attributes)
focal_class.return: PathTemplateFilter
focal_class.signature: PathTemplateFilter parse(List<String> attributes)
focal_class.class_method_signature: PathTemplateFilter.create(String pathTemplate)
focal_class.full_signature: public static Builder create(String pathTemplate)
focal_class.identifier: create
focal_class.modifiers: public static
focal_class.parameters: (String pathTemplate)
focal_class.return: Builder
focal_class.signature: Builder create(String pathTemplate)
focal_method.body: public static PathTemplateFilter parse(List<String> attributes) throws ParseException
     {
        if (attributes == null || attributes.isEmpty())
        {
           return NO_OP_FILTER;
        }
  
        Builder builder = null;
        for (String attribute : attributes)
        {
           for (String attr : PathAddress.split(attribute, ";"))
           {
              Matcher matcher = PATH_TEMPLATE_PATTERN.matcher(attr);
              if (matcher.matches())
              {
                 String pathTemplate = matcher.group(1);
                 if (builder == null)
                 {
                    builder = create(pathTemplate);
                 }
                 else
                 {
                    builder.and(pathTemplate);
                 }
  
                 boolean exclusion = (matcher.group(2) != null);
                 List<String> expressions = PathAddress.split(matcher.group(3), ",");
                 for (String expression : expressions)
                 {
                    boolean wildcard = WILDCARD.equals(expression);
                    if (exclusion)
                    {
                       if (wildcard)
                       {
                          builder.excludeAll();
                       }
                       else
                       {
                          builder.exclude(expression);
                       }
                    }
                    else
                    {
                       if (wildcard)
                       {
                          builder.includeAll();
                       }
                       else
                       {
                          builder.include(expression);
                       }
                    }
                 }
              }
              else
              {
                 throw new ParseException("Filter attribute '" + attribute + "' is not valid.", 0);
              }
           }
        }
  
        return (builder == null) ? NO_OP_FILTER : builder.build();
     }
focal_method.class_method_signature: PathTemplateFilter.parse(List<String> attributes)
focal_method.full_signature: public static PathTemplateFilter parse(List<String> attributes)
focal_method.identifier: parse
focal_method.invocations: isEmpty split matcher matches group create and group split group equals excludeAll exclude includeAll include build
focal_method.modifiers: public static
focal_method.parameters: (List<String> attributes)
focal_method.return: PathTemplateFilter
focal_method.signature: PathTemplateFilter parse(List<String> attributes)