/*
 */

package au.gov.ansto.bragg.nexus.tool;
import au.gov.ansto.bragg.forward.JavaFactory;
import au.gov.ansto.bragg.forward.metamodel.classes.kernel.Class;
import au.gov.ansto.bragg.forward.metamodel.classes.kernel.Package;

import org.dom4j.Document;
import org.dom4j.Element;

/** A factory for producing NeXusBeans, associated inner classes, and NeXusBean packages.
 *
 * @author drck
 * @version "%I%, %G%"
 */
public interface NeXusFactory
        extends JavaFactory {
    
    /** Builds a NeXusBean from the given MetaDTD provided as a Dom4j document.
     * @param $urlMetaDTD String URL of the MetaDTD (only used for the class header documentation).
     * @param xmlMetaDTD A Dom4j XML document of the parsed MetaDTD (from which the bean is constructed).
     * @param neXusPackage The package into which the generated bean will be placed.
     * @return The encapsulated NeXusBean.
     */
    Class newNeXusBean(
            String $urlMetaDTD,
            Document xmlMetaDTD,
            Package neXusPackage
            );
    
    /** Builds a new output package for the given project.
     *
     * <p>
     * The package will be configured with all necessary imports
     * (depending on any configuration flags in the implementation).
     * </p>
     *
     * @param project A project containing a set of MetaDTDs.
     * @return A new output package for the given project.
     */
    Package newNeXusPackage(
            Project project
            );
    
    /** Builds a new NXdataItem inner class from the given XML element.
     * @param eDataItem A dom4j XML snippet that corresponds to an NXdataItem.
     */
    Class newDataItem(Element eDataItem);
}

//SourceXml newSourceXml(String $longName);
//Class newNxClass(Document xmlDocument, Package owningPackage);
