|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.repository.impl.meta.SchemaModuleUtil
public class SchemaModuleUtil
Utilities for working with SchemaModules, including marshalling and unmarshalling with
JAXB.
| Constructor Summary | |
|---|---|
SchemaModuleUtil()
|
|
| Method Summary | |
|---|---|
static org.w3c.dom.ls.LSResourceResolver |
createResourceResolver(java.util.Collection<SchemaModule> modules,
ProgressIndicator progress)
Create an LSResourceResolver that will use the supplied SchemaModules to
find an XSD from its namespace. |
static javax.xml.validation.Schema |
getSchema(java.util.Collection<SchemaModule> possibleModules,
org.w3c.dom.ls.LSResourceResolver resourceResolver,
ProgressIndicator progress)
Creates a Schema from a collection of SchemaModules, with a given
LSResourceResolver (probably obtained from
createResourceResolver(Collection, ProgressIndicator). |
static void |
marshal(javax.xml.bind.JAXBElement element,
java.util.Collection<SchemaModule> possibleModules,
java.io.OutputStream out,
org.w3c.dom.ls.LSResourceResolver resourceResolver,
ProgressIndicator progress)
Transform the given JAXBElement into xml, using JAXB and the schemas provided by the
given SchemaModules. |
static java.lang.Object |
unmarshal(java.io.InputStream xml,
java.util.Collection<SchemaModule> possibleModules,
org.w3c.dom.ls.LSResourceResolver resourceResolver,
boolean strict,
ProgressIndicator progress)
Use JAXB to create POJOs from the given XML. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SchemaModuleUtil()
| Method Detail |
|---|
@Nullable
public static org.w3c.dom.ls.LSResourceResolver createResourceResolver(@NonNull
java.util.Collection<SchemaModule> modules,
@NonNull
ProgressIndicator progress)
LSResourceResolver that will use the supplied SchemaModules to
find an XSD from its namespace. This must be used when marshalling/unmarshalling if any
SchemaModules contain XSDs which import others without specifying a complete
schemaLocation.
@NonNull
public static javax.xml.validation.Schema getSchema(java.util.Collection<SchemaModule> possibleModules,
@Nullable
org.w3c.dom.ls.LSResourceResolver resourceResolver,
ProgressIndicator progress)
Schema from a collection of SchemaModules, with a given
LSResourceResolver (probably obtained from
createResourceResolver(Collection, ProgressIndicator). Any warnings or errors are
logged to the given ProgressIndicator.
@Nullable
public static java.lang.Object unmarshal(@NonNull
java.io.InputStream xml,
@NonNull
java.util.Collection<SchemaModule> possibleModules,
@Nullable
org.w3c.dom.ls.LSResourceResolver resourceResolver,
boolean strict,
@NonNull
ProgressIndicator progress)
throws javax.xml.bind.JAXBException
xml - The XML to read. The stream will be closed after being read.possibleModules - The SchemaModules that are available to parse the XML.resourceResolver - Resolver for any imported XSDs.progress - For logging.
javax.xml.bind.JAXBException - if there is an error during unmarshalling.
TODO: maybe templatize and return a nicer type.
public static void marshal(@NonNull
javax.xml.bind.JAXBElement element,
@NonNull
java.util.Collection<SchemaModule> possibleModules,
@NonNull
java.io.OutputStream out,
@Nullable
org.w3c.dom.ls.LSResourceResolver resourceResolver,
@NonNull
ProgressIndicator progress)
JAXBElement into xml, using JAXB and the schemas provided by the
given SchemaModules.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||