@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
Map<String, ParsingModuleInfo> classes = parseSpecificBeans(element, parserContext,
builder.getRawBeanDefinition(), and(beansNs(), name("bean")));
ElementSelector searchPackages = and(sameNs(element), name("search-packages"));
ElementSelector searchClasses = and(sameNs(element), name("search-classes"));
ModuleDefinitionScanner scanner = getScanner(parserContext);
for (Element subElement : subElements(element)) {
Pattern classNamePattern = null;
String typeName = null;
String moduleName = null;
String classResourceName = null;
if (searchPackages.accept(subElement)) {
String packageName = assertNotNull(normalizeClassName(subElement.getAttribute("packages")),
"no package name provided for search-packages");
classNamePattern = compileClassName(packageName, MATCH_PREFIX);
typeName = assertNotNull(trimToNull(subElement.getAttribute("type")), "no type name provided");
classResourceName = classNameToPathName(packageName) + "/**/*.class";
log.trace("Searching in packages: {}, moduleType={}", packageName, typeName);
} else if (searchClasses.accept(subElement)) {
String className = assertNotNull(normalizeClassName(subElement.getAttribute("classes")),
"no class name provided for search-classes");
classNamePattern = compileClassName(className, MATCH_PREFIX);
typeName = assertNotNull(trimToNull(subElement.getAttribute("type")), "no type name provided");