@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
Map<String, ParsingModuleInfo> scripts = parseSpecificBeans(element, parserContext,
builder.getRawBeanDefinition(), ns(LANG_URI));
ElementSelector searchFolders = and(sameNs(element), name("search-folders"));
ElementSelector searchFiles = and(sameNs(element), name("search-files"));
for (Element subElement : subElements(element)) {
String prefix = null;
String typeName = null;
String moduleName = null;
Pattern scriptNamePattern = null;
String scriptResourceName = null;
String language = null;
if (searchFolders.accept(subElement)) {
String folderName = assertNotNull(normalizePathName(subElement.getAttribute("folders")),
"no folder name provided for search-folders");
// ȡprefix
prefix = getPrefix(folderName);
if (prefix != null) {
folderName = folderName.substring(prefix.length() + 1);
}
// folderName����/��ʼ
if (folderName.startsWith("/")) {
folderName = folderName.substring(1);
}
scriptNamePattern = compilePathName(folderName);
typeName = assertNotNull(trimToNull(subElement.getAttribute("type")), "no type name provided");
language = trimToNull(subElement.getAttribute("language"));
scriptResourceName = folderName + "/**/*.*";
log.trace("Searching in folders: {}, moduleType={}, language={}", new Object[] { folderName, typeName,
language == null ? "auto" : language });
} else if (searchFiles.accept(subElement)) {
String fileName = assertNotNull(normalizePathName(subElement.getAttribute("files")),
"no script file name provided for search-files");
// fileName����/��β
assertTrue(!fileName.endsWith("/"), "invalid script file name: %s", fileName);