public class ModelBuilder extends Object
mycomp.namespace=http://www.acme.com/xsd/mycomp.xsd mycomp.schemaLocation=/META-INF/xsd/mycomp.xsd mycomp.bindingConfigLocation=/META-INF/xsd/mycomp-binding.xml
You should use a unique descriptor path for a given configuration model. Of course there can be many instances of this file on the classpath i.e. one per module/jar. This allows you to easily add extensions and updates to your configuration model, without having to define new Java model for the new namespaces (versions) etc.
| Constructor and Description |
|---|
ModelBuilder(Descriptor descriptor,
boolean validate) |
ModelBuilder(String descriptorPath,
boolean validate) |
| Modifier and Type | Method and Description |
|---|---|
protected Descriptor |
getDescriptor() |
boolean |
isValidating() |
<T> Model<T> |
readModel(InputStream message,
Class<T> modelRoot) |
<T> Model<T> |
readModel(Reader message,
Class<T> modelRoot) |
<T> T |
readObject(InputStream message,
Class<T> returnType) |
<T> T |
readObject(Reader message,
Class<T> returnType) |
void |
setReportPath(String reportPath) |
public ModelBuilder(Descriptor descriptor, boolean validate) throws SAXException, IOException
SAXExceptionIOExceptionpublic ModelBuilder(String descriptorPath, boolean validate) throws SAXException, IOException
SAXExceptionIOExceptionpublic boolean isValidating()
protected Descriptor getDescriptor()
public void setReportPath(String reportPath)
public <T> T readObject(InputStream message, Class<T> returnType) throws SAXException, IOException
SAXExceptionIOExceptionpublic <T> T readObject(Reader message, Class<T> returnType) throws SAXException, IOException
SAXExceptionIOExceptionpublic <T> Model<T> readModel(InputStream message, Class<T> modelRoot) throws SAXException, IOException
SAXExceptionIOExceptionpublic <T> Model<T> readModel(Reader message, Class<T> modelRoot) throws SAXException, IOException
SAXExceptionIOExceptionCopyright © 2024. All rights reserved.