/** * Parse the file, initialize the result if exists. * * @param unit the deployment unit * @param file the file * @param root the root * @param checkIgnore do we check for ignored names * @return parsed result * @throws Exception for any error */ protected T parseAndInit(VFSDeploymentUnit unit, VirtualFile file, T root, boolean checkIgnore) throws Exception { if (checkIgnore && ignoreFile(unit, file)) return null; T result = parse(unit, file, root); if (result != null) init(unit, result, file); return result; }
if (file != null) if (ignoreFile(vfsDeploymentUnit, file)) ignoredFiles.add(file.getName()); else
if (ignoreFile(vfsDeploymentUnit, m)) ignoredFiles.add(m.getName()); else missingFiles.add(name); else if (ignoreFile(vfsDeploymentUnit, file))
@Override protected T parse(DeploymentUnit unit, String name, T root) throws Exception { if (ignoreName(unit, name)) return null; // Try to find the metadata VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit; VirtualFile file = getMetadataFile(vfsDeploymentUnit, getOutput(), name, true); return (file != null && ignoreFile(vfsDeploymentUnit, file) == false) ? parseAndInit(vfsDeploymentUnit, file, root) : null; }
/** * Handle multiple files. * * @param unit the vfs deployment unit * @param root possibly null pre-existing root * @param files the matching files * @return null or merged single result * @throws Exception for any error */ protected T handleMultipleFiles(VFSDeploymentUnit unit, T root, List<VirtualFile> files) throws Exception { if (allowsMultipleFiles(files) == false) throw new IllegalArgumentException("Multiple matching files not allowed: " + files); for (VirtualFile file : files) { if (ignoreFile(unit, file) == false) { T result = parse(unit, file, root); if (result != null) { init(unit, result, file); unit.addAttachment(file.toURL().toString(), result, getOutput()); } } } return null; }