Added more config keys and refined xsd writer output.
This commit is contained in:
parent
6cd968eb17
commit
e434c1dfe7
|
@ -50,12 +50,30 @@ public class EldXsdWriter {
|
||||||
public final static PropertyConfig DEFAULT_PROPERTY_CONFIG;
|
public final static PropertyConfig DEFAULT_PROPERTY_CONFIG;
|
||||||
|
|
||||||
public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path";
|
public final static String OUTPUT_PATH = PROPERTY_CONTEXT_PREFIX+"output/path";
|
||||||
public final static String NAMESPACE = PROPERTY_CONTEXT_PREFIX+"filter/namespace";
|
public final static String OUTPUT_DOCUMENTATION = PROPERTY_CONTEXT_PREFIX+"output/documentation";
|
||||||
|
public final static String FILTER_NAMESPACE = PROPERTY_CONTEXT_PREFIX+"filter/namespace";
|
||||||
|
public final static String FILTER_ELEMENT = PROPERTY_CONTEXT_PREFIX+"filter/element";
|
||||||
|
public final static String PROLOG_LICENCE_FILE = PROPERTY_CONTEXT_PREFIX+"prolog/licence-file";
|
||||||
|
public final static String PROLOG_LICENCE_RESOURCE = PROPERTY_CONTEXT_PREFIX+"prolog/licence-resource";
|
||||||
|
public final static String PROLOG_LICENCE_ENCODING = PROPERTY_CONTEXT_PREFIX+"prolog/licence-encoding";
|
||||||
|
public final static String PROLOG_PRINT_LICENCE = PROPERTY_CONTEXT_PREFIX+"prolog/print-licence";
|
||||||
|
public final static String PROLOG_PRINT_GENERATOR = PROPERTY_CONTEXT_PREFIX+"prolog/print-generator";
|
||||||
|
public final static String PROLOG_PRINT_PROVIDER = PROPERTY_CONTEXT_PREFIX+"prolog/print-provider";
|
||||||
|
public final static String PROLOG_USER_COMMENT = PROPERTY_CONTEXT_PREFIX+"prolog/user-comment";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
DEFAULT_PROPERTY_CONFIG = new PropertyConfig(true,ContentWriterXml.DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX,
|
DEFAULT_PROPERTY_CONFIG = new PropertyConfig(true,ContentWriterXml.DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX,
|
||||||
new PropertyConfigItem(true,OUTPUT_PATH,File.class),
|
new PropertyConfigItem(true,OUTPUT_PATH,File.class),
|
||||||
new PropertyConfigItem(false,NAMESPACE,String.class)
|
new PropertyConfigItem(OUTPUT_DOCUMENTATION,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(false,FILTER_NAMESPACE,String.class),
|
||||||
|
new PropertyConfigItem(false,FILTER_ELEMENT,String.class),
|
||||||
|
new PropertyConfigItem(false,PROLOG_LICENCE_ENCODING,String.class),
|
||||||
|
new PropertyConfigItem(false,PROLOG_LICENCE_FILE,File.class),
|
||||||
|
new PropertyConfigItem(false,PROLOG_LICENCE_RESOURCE,String.class),
|
||||||
|
new PropertyConfigItem(PROLOG_PRINT_LICENCE,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(PROLOG_PRINT_GENERATOR,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(PROLOG_PRINT_PROVIDER,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(false,PROLOG_USER_COMMENT,String.class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +98,7 @@ public class EldXsdWriter {
|
||||||
public void writeSchema() throws SAXException, IOException {
|
public void writeSchema() throws SAXException, IOException {
|
||||||
File basePath = propertyConfig.getPropertyFile(OUTPUT_PATH);
|
File basePath = propertyConfig.getPropertyFile(OUTPUT_PATH);
|
||||||
String encoding = propertyConfig.getPropertyString(ContentWriterXml.OUTPUT_ENCODING);
|
String encoding = propertyConfig.getPropertyString(ContentWriterXml.OUTPUT_ENCODING);
|
||||||
String namespace = propertyConfig.getPropertyString(NAMESPACE);
|
String namespace = propertyConfig.getPropertyString(FILTER_NAMESPACE);
|
||||||
if (basePath==null) {
|
if (basePath==null) {
|
||||||
throw new NullPointerException("Can't write schema to null output path.");
|
throw new NullPointerException("Can't write schema to null output path.");
|
||||||
}
|
}
|
||||||
|
@ -96,9 +114,9 @@ public class EldXsdWriter {
|
||||||
File outputFile = new File(basePath.getAbsolutePath()+File.separatorChar+ns.getSchemaResource());
|
File outputFile = new File(basePath.getAbsolutePath()+File.separatorChar+ns.getSchemaResource());
|
||||||
Writer wr = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
|
Writer wr = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
|
||||||
try {
|
try {
|
||||||
ContentWriterXsd out = new ContentWriterXsd(wr,encoding);
|
ContentWriterXsd xsdWriter = new ContentWriterXsd(wr,encoding);
|
||||||
out.getPropertyConfig().copyParentProperties(propertyConfig);
|
xsdWriter.getPropertyConfig().copyParentProperties(propertyConfig);
|
||||||
generateSchema(ns.getUri(), out);
|
generateSchema(ns.getUri(), xsdWriter);
|
||||||
} finally {
|
} finally {
|
||||||
wr.close();
|
wr.close();
|
||||||
}
|
}
|
||||||
|
@ -110,9 +128,9 @@ public class EldXsdWriter {
|
||||||
File outputFile = new File(basePath.getAbsolutePath()+File.separatorChar+ns.getSchemaResource());
|
File outputFile = new File(basePath.getAbsolutePath()+File.separatorChar+ns.getSchemaResource());
|
||||||
Writer wr = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
|
Writer wr = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
|
||||||
try {
|
try {
|
||||||
ContentWriterXsd out = new ContentWriterXsd(wr,encoding);
|
ContentWriterXsd xsdWriter = new ContentWriterXsd(wr,encoding);
|
||||||
out.getPropertyConfig().copyParentProperties(propertyConfig);
|
xsdWriter.getPropertyConfig().copyParentProperties(propertyConfig);
|
||||||
generateSchema(ns.getUri(), out);
|
generateSchema(ns.getUri(), xsdWriter);
|
||||||
} finally {
|
} finally {
|
||||||
wr.close();
|
wr.close();
|
||||||
}
|
}
|
||||||
|
@ -120,21 +138,21 @@ public class EldXsdWriter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSchema(String namespaceUri,ContentWriterXsd xmlWriter) throws SAXException {
|
private void generateSchema(String namespaceUri,ContentWriterXsd xsdWriter) throws SAXException {
|
||||||
ElementNamespace ns = language.findElementNamespace(namespaceUri);
|
ElementNamespace ns = language.findElementNamespace(namespaceUri);
|
||||||
if (ns==null) {
|
if (ns==null) {
|
||||||
throw new NullPointerException("Could not find namespace: "+namespaceUri);
|
throw new NullPointerException("Could not find namespace: "+namespaceUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
EldXsdWriterElement xsdWriter = new EldXsdWriterElement(xmlWriter,language);
|
EldXsdWriterElement xsdWriterElement = new EldXsdWriterElement(xsdWriter,language,propertyConfig);
|
||||||
xsdWriter.startNamespaces(namespaceUri);
|
xsdWriterElement.startNamespaces(namespaceUri);
|
||||||
xsdWriter.startSchema(ns);
|
xsdWriterElement.startSchema(ns);
|
||||||
for (ElementClass ec:ns.getElementClasses()) {
|
for (ElementClass ec:ns.getElementClasses()) {
|
||||||
xsdWriter.writeElementClass(ec,ns);
|
xsdWriterElement.writeElementClass(ec,ns);
|
||||||
}
|
}
|
||||||
for (ElementClass ec:ns.getElementClasses()) {
|
for (ElementClass ec:ns.getElementClasses()) {
|
||||||
xsdWriter.writeElement(ec,ns);
|
xsdWriterElement.writeElement(ec,ns);
|
||||||
}
|
}
|
||||||
xsdWriter.endSchema();
|
xsdWriterElement.endSchema();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,14 @@
|
||||||
*/
|
*/
|
||||||
package org.x4o.xml.eld.xsd;
|
package org.x4o.xml.eld.xsd;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -38,8 +45,12 @@ import org.x4o.xml.element.ElementClassAttribute;
|
||||||
import org.x4o.xml.element.ElementInterface;
|
import org.x4o.xml.element.ElementInterface;
|
||||||
import org.x4o.xml.element.ElementMetaBase;
|
import org.x4o.xml.element.ElementMetaBase;
|
||||||
import org.x4o.xml.element.ElementNamespace;
|
import org.x4o.xml.element.ElementNamespace;
|
||||||
|
import org.x4o.xml.element.ElementNamespaceAttribute;
|
||||||
import org.x4o.xml.io.XMLConstants;
|
import org.x4o.xml.io.XMLConstants;
|
||||||
import org.x4o.xml.io.sax.ext.ContentWriterXsd;
|
import org.x4o.xml.io.sax.ext.ContentWriterXsd;
|
||||||
|
import org.x4o.xml.io.sax.ext.ContentWriterXsd.Tag;
|
||||||
|
import org.x4o.xml.io.sax.ext.PropertyConfig;
|
||||||
|
import org.x4o.xml.lang.X4OLanguageClassLoader;
|
||||||
import org.x4o.xml.lang.X4OLanguageModule;
|
import org.x4o.xml.lang.X4OLanguageModule;
|
||||||
import org.x4o.xml.lang.X4OLanguage;
|
import org.x4o.xml.lang.X4OLanguage;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
@ -58,14 +69,16 @@ public class EldXsdWriterElement {
|
||||||
|
|
||||||
static public final String SCHEMA_URI = XMLConstants.XML_SCHEMA_NS_URI;
|
static public final String SCHEMA_URI = XMLConstants.XML_SCHEMA_NS_URI;
|
||||||
|
|
||||||
|
private PropertyConfig propertyConfig;
|
||||||
protected X4OLanguage language = null;
|
protected X4OLanguage language = null;
|
||||||
protected ContentWriterXsd xmlWriter = null;
|
protected ContentWriterXsd xsdWriter = null;
|
||||||
protected String writeNamespace = null;
|
protected String writeNamespace = null;
|
||||||
protected Map<String, String> namespaces = null;
|
protected Map<String, String> namespaces = null;
|
||||||
|
|
||||||
public EldXsdWriterElement(ContentWriterXsd xmlWriter,X4OLanguage language) {
|
public EldXsdWriterElement(ContentWriterXsd xsdWriter,X4OLanguage language,PropertyConfig propertyConfig) {
|
||||||
this.xmlWriter=xmlWriter;
|
this.xsdWriter=xsdWriter;
|
||||||
this.language=language;
|
this.language=language;
|
||||||
|
this.propertyConfig=propertyConfig;
|
||||||
this.namespaces=new HashMap<String,String>(10);
|
this.namespaces=new HashMap<String,String>(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,16 +155,65 @@ public class EldXsdWriterElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String readLicenceStream(InputStream inputStream,String encoding) throws IOException {
|
||||||
|
if (encoding==null) {
|
||||||
|
encoding = XMLConstants.XML_DEFAULT_ENCODING;
|
||||||
|
}
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream,Charset.forName(encoding)));
|
||||||
|
try {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append('\n'); // like plugin
|
||||||
|
sb.append('\n'); // like plugin
|
||||||
|
String line = br.readLine();
|
||||||
|
while (line != null) {
|
||||||
|
if (line.length()>0) {
|
||||||
|
sb.append(" "); // like plugin
|
||||||
|
}
|
||||||
|
sb.append(line);
|
||||||
|
sb.append('\n');
|
||||||
|
line = br.readLine();
|
||||||
|
}
|
||||||
|
sb.append('\n'); // like plugin
|
||||||
|
String out = sb.toString();
|
||||||
|
return out;
|
||||||
|
} finally {
|
||||||
|
br.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static final String COMMENT_SEPERATOR = " ==================================================================== ";
|
private static final String COMMENT_SEPERATOR = " ==================================================================== ";
|
||||||
private static final String COMMENT_TEXT = "=====";
|
private static final String COMMENT_TEXT = "=====";
|
||||||
|
|
||||||
public void startSchema(ElementNamespace ns) throws SAXException {
|
private void prologWriteLicence() throws SAXException, IOException {
|
||||||
|
if (!propertyConfig.getPropertyBoolean(EldXsdWriter.PROLOG_PRINT_LICENCE)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
InputStream licenceInput = null;
|
||||||
|
String licenceEncoding = propertyConfig.getPropertyString(EldXsdWriter.PROLOG_LICENCE_ENCODING);
|
||||||
|
String licenceResource = propertyConfig.getPropertyString(EldXsdWriter.PROLOG_LICENCE_RESOURCE);
|
||||||
|
if (licenceResource!=null) {
|
||||||
|
licenceInput = X4OLanguageClassLoader.getResourceAsStream(licenceResource);
|
||||||
|
if (licenceInput==null) {
|
||||||
|
throw new NullPointerException("Could not load licence resource from: "+licenceResource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (licenceInput==null) {
|
||||||
|
File licenceFile = propertyConfig.getPropertyFile(EldXsdWriter.PROLOG_LICENCE_FILE);
|
||||||
|
if (licenceFile==null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
licenceInput = new FileInputStream(licenceFile);
|
||||||
|
}
|
||||||
|
String licenceText = readLicenceStream(licenceInput,licenceEncoding);
|
||||||
|
xsdWriter.comment(licenceText);
|
||||||
|
}
|
||||||
|
|
||||||
xmlWriter.startDocument();
|
private void prologWriteGenerator() throws SAXException {
|
||||||
xmlWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
if (!propertyConfig.getPropertyBoolean(EldXsdWriter.PROLOG_PRINT_GENERATOR)) {
|
||||||
xmlWriter.comment(COMMENT_SEPERATOR);
|
return;
|
||||||
xmlWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
}
|
||||||
|
//xsdWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
||||||
|
xsdWriter.comment(COMMENT_SEPERATOR);
|
||||||
|
|
||||||
// this is a mess;
|
// this is a mess;
|
||||||
String desc = "Automatic generated schema for language: "+language.getLanguageName();
|
String desc = "Automatic generated schema for language: "+language.getLanguageName();
|
||||||
|
@ -166,11 +228,14 @@ public class EldXsdWriterElement {
|
||||||
}
|
}
|
||||||
b.append(COMMENT_TEXT);
|
b.append(COMMENT_TEXT);
|
||||||
b.append(" ");
|
b.append(" ");
|
||||||
xmlWriter.comment(b.toString());
|
xsdWriter.comment(b.toString());
|
||||||
xmlWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
xsdWriter.comment(COMMENT_SEPERATOR);
|
||||||
xmlWriter.comment(COMMENT_SEPERATOR);
|
}
|
||||||
xmlWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
|
||||||
|
|
||||||
|
private void prologWriteProvider(ElementNamespace ns) throws SAXException {
|
||||||
|
if (!propertyConfig.getPropertyBoolean(EldXsdWriter.PROLOG_PRINT_PROVIDER)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
X4OLanguageModule module = null;
|
X4OLanguageModule module = null;
|
||||||
for (X4OLanguageModule elm:language.getLanguageModules()) {
|
for (X4OLanguageModule elm:language.getLanguageModules()) {
|
||||||
ElementNamespace s = elm.getElementNamespace(ns.getUri());
|
ElementNamespace s = elm.getElementNamespace(ns.getUri());
|
||||||
|
@ -179,24 +244,47 @@ public class EldXsdWriterElement {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
StringBuffer b = new StringBuffer(COMMENT_SEPERATOR.length());
|
||||||
b = new StringBuffer(COMMENT_SEPERATOR.length());
|
String formatLine = "\n\t%1$-20s %2$s";
|
||||||
b.append("\n\tID:\t\t"); b.append(module.getId());
|
b.append(String.format(formatLine,"Id:",module.getId()));
|
||||||
b.append("\n\tProviderName:\t"); b.append(module.getProviderName());
|
b.append(String.format(formatLine,"ProviderName:",module.getProviderName()));
|
||||||
b.append("\n\tProviderHost:\t"); b.append(module.getProviderHost());
|
b.append(String.format(formatLine,"ProviderHost:",module.getProviderHost()));
|
||||||
b.append("\n\tNamespaces:\t\t"); b.append(module.getElementNamespaces().size());
|
b.append(String.format(formatLine,"Namespaces:",module.getElementNamespaces().size()));
|
||||||
b.append("\n\tUri:\t\t\t"); b.append(ns.getUri());
|
b.append(String.format(formatLine,"Uri:",ns.getUri()));
|
||||||
b.append("\n\tUri schema:\t"); b.append(ns.getSchemaUri());
|
b.append(String.format(formatLine,"Uri schema",ns.getSchemaUri()));
|
||||||
b.append("\n\tCreated on:\t\t"); b.append(new Date());
|
b.append(String.format(formatLine,"Created on:",new Date()));
|
||||||
b.append("\n");
|
b.append("\n");
|
||||||
xmlWriter.comment(b.toString());
|
|
||||||
|
|
||||||
|
xsdWriter.comment(b.toString());
|
||||||
|
}
|
||||||
|
|
||||||
xmlWriter.startPrefixMapping("", SCHEMA_URI);
|
private void prologWriteUserComment() throws SAXException {
|
||||||
|
String userComment = propertyConfig.getPropertyString(EldXsdWriter.PROLOG_USER_COMMENT);
|
||||||
|
if (userComment==null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
xsdWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
||||||
|
xsdWriter.comment(" "+userComment+" ");
|
||||||
|
xsdWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startSchema(ElementNamespace ns) throws SAXException {
|
||||||
|
|
||||||
|
xsdWriter.startDocument();
|
||||||
|
|
||||||
|
try {
|
||||||
|
prologWriteLicence();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new SAXException(e);
|
||||||
|
}
|
||||||
|
prologWriteGenerator();
|
||||||
|
prologWriteProvider(ns);
|
||||||
|
prologWriteUserComment();
|
||||||
|
|
||||||
|
xsdWriter.startPrefixMapping("", SCHEMA_URI);
|
||||||
for (String uri:namespaces.keySet()) {
|
for (String uri:namespaces.keySet()) {
|
||||||
String prefix = namespaces.get(uri);
|
String prefix = namespaces.get(uri);
|
||||||
xmlWriter.startPrefixMapping(prefix, uri);
|
xsdWriter.startPrefixMapping(prefix, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
AttributesImpl atts = new AttributesImpl();
|
AttributesImpl atts = new AttributesImpl();
|
||||||
|
@ -204,25 +292,32 @@ public class EldXsdWriterElement {
|
||||||
atts.addAttribute ("", "elementFormDefault", "", "", "qualified");
|
atts.addAttribute ("", "elementFormDefault", "", "", "qualified");
|
||||||
atts.addAttribute ("", "attributeFormDefault", "", "", "unqualified");
|
atts.addAttribute ("", "attributeFormDefault", "", "", "unqualified");
|
||||||
atts.addAttribute ("", "targetNamespace", "", "", ns.getUri());
|
atts.addAttribute ("", "targetNamespace", "", "", ns.getUri());
|
||||||
xmlWriter.startElement (SCHEMA_URI, "schema", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "schema", "", atts);
|
||||||
|
|
||||||
for (String uri:namespaces.keySet()) {
|
for (String uri:namespaces.keySet()) {
|
||||||
if (ns.getUri().equals(uri)) {
|
if (ns.getUri().equals(uri)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ElementNamespace nsContext = language.findElementNamespace(uri);
|
ElementNamespace nsContext = language.findElementNamespace(uri);
|
||||||
atts = new AttributesImpl();
|
xsdWriter.printXsdImport(nsContext.getUri(), nsContext.getSchemaResource());
|
||||||
atts.addAttribute ("", "namespace", "", "", nsContext.getUri());
|
|
||||||
atts.addAttribute ("", "schemaLocation", "", "", nsContext.getSchemaResource());
|
|
||||||
xmlWriter.startElement (SCHEMA_URI, "import", "", atts);
|
|
||||||
xmlWriter.endElement (SCHEMA_URI, "import", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeNamespaceAttributes(ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endSchema() throws SAXException {
|
public void endSchema() throws SAXException {
|
||||||
xmlWriter.endElement (SCHEMA_URI, "schema" , "");
|
xsdWriter.endElement (SCHEMA_URI, "schema" , "");
|
||||||
xmlWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
xsdWriter.ignorableWhitespace(XMLConstants.CHAR_NEWLINE);
|
||||||
xmlWriter.endDocument();
|
xsdWriter.endDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeNamespaceAttributes(ElementNamespace ns) throws SAXException {
|
||||||
|
for (ElementNamespaceAttribute eah:ns.getElementNamespaceAttributes()) {
|
||||||
|
AttributesImpl atts = new AttributesImpl();
|
||||||
|
atts.addAttribute ("", "name", "", "", eah.getAttributeName());
|
||||||
|
atts.addAttribute ("", "type", "", "", "string");
|
||||||
|
writeElementAttribute(eah,atts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeElementClass(ElementClass ec,ElementNamespace nsWrite) throws SAXException {
|
public void writeElementClass(ElementClass ec,ElementNamespace nsWrite) throws SAXException {
|
||||||
|
@ -230,13 +325,13 @@ public class EldXsdWriterElement {
|
||||||
AttributesImpl atts = new AttributesImpl();
|
AttributesImpl atts = new AttributesImpl();
|
||||||
if (nsWrite.getLanguageRoot()!=null && nsWrite.getLanguageRoot()) {
|
if (nsWrite.getLanguageRoot()!=null && nsWrite.getLanguageRoot()) {
|
||||||
atts.addAttribute ("", "name", "", "", ec.getId());
|
atts.addAttribute ("", "name", "", "", ec.getId());
|
||||||
xmlWriter.startElement (SCHEMA_URI, "element", "", atts); // Only in the language root xsd there is an element.
|
xsdWriter.startElement (SCHEMA_URI, "element", "", atts); // Only in the language root xsd there is an element.
|
||||||
|
|
||||||
atts = new AttributesImpl();
|
atts = new AttributesImpl();
|
||||||
xmlWriter.startElement (SCHEMA_URI, "complexType", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "complexType", "", atts);
|
||||||
} else {
|
} else {
|
||||||
atts.addAttribute ("", "name", "", "", ec.getId()+"Type");
|
atts.addAttribute ("", "name", "", "", ec.getId()+"Type");
|
||||||
xmlWriter.startElement (SCHEMA_URI, "complexType", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "complexType", "", atts);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ec.getSchemaContentBase()!=null) {
|
if (ec.getSchemaContentBase()!=null) {
|
||||||
|
@ -245,27 +340,27 @@ public class EldXsdWriterElement {
|
||||||
if (ec.getSchemaContentMixed()!=null && ec.getSchemaContentMixed()) {
|
if (ec.getSchemaContentMixed()!=null && ec.getSchemaContentMixed()) {
|
||||||
atts.addAttribute ("", "mixed", "", "", "true");
|
atts.addAttribute ("", "mixed", "", "", "true");
|
||||||
}
|
}
|
||||||
xmlWriter.startElement (SCHEMA_URI, "complexContent", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "complexContent", "", atts);
|
||||||
} else {
|
} else {
|
||||||
xmlWriter.startElement (SCHEMA_URI, "simpleContent", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "simpleContent", "", atts);
|
||||||
}
|
}
|
||||||
atts = new AttributesImpl();
|
atts = new AttributesImpl();
|
||||||
atts.addAttribute ("", "base", "", "", ec.getSchemaContentBase());
|
atts.addAttribute ("", "base", "", "", ec.getSchemaContentBase());
|
||||||
xmlWriter.startElement (SCHEMA_URI, "extension", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "extension", "", atts);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ec.getSchemaContentBase()==null) {
|
if (ec.getSchemaContentBase()==null) {
|
||||||
atts = new AttributesImpl();
|
atts = new AttributesImpl();
|
||||||
atts.addAttribute ("", "minOccurs", "", "", "0"); // TODO: make unordered elements
|
atts.addAttribute ("", "minOccurs", "", "", "0"); // TODO: make unordered elements
|
||||||
atts.addAttribute ("", "maxOccurs", "", "", "unbounded");
|
atts.addAttribute ("", "maxOccurs", "", "", "unbounded");
|
||||||
xmlWriter.startElement (SCHEMA_URI, "choice", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "choice", "", atts);
|
||||||
|
|
||||||
for (X4OLanguageModule mod:language.getLanguageModules()) {
|
for (X4OLanguageModule mod:language.getLanguageModules()) {
|
||||||
for (ElementNamespace ns:mod.getElementNamespaces()) {
|
for (ElementNamespace ns:mod.getElementNamespaces()) {
|
||||||
writeElementClassNamespaces(ec,nsWrite,ns);
|
writeElementClassNamespaces(ec,nsWrite,ns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xmlWriter.endElement(SCHEMA_URI, "choice", "");
|
xsdWriter.endElement(SCHEMA_URI, "choice", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> attrNames = new ArrayList<String>(30);
|
List<String> attrNames = new ArrayList<String>(30);
|
||||||
|
@ -287,21 +382,10 @@ public class EldXsdWriterElement {
|
||||||
writeElementAttribute(null,atts);
|
writeElementAttribute(null,atts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* TODO: fix xsd namespace attribute printing !!!
|
|
||||||
for (X4OLanguageModule mod:language.getLanguageModules()) {
|
|
||||||
for (ElementNamespaceAttribute eah:ns.getElementNamespaceAttributes()) {
|
|
||||||
attrNames.add(eah.getAttributeName());
|
|
||||||
atts = new AttributesImpl();
|
|
||||||
atts.addAttribute ("", "name", "", "", eah.getAttributeName());
|
|
||||||
atts.addAttribute ("", "type", "", "", "string");
|
|
||||||
writeElementAttribute(eah,atts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (ec.getAutoAttributes()!=null && ec.getAutoAttributes()==false) {
|
if (ec.getAutoAttributes()!=null && ec.getAutoAttributes()==false) {
|
||||||
// oke, reverse this if and rm whitespace.
|
// oke, reverse this if and rm whitespace.
|
||||||
xmlWriter.ignorableWhitespace(' ');
|
xsdWriter.ignorableWhitespace(' ');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -319,6 +403,7 @@ public class EldXsdWriterElement {
|
||||||
if (attrNames.contains(n)) {
|
if (attrNames.contains(n)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
attrNames.add(n);
|
||||||
atts = new AttributesImpl();
|
atts = new AttributesImpl();
|
||||||
atts.addAttribute ("", "name", "", "", n);
|
atts.addAttribute ("", "name", "", "", n);
|
||||||
|
|
||||||
|
@ -338,27 +423,27 @@ public class EldXsdWriterElement {
|
||||||
} else {
|
} else {
|
||||||
atts.addAttribute ("", "type", "", "", "string");
|
atts.addAttribute ("", "type", "", "", "string");
|
||||||
}
|
}
|
||||||
xmlWriter.startElement (SCHEMA_URI, "attribute", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "attribute", "", atts);
|
||||||
xmlWriter.endElement(SCHEMA_URI, "attribute", "");
|
xsdWriter.endElement(SCHEMA_URI, "attribute", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
atts = new AttributesImpl();
|
atts = new AttributesImpl();
|
||||||
xmlWriter.startElement (SCHEMA_URI, "anyAttribute", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "anyAttribute", "", atts);
|
||||||
xmlWriter.endElement(SCHEMA_URI, "anyAttribute", "");
|
xsdWriter.endElement(SCHEMA_URI, "anyAttribute", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ec.getSchemaContentBase()!=null) {
|
if (ec.getSchemaContentBase()!=null) {
|
||||||
xmlWriter.endElement(SCHEMA_URI, "extension", "");
|
xsdWriter.endElement(SCHEMA_URI, "extension", "");
|
||||||
if (ec.getSchemaContentComplex()!=null && ec.getSchemaContentComplex()) {
|
if (ec.getSchemaContentComplex()!=null && ec.getSchemaContentComplex()) {
|
||||||
xmlWriter.endElement(SCHEMA_URI, "complexContent", "");
|
xsdWriter.endElement(SCHEMA_URI, "complexContent", "");
|
||||||
} else {
|
} else {
|
||||||
xmlWriter.endElement(SCHEMA_URI, "simpleContent", "");
|
xsdWriter.endElement(SCHEMA_URI, "simpleContent", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xmlWriter.endElement(SCHEMA_URI, "complexType", "");
|
xsdWriter.endElement(SCHEMA_URI, "complexType", "");
|
||||||
if (nsWrite.getLanguageRoot()!=null && nsWrite.getLanguageRoot()) {
|
if (nsWrite.getLanguageRoot()!=null && nsWrite.getLanguageRoot()) {
|
||||||
xmlWriter.endElement(SCHEMA_URI, "element", "");
|
xsdWriter.endElement(SCHEMA_URI, "element", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,8 +495,8 @@ public class EldXsdWriterElement {
|
||||||
atts.addAttribute ("", "name", "", "", refElement);
|
atts.addAttribute ("", "name", "", "", refElement);
|
||||||
atts.addAttribute ("", "type", "", "", prefix+":"+refElement+"Type");
|
atts.addAttribute ("", "type", "", "", prefix+":"+refElement+"Type");
|
||||||
}
|
}
|
||||||
xmlWriter.startElement (SCHEMA_URI, "element", "", atts);
|
xsdWriter.startElement (SCHEMA_URI, "element", "", atts);
|
||||||
xmlWriter.endElement (SCHEMA_URI, "element", "");
|
xsdWriter.endElement (SCHEMA_URI, "element", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,15 +509,15 @@ public class EldXsdWriterElement {
|
||||||
AttributesImpl atts = new AttributesImpl();
|
AttributesImpl atts = new AttributesImpl();
|
||||||
atts.addAttribute ("", "name", "", "", ec.getId());
|
atts.addAttribute ("", "name", "", "", ec.getId());
|
||||||
atts.addAttribute ("", "type", "", "", "this:"+ec.getId()+"Type");
|
atts.addAttribute ("", "type", "", "", "this:"+ec.getId()+"Type");
|
||||||
xmlWriter.startElement(SCHEMA_URI, "element", "", atts);
|
xsdWriter.startElement(SCHEMA_URI, "element", "", atts);
|
||||||
writeElementMetaBase(ec);
|
writeElementMetaBase(ec);
|
||||||
xmlWriter.endElement(SCHEMA_URI, "element", "");
|
xsdWriter.endElement(SCHEMA_URI, "element", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeElementAttribute(ElementMetaBase base,AttributesImpl atts) throws SAXException {
|
private void writeElementAttribute(ElementMetaBase base,AttributesImpl atts) throws SAXException {
|
||||||
xmlWriter.startElement (SCHEMA_URI, "attribute", "", atts);
|
xsdWriter.printTagStart(Tag.attribute,atts);
|
||||||
writeElementMetaBase(base);
|
writeElementMetaBase(base);
|
||||||
xmlWriter.endElement(SCHEMA_URI, "attribute", "");
|
xsdWriter.printTagEnd(Tag.attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeElementMetaBase(ElementMetaBase base) throws SAXException {
|
private void writeElementMetaBase(ElementMetaBase base) throws SAXException {
|
||||||
|
@ -442,13 +527,9 @@ public class EldXsdWriterElement {
|
||||||
if (base.getDescription()==null) {
|
if (base.getDescription()==null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AttributesImpl atts = new AttributesImpl();
|
if (!propertyConfig.getPropertyBoolean(EldXsdWriter.OUTPUT_DOCUMENTATION)) {
|
||||||
xmlWriter.startElement(SCHEMA_URI, "annotation", "", atts);
|
return;
|
||||||
atts = new AttributesImpl();
|
}
|
||||||
atts.addAttribute ("", "xml:lang", "", "", "en");
|
xsdWriter.printXsdDocumentation(base.getDescription());
|
||||||
xmlWriter.startElement(SCHEMA_URI, "documentation", "", atts);
|
|
||||||
xmlWriter.characters(base.getDescription());
|
|
||||||
xmlWriter.endElement(SCHEMA_URI, "documentation", "");
|
|
||||||
xmlWriter.endElement(SCHEMA_URI, "annotation", "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,9 +488,7 @@ public class AbstractContentWriterHandler implements ContentHandler {
|
||||||
write(getPropertyConfig().getPropertyString(OUTPUT_CHAR_NEWLINE));
|
write(getPropertyConfig().getPropertyString(OUTPUT_CHAR_NEWLINE));
|
||||||
writeIndent();
|
writeIndent();
|
||||||
write(XMLConstants.COMMENT_START);
|
write(XMLConstants.COMMENT_START);
|
||||||
write(" ");
|
|
||||||
write(XMLConstants.escapeCharactersComment(text,getPropertyConfig().getPropertyString(OUTPUT_CHAR_TAB),indent));
|
write(XMLConstants.escapeCharactersComment(text,getPropertyConfig().getPropertyString(OUTPUT_CHAR_TAB),indent));
|
||||||
write(" ");
|
|
||||||
write(XMLConstants.COMMENT_END);
|
write(XMLConstants.COMMENT_END);
|
||||||
printReturn = true;
|
printReturn = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,8 @@ public final class PropertyConfig implements Cloneable {
|
||||||
private final String keyPrefix;
|
private final String keyPrefix;
|
||||||
|
|
||||||
// TODO: move to ?
|
// TODO: move to ?
|
||||||
public final static String X4O_PROPERTIES_PREFIX = "http://language.x4o.org/xml/properties/";
|
// public final static String X4O_PROPERTIES_PREFIX = "http://language.x4o.org/xml/properties/";
|
||||||
|
public final static String X4O_PROPERTIES_PREFIX = "http://x4o.org/properties/";
|
||||||
public final static String X4O_PROPERTIES_READER = "reader/x4o/";
|
public final static String X4O_PROPERTIES_READER = "reader/x4o/";
|
||||||
//public final static String X4O_PROPERTIES_READER_DTD = "reader/dtd/";
|
//public final static String X4O_PROPERTIES_READER_DTD = "reader/dtd/";
|
||||||
public final static String X4O_PROPERTIES_WRITER = "writer/x4o/";
|
public final static String X4O_PROPERTIES_WRITER = "writer/x4o/";
|
||||||
|
@ -206,6 +207,10 @@ public final class PropertyConfig implements Cloneable {
|
||||||
return keyPrefix;
|
return keyPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean isPropertyRequired(String key) {
|
||||||
|
return getPropertyKeysRequired().contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
public final Collection<String> getPropertyKeysRequired() {
|
public final Collection<String> getPropertyKeysRequired() {
|
||||||
return findPropertyKeysRequired(false);
|
return findPropertyKeysRequired(false);
|
||||||
}
|
}
|
||||||
|
@ -244,6 +249,11 @@ public final class PropertyConfig implements Cloneable {
|
||||||
item.setValue(value);
|
item.setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final Object getPropertyDefault(String key) {
|
||||||
|
PropertyConfigItem item = getPropertyConfigItem(key);
|
||||||
|
return item.getValueDefault();
|
||||||
|
}
|
||||||
|
|
||||||
public final Object getProperty(String key) {
|
public final Object getProperty(String key) {
|
||||||
PropertyConfigItem item = getPropertyConfigItem(key);
|
PropertyConfigItem item = getPropertyConfigItem(key);
|
||||||
Object value = item.getValue();
|
Object value = item.getValue();
|
||||||
|
|
|
@ -178,7 +178,15 @@ public class X4OTaskCommandLine {
|
||||||
PropertyConfig config = task.createTaskConfig();
|
PropertyConfig config = task.createTaskConfig();
|
||||||
for (String key:config.getPropertyKeys()) {
|
for (String key:config.getPropertyKeys()) {
|
||||||
Class<?> keyType = config.getPropertyType(key);
|
Class<?> keyType = config.getPropertyType(key);
|
||||||
System.out.println(key+"\t\t- "+keyType.getSimpleName());
|
Object valueDefault = config.getPropertyDefault(key);
|
||||||
|
String def = "";
|
||||||
|
if (valueDefault!=null) {
|
||||||
|
def = "(default=\""+unescapeDefault(valueDefault.toString())+"\")";
|
||||||
|
}
|
||||||
|
if (config.isPropertyRequired(key)) {
|
||||||
|
def = "(required=\"true\")";
|
||||||
|
}
|
||||||
|
System.out.println(String.format("%1$-60s - %2$-8s %3$s", key,keyType.getSimpleName(),def));
|
||||||
}
|
}
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
|
@ -187,6 +195,23 @@ public class X4OTaskCommandLine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String unescapeDefault(String defaultValue) {
|
||||||
|
StringBuffer buf = new StringBuffer(defaultValue.length()+10);
|
||||||
|
for (char c:defaultValue.toCharArray()) {
|
||||||
|
if (c=='\n') {
|
||||||
|
buf.append("\\n");continue;
|
||||||
|
}
|
||||||
|
if (c=='\t') {
|
||||||
|
buf.append("\\t");continue;
|
||||||
|
}
|
||||||
|
if (c=='\r') {
|
||||||
|
buf.append("\\r");continue;
|
||||||
|
}
|
||||||
|
buf.append(c);
|
||||||
|
}
|
||||||
|
return buf.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private void findDriver(Iterator<String> arguIterator) {
|
private void findDriver(Iterator<String> arguIterator) {
|
||||||
while (arguIterator.hasNext()) {
|
while (arguIterator.hasNext()) {
|
||||||
String arg = arguIterator.next();
|
String arg = arguIterator.next();
|
||||||
|
|
|
@ -57,6 +57,9 @@ public class EldXsdLanguageTaskTest extends TestCase {
|
||||||
PropertyConfig config = task.createTaskConfig();
|
PropertyConfig config = task.createTaskConfig();
|
||||||
File outputPath = createOutputPath(outputPostfix);
|
File outputPath = createOutputPath(outputPostfix);
|
||||||
config.setProperty(EldXsdWriter.OUTPUT_PATH,outputPath);
|
config.setProperty(EldXsdWriter.OUTPUT_PATH,outputPath);
|
||||||
|
config.setProperty(EldXsdWriter.OUTPUT_DOCUMENTATION,false);
|
||||||
|
config.setProperty(EldXsdWriter.PROLOG_LICENCE_FILE,new File("../license.txt")); // TODO: s or c ?
|
||||||
|
config.setProperty(EldXsdWriter.PROLOG_USER_COMMENT,"Generated by junit-test-run in class: "+this.getClass().getSimpleName());
|
||||||
task.createTaskExecutor(config).execute(driver.createLanguage());
|
task.createTaskExecutor(config).execute(driver.createLanguage());
|
||||||
assertTrue(outputPath.exists());
|
assertTrue(outputPath.exists());
|
||||||
assertTrue(outputPath.list()!=null);
|
assertTrue(outputPath.list()!=null);
|
||||||
|
|
|
@ -88,6 +88,7 @@
|
||||||
<element objectClass="javax.swing.JFrame"/>
|
<element objectClass="javax.swing.JFrame"/>
|
||||||
</namespace>
|
</namespace>
|
||||||
<namespace id="lang">
|
<namespace id="lang">
|
||||||
|
<namespaceAttribute attributeName="fxid" bean.class="org.x4o.xml.test.element.TestElementNamespaceAttribute" id="fxid-test"></namespaceAttribute>
|
||||||
<element objectClass="javax.swing.JMenuBar"/>
|
<element objectClass="javax.swing.JMenuBar"/>
|
||||||
<element objectClass="javax.swing.JMenu"/>
|
<element objectClass="javax.swing.JMenu"/>
|
||||||
<element objectClass="javax.swing.JMenuItem">
|
<element objectClass="javax.swing.JMenuItem">
|
||||||
|
|
|
@ -93,6 +93,10 @@ public class EldDocWriter {
|
||||||
public final static String META_STYLESHEET_THEMA = PROPERTY_CONTEXT_PREFIX+"meta/stylesheet-thema";
|
public final static String META_STYLESHEET_THEMA = PROPERTY_CONTEXT_PREFIX+"meta/stylesheet-thema";
|
||||||
public final static String JAVADOC_LINK = PROPERTY_CONTEXT_PREFIX+"javadoc/link";
|
public final static String JAVADOC_LINK = PROPERTY_CONTEXT_PREFIX+"javadoc/link";
|
||||||
public final static String JAVADOC_LINK_OFFLINE = PROPERTY_CONTEXT_PREFIX+"javadoc/link-offline";
|
public final static String JAVADOC_LINK_OFFLINE = PROPERTY_CONTEXT_PREFIX+"javadoc/link-offline";
|
||||||
|
public final static String PAGE_PRINT_TREE = PROPERTY_CONTEXT_PREFIX+"page/print-tree";
|
||||||
|
public final static String PAGE_PRINT_XTREE = PROPERTY_CONTEXT_PREFIX+"page/print-xtree";
|
||||||
|
public final static String PAGE_PRINT_INDEX_ALL = PROPERTY_CONTEXT_PREFIX+"page/print-index-all";
|
||||||
|
public final static String PAGE_PRINT_HELP = PROPERTY_CONTEXT_PREFIX+"page/print-help";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
DEFAULT_PROPERTY_CONFIG = new PropertyConfig(true,ContentWriterXml.DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX,
|
DEFAULT_PROPERTY_CONFIG = new PropertyConfig(true,ContentWriterXml.DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX,
|
||||||
|
@ -106,7 +110,11 @@ public class EldDocWriter {
|
||||||
new PropertyConfigItem(false,META_STYLESHEET,File.class),
|
new PropertyConfigItem(false,META_STYLESHEET,File.class),
|
||||||
new PropertyConfigItem(false,META_STYLESHEET_THEMA,String.class),
|
new PropertyConfigItem(false,META_STYLESHEET_THEMA,String.class),
|
||||||
new PropertyConfigItem(false,JAVADOC_LINK,List.class),
|
new PropertyConfigItem(false,JAVADOC_LINK,List.class),
|
||||||
new PropertyConfigItem(false,JAVADOC_LINK_OFFLINE,Map.class)
|
new PropertyConfigItem(false,JAVADOC_LINK_OFFLINE,Map.class),
|
||||||
|
new PropertyConfigItem(PAGE_PRINT_TREE,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(PAGE_PRINT_XTREE,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(PAGE_PRINT_INDEX_ALL,Boolean.class,true),
|
||||||
|
new PropertyConfigItem(PAGE_PRINT_HELP,Boolean.class,true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,10 +222,10 @@ public class EldDocWriter {
|
||||||
adcEc.addChildConcepts(new ApiDocConcept(adcEc,CC_ATTRIBUTE,ElementClassAttribute.class));
|
adcEc.addChildConcepts(new ApiDocConcept(adcEc,CC_ATTRIBUTE,ElementClassAttribute.class));
|
||||||
|
|
||||||
// Non-tree pages config
|
// Non-tree pages config
|
||||||
doc.addDocPage(EldDocXTreePageWriter.createDocPage());
|
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_XTREE)) { doc.addDocPage(EldDocXTreePageWriter.createDocPage()); }
|
||||||
doc.addDocPage(DefaultPageWriterTree.createDocPage());
|
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_TREE)) { doc.addDocPage(DefaultPageWriterTree.createDocPage()); }
|
||||||
doc.addDocPage(DefaultPageWriterIndexAll.createDocPage());
|
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_INDEX_ALL)) { doc.addDocPage(DefaultPageWriterIndexAll.createDocPage()); }
|
||||||
doc.addDocPage(DefaultPageWriterHelp.createDocPage());
|
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_HELP)) { doc.addDocPage(DefaultPageWriterHelp.createDocPage()); }
|
||||||
|
|
||||||
// Doc tree config
|
// Doc tree config
|
||||||
ApiDocNode rootNode = new ApiDocNode(language,"language",getLanguageNameUpperCase()+" Language","The X4O "+getLanguageNameUpperCase()+" Language");
|
ApiDocNode rootNode = new ApiDocNode(language,"language",getLanguageNameUpperCase()+" Language","The X4O "+getLanguageNameUpperCase()+" Language");
|
||||||
|
|
Loading…
Reference in a new issue