Refactored all property keys with PropertyConfig bean.

This commit is contained in:
Willem Cazander 2013-08-24 01:30:48 +02:00
parent 024865084a
commit b922b0fd81
74 changed files with 1252 additions and 1699 deletions

View file

@ -69,12 +69,12 @@ public class EldDocWriterElementClass extends AbstractApiDocWriter {
printApiTableBean(event, "Element", "class","id","description");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementClass.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementClassAttribute(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Class Attribute Summary",ElementClassAttribute.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementClass.class},nodeBodyOrders={3},contentGroup="configurator",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={3},contentGroup="configurator",contentGroupType="summary")
public void writeElementConfigurator(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Configurator Summary",ElementConfigurator.class);
}

View file

@ -52,22 +52,22 @@ public class EldDocWriterElementInterface extends AbstractApiDocWriter {
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementInterface.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTableBean(event,"Interface","description");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementInterface.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementClassAttribute(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Class Attribute Summary",ElementClassAttribute.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementInterface.class},nodeBodyOrders={3},contentGroup="binding",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={3},contentGroup="binding",contentGroupType="summary")
public void writeElementBindingHandler(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Binding Handler Summary",ElementBindingHandler.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementInterface.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
public void writeElementConfigurator(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Configurator Summary",ElementConfigurator.class);
}

View file

@ -47,12 +47,12 @@ public class EldDocWriterElementNamespace extends AbstractApiDocWriter {
clearHrefContentGroup(doc,node,"summary","element",ElementClass.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTableBean(event,"Namespace","description","elementClasses","elementNamespaceInstanceProvider","prefixMapping");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespaceContext.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary")
public void writeElementNamespaceElements(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Element Summary",ElementClass.class);
}

View file

@ -64,7 +64,7 @@ public class EldDocWriterLanguage extends AbstractApiDocWriter {
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageContext.class},nodeBodyOrders={1})
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageContext.class},nodeBodyOrders={1})
public void writeLanguageSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
ApiDocContentWriter writer = event.getWriter();
ApiDocNode node = event.getEventObject();
@ -99,12 +99,12 @@ public class EldDocWriterLanguage extends AbstractApiDocWriter {
writer.docTableEnd();
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageContext.class},nodeBodyOrders={2})
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageContext.class},nodeBodyOrders={2})
public void writeModulesSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Module Summary",X4OLanguageModule.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageContext.class},nodeBodyOrders={3})
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageContext.class},nodeBodyOrders={3})
public void writeNamespaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
ApiDocContentWriter writer = event.getWriter();
ApiDocNode node = event.getEventObject();

View file

@ -55,27 +55,27 @@ public class EldDocWriterLanguageModule extends AbstractApiDocWriter {
clearHrefContentGroup(doc,node,"summary","namespace",ElementNamespaceContext.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageModule.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
public void writeInterfaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Interface Summary",ElementInterface.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageModule.class},nodeBodyOrders={2},contentGroup="binding",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={2},contentGroup="binding",contentGroupType="summary")
public void writeBindingSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Binding Summary",ElementBindingHandler.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageModule.class},nodeBodyOrders={3},contentGroup="attribute",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={3},contentGroup="attribute",contentGroupType="summary")
public void writeAttributeSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Attribute Summary",ElementAttributeHandler.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageModule.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
public void writeConfigutorSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Configurator Summary",ElementConfigurator.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY_PAGE,targetClasses={X4OLanguageModule.class},nodeBodyOrders={5},contentGroup="namespace",contentGroupType="summary")
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={5},contentGroup="namespace",contentGroupType="summary")
public void writeNamespaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException {
printApiTable(event,"Namespace Summary",ElementNamespaceContext.class);
}

View file

@ -95,7 +95,7 @@ public class X4OWriteLanguageDocExecutor {
*/
public void execute() throws ElementException {
X4ODriver<?> driver = X4ODriverManager.getX4ODriver(getLanguageName());
X4OLanguageContext context = driver.createLanguageContext(getLanguageVersion());
X4OLanguageContext context = driver.createLanguage(getLanguageVersion()).createLanguageContext();
// Run doc writer
EldDocWriter docWriter = new EldDocWriter(context);

View file

@ -40,8 +40,8 @@ public class ApiDocContentWriter extends ContentWriterHtml {
private boolean isAltRow = true;
public ApiDocContentWriter(Writer out,String encoding,String charNewLine,String charTab) {
super(out,encoding,charNewLine,charTab);
public ApiDocContentWriter(Writer out,String encoding) {
super(out,encoding);
}
public void docCommentGenerated() throws SAXException {

View file

@ -172,8 +172,7 @@ public class ApiDocWriter extends AbstractApiDocWriter {
writeNodeTreePath(bodyEvent);
}
writeNodeDescription(bodyEvent,isNodePageMode);
writeNodeSummary(bodyEvent,true); // print without div and block lists
writeNodeSummary(bodyEvent,false);
writeNodeSummary(bodyEvent,isNodePageMode);
writeNodeDetails(bodyEvent);
writer.docPageContentEnd();
writer.docPageClassEnd();
@ -240,35 +239,28 @@ public class ApiDocWriter extends AbstractApiDocWriter {
writer.printTagEnd(Tag.div); // description
}
private void writeNodeSummary(ApiDocWriteEvent<ApiDocNode> event,boolean isPage) throws SAXException {
private void writeNodeSummary(ApiDocWriteEvent<ApiDocNode> event,boolean isPageMode) throws SAXException {
ApiDocContentWriter writer = event.getWriter();
List<ApiDocNodeWriter> bodyWriterSummary = null;
List<ApiDocNodeWriter> bodyWriterSummaryPage = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.SUMMARY_PAGE);
List<ApiDocNodeWriter> bodyWriterSummaryNormal = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.SUMMARY);
if (isPage) {
bodyWriterSummary = bodyWriterSummaryPage;
} else {
bodyWriterSummary = bodyWriterSummaryNormal;
}
if (!isPage) {
List<ApiDocNodeWriter> bodyWriterSummary = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.SUMMARY);
if (!isPageMode) {
writer.printTagStart(Tag.div, ApiDocContentCss.summary);
writer.docPageBlockStart();
}
if (bodyWriterSummary.isEmpty() && !isPage && bodyWriterSummaryPage.isEmpty()) {
writer.docPageBlockStart();
if (bodyWriterSummary.isEmpty() && event.getEventObject().getNodes().isEmpty()==false) {
if (!isPageMode) { writer.docPageBlockStart(); }
defaultWriteSummary(event.getEventObject(),writer);
writer.docPageBlockEnd();
if (!isPageMode) { writer.docPageBlockEnd(); }
}
for (int i=0;i<bodyWriterSummary.size();i++) {
ApiDocNodeWriter nodeWriter = bodyWriterSummary.get(i);
if (!isPage) { writer.docPageBlockStart(); }
if (!isPageMode) { writer.docPageBlockStart(); }
writeSubNavNamedHref(event,nodeWriter);
if (!isPage) { writer.printTagCharacters(Tag.h3, "Summary"); }
if (!isPageMode) { writer.printTagCharacters(Tag.h3, "Summary"); }
nodeWriter.writeNodeContent(event);
if (!isPage) { writer.docPageBlockEnd(); }
if (isPage) { writer.printTagStartEnd(Tag.br); } // mm .. mm
if (!isPageMode) { writer.docPageBlockEnd(); }
if (isPageMode) { writer.printTagStartEnd(Tag.br); } // mm .. mm
}
if (!isPage) {
if (!isPageMode) {
writer.docPageBlockEnd();
writer.printTagEnd(Tag.div); // Summary
}
@ -459,9 +451,9 @@ public class ApiDocWriter extends AbstractApiDocWriter {
String encoding = XMLConstants.XML_DEFAULT_ENCODING;
try {
Writer out = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
String charNewLine = XMLConstants.CHAR_NEWLINE+"";
String charTab = " ";
ApiDocContentWriter result = new ApiDocContentWriter(out,encoding,charNewLine,charTab);
ApiDocContentWriter result = new ApiDocContentWriter(out,encoding);
result.getPropertyConfig().setProperty(ApiDocContentWriter.OUTPUT_CHAR_NEWLINE, XMLConstants.CHAR_NEWLINE+"");
result.getPropertyConfig().setProperty(ApiDocContentWriter.OUTPUT_CHAR_TAB, " ");
return result;
} catch (UnsupportedEncodingException e) {
throw new SAXException(e);

View file

@ -23,10 +23,7 @@
package org.x4o.xml.eld.doc.api.dom;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* ApiDocNode defines the concept impl data tree nodes for which we write documents.
@ -42,11 +39,9 @@ public class ApiDocNode {
private String description = null;
private ApiDocNode parent = null;
private List<ApiDocNode> nodes = null;
private Map<String,String> contentGroupTypes = null;
public ApiDocNode() {
nodes = new ArrayList<ApiDocNode>(30);
contentGroupTypes = new HashMap<String,String>(3);
}
public ApiDocNode(Object userData,String id,String name,String description) {
@ -74,22 +69,6 @@ public class ApiDocNode {
return nodes;
}
public void addContentGroupType(String id,String name) {
contentGroupTypes.put(id, name);
}
public void removeContentGroupType(String id) {
contentGroupTypes.remove(id);
}
public String getContentGroupTypeName(String id) {
return contentGroupTypes.get(id);
}
public Set<String> getContentGroupTypeKeys() {
return contentGroupTypes.keySet();
}
/**
* @return the userData
*/
@ -104,8 +83,6 @@ public class ApiDocNode {
this.userData = userData;
}
/**
* @return the id
*/

View file

@ -34,10 +34,5 @@ public enum ApiDocNodeBody {
DESCRIPTION_LINKS,
DESCRIPTION_NODE,
SUMMARY,
DETAIL,
/**
* Summary page blocks had no div and no block lists around content.
*/
SUMMARY_PAGE
DETAIL
}