/*
* Enhydra Java Application Server Project
*
* The contents of this file are subject to the Enhydra Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License on
* the Enhydra web site ( http://www.enhydra.org/ ).
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific terms governing rights and limitations
* under the License.
*
* The Initial Developer of the Enhydra Application Server is Lutris
* Technologies, Inc. The Enhydra Application Server and portions created
* by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
* All Rights Reserved.
*/
package org.enhydra.zeus;
import java.io.File;
import java.io.IOException;
/**
* <p>
* <code>Generator</code> is the portion of Zeus that will convert
* a set of constraints, visible through a <code>{@link Binding}</code>,
* and output them as generated Java classes (to a
* <code>{@link Result}</code>.
* </p>
*
* @author Brett McLaughlin
* @author Maciej Zawadzki
*/
public interface Generator {
/**
* <p>
* This sets the output directory to output generated classes to.
* </p>
*
* @param outputDir the name of the base directory where
* all generated classes should be placed
*/
public void setOutputDirectory(String outputDir);
/**
* <p>
* This sets the output directory to output generated classes to.
* </p>
*
* @param outputDir the <code>File</code> (directory) where
* all generated classes should be placed
*/
public void setOutputDirectory(File outputDir);
/**
* <p>
* This allows a binding to be ignored. This is an intermediary step
* towards allowing binding schemas. The name of the binding should be
* passed in here, and no property generation for it will occur.
* </p>
*
* @param xmlName the XML local name associated with the binding.
* @param xmlNamespaceURI the XML namespace URI associated with the binding.
* The empty string indicates there is no namespace associated with
* the binding.
*/
public void setIgnoreBinding(String xmlName, String xmlNamespaceURI);
/**
* <p>
* This allows a binding to be ignored. This is an intermediary step
* towards allowing binding schemas. The name of the binding should be
* passed in here, and no property generation for it will occur.
* </p><p>
* This convenience version assumes that the XML name has no namespace
* URI associated with it, so supplies <tt>""</tt> for that value.
* </p>
*
* @param xmlName the XML local name associated with the binding.
*/
public void setIgnoreBinding(String xmlName);
/**
* <p>
* This will convert from a set of constraints to Java classes.
* It accesses those constraints through the
* <code>{@link Binding}</code> interface, which provides
* them in a representation-independent format, and then
* converts them into Java code.
* </p>
*
* @param binder <code>Binder</code> with ability to convert from
* constraints to Zeus <code>Binding</code>s.
* @throws <code>IOException</code> - when errors in writing to the
* supplied <code>Result</code> occur.
* @throws <code>ZeusException</code> - when errors in class generation
* occur.
*/
public void generate(Binding binding) throws IOException, ZeusException;
}
|