/**
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 * If a copy of the MPL was not distributed with this file, You can obtain one at
 * http://mozilla.org/MPL/2.0/.
 * 
 * This Source Code Form is also subject to the terms of the Health-Related Additional
 * Disclaimer of Warranty and Limitation of Liability available at
 * http://www.carewebframework.org/licensing/disclaimer.
 */
package org.carewebframework.maven.plugin.help;

import org.carewebframework.maven.plugin.iterator.IResourceIterator;
import org.carewebframework.maven.plugin.processor.AbstractProcessor;
import org.carewebframework.maven.plugin.resource.IResource;

public class HelpProcessor extends AbstractProcessor<HelpConverterMojo> {
    
    private String hsFile;
    
    private final SourceLoader loader;
    
    private final IResourceIterator resourceIterator;
    
    public HelpProcessor(HelpConverterMojo mojo, String archiveName, SourceLoader loader) throws Exception {
        super(mojo);
        this.loader = loader;
        this.resourceIterator = loader.load(archiveName);
        loader.registerTransforms(this);
    }
    
    @Override
    public String relocateResource(String resourcePath) {
        return "web/" + getResourceBase() + resourcePath;
    }
    
    @Override
    public String getResourceBase() {
        return mojo.getModuleBase() + mojo.getModuleId() + "/";
    }
    
    @Override
    public void transform() throws Exception {
        transform(resourceIterator);
        
        if (hsFile == null) {
            mojo.throwMojoException("Help set definition file not found in source jar.", null);
        }
    }
    
    @Override
    public boolean transform(IResource resource) throws Exception {
        String path = resource.getSourcePath();
        
        if (path.startsWith("META-INF/")) {
            return false;
        }
        
        if (hsFile == null && loader.isHelpSetFile(path)) {
            hsFile = getResourceBase() + resource.getTargetPath();
        }
        
        return super.transform(resource);
    }
    
    public String getHelpSetFile() {
        return hsFile;
    }
}

@@ -668,16 +668,55 @@
 ource;%0A%0A
+/**%0A * Processor for help content.%0A */%0A
 public c
@@ -1705,32 +1705,200 @@
    %7D%0A    %7D%0A    %0A
+    /**%0A     * Excludes resources under the META-INF folder and checks the resource against the help set%0A     * pattern, saving a path reference if it matches.%0A     */%0A
     @Override%0A  
@@ -2304,24 +2304,225 @@
 %0A    %7D%0A    %0A
+    /**%0A     * Returns the path to the main help set file, or null if one was not found during processing.%0A     * %0A     * @return The path to the main help set file, or null if none was found.%0A     */%0A
     public S

Add JavaDoc.