Package org.duracloud.common.xml
Class SchemaGenerator
- java.lang.Object
-
- javax.xml.bind.SchemaOutputResolver
-
- org.duracloud.common.xml.SchemaGenerator
-
public class SchemaGenerator extends javax.xml.bind.SchemaOutputResolverSchema generator which can be used to generate a schema for pojo classes which have been marked up with JAXB annotations.
-
-
Constructor Summary
Constructors Constructor Description SchemaGenerator(String fileName)Creates a SchemaGenerator indicating the preferred name of the generated schema file.SchemaGenerator(String fileName, File schemaDir)Creates a SchemaGenerator indicating the preferred name of the generated schema file and the directory in which is should be stored.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultcreateOutput(String namespaceUri, String defaultFileName)Called by the schema generation process.voidgenerateSchema(Class... classes)Generates an XML Schema which includes the given classes
-
-
-
Constructor Detail
-
SchemaGenerator
public SchemaGenerator(String fileName)
Creates a SchemaGenerator indicating the preferred name of the generated schema file.- Parameters:
fileName- of the schema
-
-
Method Detail
-
generateSchema
public void generateSchema(Class... classes) throws javax.xml.bind.JAXBException, IOException
Generates an XML Schema which includes the given classes- Parameters:
classes- to include in the schema definition- Throws:
javax.xml.bind.JAXBExceptionIOException
-
createOutput
public Result createOutput(String namespaceUri, String defaultFileName) throws IOException
Called by the schema generation process. There is no need to call this method directly.- Specified by:
createOutputin classjavax.xml.bind.SchemaOutputResolver- Throws:
IOException
-
-