Top Description Inners Fields Constructors Methods
com.sun.tools.jxc

public final Class SchemaGenerator

extends Object
Class Inheritance
Imports
com.sun.tools.jxc.ap.Options, com.sun.tools.xjc.BadCommandLineException, org.glassfish.jaxb.core.util.Which, javax.lang.model.SourceVersion, javax.tools.Diagnostic, .DiagnosticCollector, .JavaCompiler, .JavaFileObject, .OptionChecker, .StandardJavaFileManager, .ToolProvider, jakarta.xml.bind.JAXBContext, java.io.File, java.lang.reflect.InvocationTargetException, .Method, java.net.MalformedURLException, .URISyntaxException, .URL, .URLClassLoader, java.util.ArrayList, .Collections, .List, java.util.logging.Level, .Logger

CLI entry-point to the schema generator.
Author
Bhakti Mehta

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
private static String

Returns:

null if failed to locate it.
findJaxbApiJar
()

Computes the file system path of jakarta.xml.bind-api.jar so that Annotation Processing will see them in the -cp option.

public static void
main(String[]
command line arguments
args
)

Runs the schema generator.

public static int

Returns:

exit code. 0 if success.
run
(String[]
command line arguments
args
)

Runs the schema generator.

public static int

Returns:

exit code. 0 if success.
run
(String[]
arguments for the schema generator
args
,
ClassLoader
the schema generator will run in this classLoader. It needs to be able to load annotation processing and JAXB RI classes. Note that JAXB RI classes refer to annotation processing classes. Must not be null.
classLoader
)

Runs the schema generator.

private static String
setClasspath(String givenClasspath)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

SchemaGeneratorback to summary
private SchemaGenerator()

Method Detail

appendPathback to summary
private static void appendPath(StringBuilder cp, String url)
findJaxbApiJarback to summary
private static String findJaxbApiJar()

Computes the file system path of jakarta.xml.bind-api.jar so that Annotation Processing will see them in the -cp option.

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.

Returns:String

null if failed to locate it.

mainback to summary
public static void main(String[] args) throws Exception

Runs the schema generator.

Parameters
args:String[]

command line arguments

Exceptions
Exception:
for error
runback to summary
public static int run(String[] args) throws Exception

Runs the schema generator.

Parameters
args:String[]

command line arguments

Returns:int

exit code. 0 if success.

Exceptions
Exception:
for error
runback to summary
public static int run(String[] args, ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException

Runs the schema generator.

Parameters
args:String[]

arguments for the schema generator

classLoader:ClassLoader

the schema generator will run in this classLoader. It needs to be able to load annotation processing and JAXB RI classes. Note that JAXB RI classes refer to annotation processing classes. Must not be null.

Returns:int

exit code. 0 if success.

Exceptions
ClassNotFoundException:
if Runner cannot be found
NoSuchMethodException:
if Runner#compile(java.lang.String[], java.io.File) cannot be found
IllegalAccessException:
if Runner#compile(java.lang.String[], java.io.File) cannot be accessed
InvocationTargetException:
if Runner#compile(java.lang.String[], java.io.File) cannot be invoked
setClasspathback to summary
private static String setClasspath(String givenClasspath)
usageback to summary
private static void usage()
com.sun.tools.jxc back to summary

private final Class SchemaGenerator.JavacOptions

extends Object
Class Inheritance

Author
Peter von der Ahe

Field Summary

Modifier and TypeField and Description
private final List<String>
private final List<File>
private final List<String>
private final List<String>

Constructor Summary

AccessConstructor and Description
private
JavacOptions(List<String> recognizedOptions, List<String> classNames, List<File> files, List<String> unrecognizedOptions)

Method Summary

Modifier and TypeMethod and Description
public List<String>

Returns:

a list of class names
getClassNames
()

Returns the list of class names.

public List<File>

Returns:

a list of file names
getFiles
()

Returns the list of file names.

public List<String>

Returns:

a list of options
getRecognizedOptions
()

Returns the list of recognized options and their arguments.

public List<String>

Returns:

a list of unrecognized options
getUnrecognizedOptions
()

Returns the list of unrecognized options.

public static SchemaGenerator.JavacOptions
parse(OptionChecker primary, OptionChecker secondary, String... arguments)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

classNamesback to summary
private final List<String> classNames
filesback to summary
private final List<File> files
recognizedOptionsback to summary
private final List<String> recognizedOptions
unrecognizedOptionsback to summary
private final List<String> unrecognizedOptions

Constructor Detail

JavacOptionsback to summary
private JavacOptions(List<String> recognizedOptions, List<String> classNames, List<File> files, List<String> unrecognizedOptions)

Method Detail

getClassNamesback to summary
public List<String> getClassNames()

Returns the list of class names.

Returns:List<String>

a list of class names

getFilesback to summary
public List<File> getFiles()

Returns the list of file names.

Returns:List<File>

a list of file names

getRecognizedOptionsback to summary
public List<String> getRecognizedOptions()

Returns the list of recognized options and their arguments.

Returns:List<String>

a list of options

getUnrecognizedOptionsback to summary
public List<String> getUnrecognizedOptions()

Returns the list of unrecognized options.

Returns:List<String>

a list of unrecognized options

parseback to summary
public static SchemaGenerator.JavacOptions parse(OptionChecker primary, OptionChecker secondary, String... arguments)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
com.sun.tools.jxc back to summary

public final Class SchemaGenerator.Runner

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean
compile(String[] args, File episode)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Runnerback to summary
private Runner()

Method Detail

compileback to summary
public static boolean compile(String[] args, File episode) throws Exception