/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* CLI entry-point to the schema generator.
*
* @author Bhakti Mehta
*/
public class SchemaGenerator {
/**
* Runs the schema generator.
*/
}
try {
} catch( ToolsJarNotFoundException e) {
return -1;
}
}
/**
* List of package prefixes we want to load in the same package
*/
"com.sun.tools.internal.jxc.",
"com.sun.tools.internal.xjc.",
"com.sun.istack.internal.tools.",
"com.sun.tools.apt.",
"com.sun.tools.javac.",
"com.sun.tools.javadoc.",
"com.sun.mirror."
};
/**
* Runs the schema generator.
*
* @param classLoader
* the schema generator will run in this classLoader.
* It needs to be able to load APT and JAXB RI classes. Note that
* JAXB RI classes refer to APT classes. Must not be null.
*
* @return
* exit code. 0 if success.
*
*/
public static int run(String[] args, ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
usage();
return -1;
}
usage();
return -1;
}
return -1;
}
return -1;
}
}
try {
} catch (BadCommandLineException e) {
// there was an error in the command line.
// print usage and abort.
usage();
return -1;
}
}
}
// make jaxb-api.jar visible to classpath
} else {
}
}
}
}
/**
* Computes the file system path of <tt>jaxb-api.jar</tt> so that
* APT will see them in the <tt>-cp</tt> option.
*
* <p>
* In Java, you can't do this reliably (for that matter there's no guarantee
* that such a jar file exists, such as in Glassfish), so we do the best we can.
*
* @return
* null if failed to locate it.
*/
// no jar file
return null;
return null; // not from file system
try {
return f;
}
if (f.exists() && f.getName().endsWith(".jar")) { // this is here for potential backw. compatibility issues
return f;
}
} catch (URISyntaxException ex) {
} catch (MalformedURLException ex) {
}
return null;
}
/**
* Returns true if the list of arguments have an argument
* that looks like a class name.
*/
return true;
}
return false;
}
private static void usage( ) {
}
public static final class Runner {
com.sun.tools.internal.jxc.apt.SchemaGenerator r = new com.sun.tools.internal.jxc.apt.SchemaGenerator();
}
}
}