Class XmlSchemaGenerator<T,C,F,M>
java.lang.Object
org.glassfish.jaxb.runtime.v2.schemagen.XmlSchemaGenerator<T,C,F,M>
Generates a set of W3C XML Schema documents from a set of Java classes.
A client must invoke methods in the following order:
- Create a new
XmlSchemaGenerator - Invoke
add(org.glassfish.jaxb.core.v2.model.core.ClassInfo<T, C>)methods, multiple times if necessary. - Invoke
write(jakarta.xml.bind.SchemaOutputResolver, org.glassfish.jaxb.core.api.ErrorListener) - Discard the
XmlSchemaGenerator.
- Author:
- Ryan Shoemaker, Kohsuke Kawaguchi (kk@kohsuke.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(QName tagName, boolean isNillable, NonElement<T, C> type) Adds an additional element declaration.voidvoidAdds a new class to the list of classes to be written.voidadd(ElementInfo<T, C> elem) Adds a new element to the list of elements to be written.voidadd(EnumLeafInfo<T, C> envm) protected static Stringrelativize(String uri, String baseUri) Relativizes a URI by using another URI (base URI.)toString()Debug information of what's in this .voidwrite(SchemaOutputResolver resolver, ErrorListener errorListener) Write out the schema documents.voidWrites out the episode file.
-
Constructor Details
-
Method Details
-
add
Adds a new class to the list of classes to be written.A
ClassInfomay have two namespaces --- one for the element name and the other for the type name. If they are different, we put the sameClassInfoto twoXmlSchemaGenerator<T,s.C, F, M>.org.glassfish.jaxb.runtime.v2.schemagen.XmlSchemaGenerator.Namespace -
add
Adds a new element to the list of elements to be written. -
add
-
add
-
add
Adds an additional element declaration.- Parameters:
tagName- The name of the element declaration to be added.type- The type this element refers to. Can be null, in which case the element refers to an empty anonymous complex type.
-
writeEpisodeFile
Writes out the episode file. -
write
Write out the schema documents.- Throws:
IOException
-
toString
Debug information of what's in this . -
relativize
Relativizes a URI by using another URI (base URI.)For example,
relative("http://www.sun.com/abc/def","http://www.sun.com/pqr/stu") => "../abc/def"This method only works on hierarchical URI's, not opaque URI's (refer to the java.net.URI javadoc for complete definitions of these terms.
This method will not normalize the relative URI.
- Returns:
- the relative URI or the original URI if a relative one could not be computed
-