public class XmlGenerator extends Object
Actions and Datasource) from a given list of
XmlGenerator.Entitys. The generated XML will contain a basic master-detail navigation which can be used as a starting
point to implement CRUD functionality. Anyhow, no Java-sourcecode ( ActionProviders or DataProviders
) will be generated. This can be done for example by using custom freemarker templating.
Example usage:
XmlGenerator generator = new XmlGenerator();
generator.setDatePattern("yyyy-MM-dd");
Entity entity = new Entity(Person.class, new String[] { "name", "firstName", "street", "birthDate" });
generator.generate("target/generated", "My generated person app", "messages-persons", entity);
See also generate(String, String, String, Entity...)
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlGenerator.Entity
Represents a domain object of a certain type with a number of properties
|
| Constructor and Description |
|---|
XmlGenerator() |
XmlGenerator(boolean addPermissions)
Creates a new XmlGenerator
|
| Modifier and Type | Method and Description |
|---|---|
void |
generate(String outPath,
String name,
String dictionaryName,
XmlGenerator.Entity... entities)
Generates the source XML for the given
XmlGenerator.Entitys. |
Event |
generateActions(Permissions permissions,
XmlGenerator.Entity entity) |
Event |
generateActions(Permissions permissions,
XmlGenerator.Entity entity,
OutputStream out) |
Datasources |
generateDatasources(XmlGenerator.Entity entity,
OutputStream out) |
Datasources |
generateDatasources(XmlGenerator.Entity entity,
OutputStream out,
String... properties) |
Pages |
generatePages(XmlGenerator.Entity entity,
Linkpanel navigation,
OutputStream out) |
ApplicationRootConfig |
generateRootConfig(String name) |
String |
getDatePattern() |
Datasource |
getSingleItemDatasource(XmlGenerator.Entity entity,
OutputStream out,
String... properties) |
void |
setDatePattern(String datePattern) |
void |
writeDictionary(OutputStream out) |
void |
writeToOutputStream(Object object,
OutputStream out) |
public XmlGenerator(boolean addPermissions)
throws JAXBException
addPermissions - if Permissions should be generated and used when referencing ActionsJAXBException - if creating a MarshallService failspublic XmlGenerator()
throws JAXBException
JAXBExceptionpublic void generate(String outPath, String name, String dictionaryName, XmlGenerator.Entity... entities) throws Exception
XmlGenerator.Entitys. The following files will be created for each
XmlGenerator.Entity, assuming the Person.class as the entities type:
ApplicationRootConfigoutPath - the target folder for the files to be generatedname - the name for the ApplicationRootConfig-file to be createddictionaryName - the name for the dictionary file to be created (<dictionaryName>.properties)entities - the list of XmlGenerator.Entitys to generate the source XML forException - if something goes really wrong ;-)public Pages generatePages(XmlGenerator.Entity entity, Linkpanel navigation, OutputStream out) throws Exception
Exceptionpublic Event generateActions(Permissions permissions, XmlGenerator.Entity entity, OutputStream out) throws Exception
Exceptionpublic Event generateActions(Permissions permissions, XmlGenerator.Entity entity) throws Exception
Exceptionpublic Datasources generateDatasources(XmlGenerator.Entity entity, OutputStream out) throws Exception
Exceptionpublic Datasources generateDatasources(XmlGenerator.Entity entity, OutputStream out, String... properties) throws Exception
Exceptionpublic void writeToOutputStream(Object object, OutputStream out) throws ParserConfigurationException, JAXBException, TransformerException
public Datasource getSingleItemDatasource(XmlGenerator.Entity entity, OutputStream out, String... properties) throws Exception
Exceptionpublic void writeDictionary(OutputStream out) throws IOException
IOExceptionpublic ApplicationRootConfig generateRootConfig(String name)
public String getDatePattern()
public void setDatePattern(String datePattern)
Copyright © 2011–2018 aiticon GmbH. All rights reserved.