Removed all classes from ApiDoc to MaisDoc postfix

This commit is contained in:
Willem Cazander 2025-01-27 01:34:18 +01:00
parent 0845e8f615
commit 11a4a53aab
46 changed files with 839 additions and 839 deletions

View file

@ -33,7 +33,7 @@ import java.io.PrintStream;
import java.util.Arrays;
import java.util.List;
import org.x4o.maisdoc.ApiDocProject;
import org.x4o.maisdoc.MaisDocProject;
import org.xml.sax.SAXException;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@ -53,10 +53,10 @@ public class Java3Documentation extends PrintStream {
public void start(List<String> args) {
println("TODO:");
ApiDocProject project = loadProject(new File("poop-popcorn.xml"));
MaisDocProject project = loadProject(new File("poop-popcorn.xml"));
}
private ApiDocProject loadProject(File popcornFile) {
private MaisDocProject loadProject(File popcornFile) {
return null;
// try {
// return PopCornDriver.newInstance().createReader().readFile(popcornFile);

View file

@ -30,11 +30,11 @@ import org.x4o.fc18.FourCornerUnicodeDisplay;
import org.x4o.fc18.cake2.FourCornerDotCake;
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable;
@ -44,37 +44,37 @@ import org.x4o.sax3.io.ContentCloseable;
* @author Willem Cazander
* @version 1.0 Jan 17, 2025
*/
public class FCDocPageWriterBaklava implements ApiDocPageWriter, FCDocSegmentWriter {
public class FCDocPageWriterBaklava implements MaisDocPageWriter, FCDocSegmentWriter {
public static ApiDocPage createDocPage() {
return new ApiDocPage("overview-baklave","Baklava","Overview of all 6 bit baklava NCR1632 fractions.",new FCDocPageWriterBaklava());
public static MaisDocPage createDocPage() {
return new MaisDocPage("overview-baklave","Baklava","Overview of all 6 bit baklava NCR1632 fractions.",new FCDocPageWriterBaklava());
}
// TODO: make all symbols href links
@Override
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException {
ApiDocContentWriter writer = e.getWriter();
public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
MaisDocContentWriter writer = e.getWriter();
try (ContentCloseable content = writer.docPageContent()) {
try (ContentCloseable table = writer.docTable(FourCornerDotCake.FC_NCR1632_XD.nameSpec().replaceAll("XD", "baklava"), null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable(FourCornerDotCake.FC_NCR1632_XD.nameSpec().replaceAll("XD", "baklava"), null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeaderNumeric(writer, 28);
writePIN(writer);
}
}
}
private void writePIN(ApiDocContentWriter writer) throws IOException {
private void writePIN(MaisDocContentWriter writer) throws IOException {
for (int t = 0; t < 27; t++) {
try (ContentCloseable tableRow = writer.docTableRow()) {
String prefixNCR = String.format("T%03d", t + 1);
writer.printTagStart(Tag.td, ApiDocContentCss.colOne);
writer.printTagStart(Tag.td, MaisDocContentCss.colOne);
writer.printCharacters(prefixNCR);
writer.printTagEnd(Tag.td);
for (int i = 0; i < 27; i++) {
if (i + 1 < 27) {
writer.printTagStart(Tag.td);
} else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast);
writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
}
if (i > t) {
writer.printTagEnd(Tag.td);

View file

@ -33,11 +33,11 @@ import org.x4o.fc18.cake2.zero33.FCDotAPL0127DashP7C;
import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7D;
import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7E;
import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7F;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable;
@ -47,19 +47,19 @@ import org.x4o.sax3.io.ContentCloseable;
* @author Willem Cazander
* @version 1.0 Jan 17, 2025
*/
public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWriter {
public class FCDocPageWriterMuffin implements MaisDocPageWriter, FCDocSegmentWriter {
public static ApiDocPage createDocPage() {
return new ApiDocPage("overview-muffin","Muffins","Overview of all muffin symbols.",new FCDocPageWriterMuffin());
public static MaisDocPage createDocPage() {
return new MaisDocPage("overview-muffin","Muffins","Overview of all muffin symbols.",new FCDocPageWriterMuffin());
}
// TODO: make all symbols href links
@Override
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException {
ApiDocContentWriter writer = e.getWriter();
public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
MaisDocContentWriter writer = e.getWriter();
try (ContentCloseable content = writer.docPageContent()) {
try (ContentCloseable table = writer.docTable(FourCornerDotCake.FC_CDC1604_P6.nameSpec(), null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable(FourCornerDotCake.FC_CDC1604_P6.nameSpec(), null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeaderNumeric(writer, 17);
writeCDC(writer, 0x00);
writeCDC(writer, 0x10);
@ -69,7 +69,7 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
}
try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_APL0127_P7A.nameSpec().replaceAll("P7A", "P7x");
try (ContentCloseable table = writer.docTable(xSpec, null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable(xSpec, null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeaderNumeric(writer, 28, true);
writeP7x(writer, FourCornerDotCake.FC_APL0127_P7A, v -> FCDotAPL0127DashP7A.valueOf(v).codePointDotIndex());
writeP7x(writer, FourCornerDotCake.FC_APL0127_P7B, v -> FCDotAPL0127DashP7B.valueOf(v).codePointDotIndex());
@ -78,7 +78,7 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
}
try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_BYD0127_P7D.nameSpec().replaceAll("P7D", "P7x");
try (ContentCloseable table = writer.docTable(xSpec, null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable(xSpec, null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeaderNumeric(writer, 28, true);
writeP7x(writer, FourCornerDotCake.FC_BYD0127_P7D, v -> FCDotBYD0127DashP7D.valueOf(v).codePointDotIndex());
writeP7x(writer, FourCornerDotCake.FC_BYD0127_P7E, v -> FCDotBYD0127DashP7E.valueOf(v).codePointDotIndex());
@ -87,7 +87,7 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
}
try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_PIE9C_01.nameSpec().replaceAll("01", "Cake");
try (ContentCloseable table = writer.docTable(xSpec, null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable(xSpec, null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeaderNumeric(writer, 28, true);
writePIE(writer, FourCornerDotCake.FC_PIE9C_01);
writePIE(writer, FourCornerDotCake.FC_PIE9C_02);
@ -120,7 +120,7 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
}
try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_PIE9D_01.nameSpec().replaceAll("01", "Cake");
try (ContentCloseable table = writer.docTable(xSpec, null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable(xSpec, null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeaderNumeric(writer, 28, true);
writePIE(writer, FourCornerDotCake.FC_PIE9D_01);
writePIE(writer, FourCornerDotCake.FC_PIE9D_02);
@ -153,20 +153,20 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
}
}
private void writePIE(ApiDocContentWriter writer, FourCornerDotCake slice) throws IOException {
private void writePIE(MaisDocContentWriter writer, FourCornerDotCake slice) throws IOException {
try (ContentCloseable tableRow = writer.docTableRow()) {
String prefixHex = String.format("0x%06X", slice.getStart());
writer.printTagStart(Tag.td, ApiDocContentCss.colFirst);
writer.printTagStart(Tag.td, MaisDocContentCss.colFirst);
writer.printCharacters(prefixHex);
writer.printTagEnd(Tag.td);
writer.printTagStart(Tag.td, ApiDocContentCss.colOne);
writer.printTagStart(Tag.td, MaisDocContentCss.colOne);
writer.printCharacters(slice.nameSpec());
writer.printTagEnd(Tag.td);
for (int i = 0; i < 27; i++) {
if (i + 1 < 27) {
writer.printTagStart(Tag.td);
} else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast);
writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
}
if (i >= slice.getLength()) {
writer.printTagEnd(Tag.td);

View file

@ -27,8 +27,8 @@ import java.util.function.Function;
import org.x4o.fc18.cake2.FourCornerDotCake;
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable;
import org.xml.sax.helpers.AttributesImpl;
@ -41,13 +41,13 @@ import org.xml.sax.helpers.AttributesImpl;
*/
public interface FCDocSegmentWriter {
default void writeP7x(ApiDocContentWriter writer, FourCornerDotCake slice, Function<Integer, Integer> conv) throws IOException {
default void writeP7x(MaisDocContentWriter writer, FourCornerDotCake slice, Function<Integer, Integer> conv) throws IOException {
String prefixHex = String.format("0x%06X", slice.getStart());
try (ContentCloseable tableRow = writer.docTableRow()) {
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colFirst)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colFirst)) {
writer.printCharacters(prefixHex);
}
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colOne)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colOne)) {
writer.printCharacters(slice.nameSpec());
}
for (int i = 0; i < 27; i++) {
@ -55,7 +55,7 @@ public interface FCDocSegmentWriter {
if (i + 1 < 27) {
writer.printTagStart(Tag.td);
} else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast);
writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
}
StringBuilder buf = new StringBuilder();
if (codePoint == '\u0000') {
@ -69,10 +69,10 @@ public interface FCDocSegmentWriter {
}
}
default void writeCDC(ApiDocContentWriter writer, int off) throws IOException {
default void writeCDC(MaisDocContentWriter writer, int off) throws IOException {
String prefixHex = String.format("0x%05X0", off >> 4);
try (ContentCloseable tableRow = writer.docTableRow()) {
writer.printTagStart(Tag.td, ApiDocContentCss.colOne);
writer.printTagStart(Tag.td, MaisDocContentCss.colOne);
writer.printCharacters(prefixHex);
writer.printTagEnd(Tag.td);
for (int i = off; i < 16 + off; i++) {
@ -81,7 +81,7 @@ public interface FCDocSegmentWriter {
if (i + 1 < 16 + off) {
writer.printTagStart(Tag.td);
} else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast);
writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
}
StringBuilder buf = new StringBuilder();
if (codePoint == '\u0000') {
@ -105,17 +105,17 @@ public interface FCDocSegmentWriter {
}
}
default void writeTableBoxHeader(ApiDocContentWriter writer, String[] headers) throws IOException {
default void writeTableBoxHeader(MaisDocContentWriter writer, String[] headers) throws IOException {
try (ContentCloseable td = writer.printTag(Tag.tr)) {
AttributesImpl atts;
for (int i = 0; i < headers.length; i++) {
atts = new AttributesImpl();
if (i == 0) {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colFirst.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colFirst.name());
} else if (i == 1) {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colOne.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colOne.name());
} else {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colLast.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colLast.name());
}
atts.addAttribute("", "scope", "", "", "col");
try (ContentCloseable th = writer.printTag(Tag.th, atts)) {
@ -125,28 +125,28 @@ public interface FCDocSegmentWriter {
}
}
default void writeTableBoxHeaderNumeric(ApiDocContentWriter writer, int num) throws IOException {
default void writeTableBoxHeaderNumeric(MaisDocContentWriter writer, int num) throws IOException {
writeTableBoxHeaderNumeric(writer, num, false);
}
default void writeTableBoxHeaderNumeric(ApiDocContentWriter writer, int num, boolean colFirst) throws IOException {
default void writeTableBoxHeaderNumeric(MaisDocContentWriter writer, int num, boolean colFirst) throws IOException {
writer.printTagStart(Tag.tr);
AttributesImpl atts;
if (colFirst) {
atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colFirst.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colFirst.name());
atts.addAttribute("", "scope", "", "", "col");
writer.printTagStart(Tag.th, atts);
writer.printTagEnd(Tag.th);
}
atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colOne.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colOne.name());
atts.addAttribute("", "scope", "", "", "col");
writer.printTagStart(Tag.th, atts);
writer.printTagEnd(Tag.th);
for (int i = 0; i < num - 1; i++) {
atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colLast.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colLast.name());
atts.addAttribute("", "scope", "", "", "col");
writer.printTagStart(Tag.th, atts);
writer.printCharacters("0x");

View file

@ -29,13 +29,13 @@ import java.util.Optional;
import java.util.Set;
import org.x4o.fc18.cake2.FourCornerDotCake;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable;
@ -60,9 +60,9 @@ public class FCDocSegmentWriterCake implements FCDocSegmentWriter {
"Contains the BIP0039(2013) keyword encoding too",
};
@ApiDocNodeWriterMethod(nodeBody = ApiDocNodeBody.DESCRIPTION_NODE, targetClasses = {TDocCake.class}, nodeBodyOrders = 20)
public void writeFeatureListing(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.DESCRIPTION_NODE, targetClasses = {TDocCake.class}, nodeBodyOrders = 20)
public void writeFeatureListing(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
writer.printCharacters("Features;");
try (ContentCloseable content = writer.docPageContent()) {
try (ContentCloseable ul = writer.printTag(Tag.ul)) {
@ -75,54 +75,54 @@ public class FCDocSegmentWriterCake implements FCDocSegmentWriter {
}
}
@ApiDocNodeWriterMethod(nodeBody = ApiDocNodeBody.DESCRIPTION_NODE, targetClasses = {TDocCake.class}, nodeBodyOrders = 1)
public void writeIntro(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.DESCRIPTION_NODE, targetClasses = {TDocCake.class}, nodeBodyOrders = 1)
public void writeIntro(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
writer.printCharacters("Four corner is 18 bit text encoding for 144 bit computers.");
}
@ApiDocNodeWriterMethod(nodeBody = ApiDocNodeBody.SUMMARY, targetClasses = {TDocCake.class}, nodeBodyOrders = 20)
public void writeDefaultSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = {TDocCake.class}, nodeBodyOrders = 20)
public void writeDefaultSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
// NOTE: copyed from defaultWriteSummary as that only called with zero summaries
ApiDocContentWriter writer = event.getWriter();
ApiDocNode parent = event.getEventObject();
ApiDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass());
List<ApiDocNode> nodes = parent.getNodes();
MaisDocContentWriter writer = event.getWriter();
MaisDocNode parent = event.getEventObject();
MaisDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass());
List<MaisDocNode> nodes = parent.getNodes();
if (nodes.isEmpty()) {
return;
}
String name = concept.getName()+" Summary";
writer.docTableStart(name, "All childeren in "+name, ApiDocContentCss.overviewSummary);
writer.docTableStart(name, "All childeren in "+name, MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Description");
for (ApiDocNode child : nodes) {
String link = ApiDocContentWriter.toSafeUri(child.getId())+"/index.html";
for (MaisDocNode child : nodes) {
String link = MaisDocContentWriter.toSafeUri(child.getId())+"/index.html";
if (parent.getParent() == null) {
link = ApiDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node
link = MaisDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node
}
writer.docTableRowLink(link,child.getName(),child.getDescription());
}
writer.docTableEnd();
}
@ApiDocNodeWriterMethod(nodeBody = ApiDocNodeBody.SUMMARY, targetClasses = {TDocCake.class}, nodeBodyOrders = 30)
public void writeTowerSummary(ApiDocWriteEvent<ApiDocNode> e) throws IOException {
@MaisDocNodeWriterMethod(nodeBody = MaisDocNodeBody.SUMMARY, targetClasses = {TDocCake.class}, nodeBodyOrders = 30)
public void writeTowerSummary(MaisDocWriteEvent<MaisDocNode> e) throws IOException {
String rootId = e.getDoc().getRootNode().getId();
ApiDocConcept concept = e.getDoc().findConceptByClass(e.getEventObject().getUserData().getClass());
MaisDocConcept concept = e.getDoc().findConceptByClass(e.getEventObject().getUserData().getClass());
String tableName = concept.getName() + " Elevator";
ApiDocContentWriter writer = e.getWriter();
try (ContentCloseable table = writer.docTable(tableName, null, ApiDocContentCss.overviewSummary)) {
MaisDocContentWriter writer = e.getWriter();
try (ContentCloseable table = writer.docTable(tableName, null, MaisDocContentCss.overviewSummary)) {
writeTableBoxHeader(writer, new String[] {"Cake", "Tower", "Start", "Stop", "Size", "External"});
Set<FourCornerDotCake> linkableSlices = new HashSet<>();
for (ApiDocNode towerNode : e.getEventObject().getNodes()) {
for (ApiDocNode sliceNode : towerNode.getNodes()) {
for (MaisDocNode towerNode : e.getEventObject().getNodes()) {
for (MaisDocNode sliceNode : towerNode.getNodes()) {
FourCornerDotCake slice = sliceNode.toUserData(TDocCakeSlice.class).getSlice();
linkableSlices.add(slice);
StringBuilder buf = new StringBuilder();
buf.append(ApiDocContentWriter.toSafeUri(rootId)); // TODO: add full tree node ID href version of toSafeUri
buf.append(MaisDocContentWriter.toSafeUri(rootId)); // TODO: add full tree node ID href version of toSafeUri
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(towerNode.getId()));
buf.append(MaisDocContentWriter.toSafeUri(towerNode.getId()));
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(sliceNode.getId()));
buf.append(MaisDocContentWriter.toSafeUri(sliceNode.getId()));
buf.append("/index.html");
writeCake(writer, slice, Optional.of(buf.toString()));
}
@ -136,28 +136,28 @@ public class FCDocSegmentWriterCake implements FCDocSegmentWriter {
}
}
private void writeCake(ApiDocContentWriter writer, FourCornerDotCake slice, Optional<String> href) throws IOException {
private void writeCake(MaisDocContentWriter writer, FourCornerDotCake slice, Optional<String> href) throws IOException {
try (ContentCloseable tableRow = writer.docTableRow()) {
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colFirst)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colFirst)) {
if (href.isEmpty()) {
writer.printCharacters(slice.nameSpec());
} else {
writer.printHref(href.get(), slice.nameSpec(), slice.description(), "strong");
}
}
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colOne)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colOne)) {
writer.printCharacters(slice.tower().nameNice());
}
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colLast)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colLast)) {
writer.printCharacters(String.format("0x%06X", slice.getStart()));
}
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colLast)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colLast)) {
writer.printCharacters(String.format("0x%06X", slice.getStop()));
}
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colLast)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colLast)) {
writer.printCharacters(String.format("%d", slice.getLength()));
}
try (ContentCloseable td = writer.printTag(Tag.td, ApiDocContentCss.colLast)) {
try (ContentCloseable td = writer.printTag(Tag.td, MaisDocContentCss.colLast)) {
writer.printCharacters(Boolean.toString(slice.isExternWord()));
}
}

View file

@ -26,13 +26,13 @@ import java.io.IOException;
import java.util.List;
import org.x4o.fc18.cake2.FourCornerDotCake;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.io.ContentCloseable;
/**
@ -45,33 +45,33 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter {
// NOTE: Table are not allowed in details
// @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=20)
public void writeDefaultSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
public void writeDefaultSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
// NOTE: copyed from defaultWriteSummary as that only called with zero summaries + changes name end in; Words
ApiDocContentWriter writer = event.getWriter();
ApiDocNode parent = event.getEventObject();
ApiDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass());
List<ApiDocNode> nodes = parent.getNodes();
MaisDocContentWriter writer = event.getWriter();
MaisDocNode parent = event.getEventObject();
MaisDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass());
List<MaisDocNode> nodes = parent.getNodes();
if (nodes.isEmpty()) {
return;
}
String name = concept.getName()+" Words";
writer.docTableStart(name, "All childeren in "+name,ApiDocContentCss.overviewSummary);
writer.docTableStart(name, "All childeren in "+name,MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Description");
for (ApiDocNode child : nodes) {
String link = ApiDocContentWriter.toSafeUri(child.getId())+"/index.html";
for (MaisDocNode child : nodes) {
String link = MaisDocContentWriter.toSafeUri(child.getId())+"/index.html";
if (parent.getParent()==null) {
link = ApiDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node
link = MaisDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node
}
writer.docTableRowLink(link,child.getName(),child.getDescription());
}
writer.docTableEnd();
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=1)
public void writeCakeSliceDetails(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=1)
public void writeCakeSliceDetails(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
FourCornerDotCake slice = event.getEventObject().toUserData(TDocCakeSlice.class).getSlice();
try (ContentCloseable table = writer.docTable("Cake Slice", null, ApiDocContentCss.overviewSummary)) {
try (ContentCloseable table = writer.docTable("Cake Slice", null, MaisDocContentCss.overviewSummary)) {
writer.docTableHeader("Information", "Value");
writer.docTableRow("Start index", String.format("0x%06X", slice.getStart()));
writer.docTableRow("Stop index", String.format("0x%06X", slice.getStop()));

View file

@ -35,12 +35,12 @@ import org.x4o.fc18.cake2.FourCornerX08MuffinPointSequence;
import org.x4o.fc18.cake2.FourCornerX18CakePointDotName;
import org.x4o.fc18.cake2.FourCornerX18CakePointSequence;
import org.x4o.fc18.cake2.FourCornerX21CodePointSequence;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.fc18.cake2.FourCornerX00PetitVide;
import org.x4o.sax3.SAX3WriterHtml.Tag;
@ -52,9 +52,9 @@ import org.x4o.sax3.SAX3WriterHtml.Tag;
*/
public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={TDocCakeWord.class})
public void writeCakeWordSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={TDocCakeWord.class})
public void writeCakeWordSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
TDocCakeWord word = event.getEventObject().toUserData(TDocCakeWord.class);
FourCornerX00PetitVide[] videPoints = word.getSlice().getVidePoints();
if (videPoints.length == 0) {
@ -70,7 +70,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
Optional<FourCornerX18CakePointSequence> x18CakeSequence = videPoint.kaasX18CakeSequence();
Optional<FourCornerX18CakePointDotName> x18DotName = videPoint.kaasX18CakeDotName();
writer.docTableStart("Word Summary", "The cake word point value information.",ApiDocContentCss.overviewSummary);
writer.docTableStart("Word Summary", "The cake word point value information.",MaisDocContentCss.overviewSummary);
writer.docTableHeader("Point", "Value");
String name = word.toString();
String value = "";
@ -130,7 +130,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
Optional<FourCornerX00PetitVideCoinCarne> x00CoinCarne = videPoint.kaasX00CoinCarne();
if (x00CoinCarne.isPresent()) {
FourCornerX00PetitVideCoinCarne cornerKerning = x00CoinCarne.get();
writer.docTableStart("Kerning Summary", "Kerning all pattern displays.",ApiDocContentCss.overviewSummary);
writer.docTableStart("Kerning Summary", "Kerning all pattern displays.",MaisDocContentCss.overviewSummary);
writer.docTableHeader("Location", "Corner dents");
writer.docTableRow("Top", cornerKerning.coinCarneFrapper().kerningTop().name());
writer.docTableRow("Bottom", cornerKerning.coinCarneFrapper().kerningBottom().name());
@ -139,7 +139,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
}
private void writeSequence(ApiDocContentWriter writer, String system, int minHex, List<Integer> sequence) throws IOException {
private void writeSequence(MaisDocContentWriter writer, String system, int minHex, List<Integer> sequence) throws IOException {
String displayFormat = "0x%0" + minHex + "X";
StringBuilder buf = new StringBuilder();
for (int i = 0; i < sequence.size(); i++) {

View file

@ -34,12 +34,12 @@ import org.x4o.fc18.cake2.FourCornerDotCakeTower;
import org.x4o.fc18.cake2.FourCornerX00PetitVide;
import org.x4o.fc18.cake2.FourCornerX18CakePointDotName;
import org.x4o.fc18.cake2.FourCornerX21CodePointSequence;
import org.x4o.maisdoc.flake.ApiDocGenerator;
import org.x4o.maisdoc.flake.MaisDocGenerator;
import org.x4o.maisdoc.flake.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNode;
import org.xml.sax.SAXException;
/**
@ -55,8 +55,8 @@ public class FCDocWriter {
private static final String[] C_FC_SLICE = {"fc-slice","Cake","The cake slice information.","The four corner cake slice provides the layout of boundries."};
private static final String[] C_FC_WORD = {"fc-word","Word","An FC18 word.","The word of an number."};
private ApiDocGenerator writer = null;
private ApiDoc doc = null;
private MaisDocGenerator writer = null;
private MaisDoc doc = null;
static public void main(String[] args) {
Iterator<String> arguments = Arrays.asList(args).iterator();
@ -104,10 +104,10 @@ public class FCDocWriter {
public FCDocWriter(Integer stopCakePoint) {
this.doc = buildApiDoc(new TDocCake(), stopCakePoint);
this.writer = new ApiDocGenerator();
this.writer = new MaisDocGenerator();
}
public ApiDoc getApiDoc() {
public MaisDoc getApiDoc() {
return doc;
}
@ -116,8 +116,8 @@ public class FCDocWriter {
writer.write(doc,basePath);
}
private ApiDoc buildApiDoc(TDocCake docCake, Integer stopCakePoint) {
ApiDoc doc = new ApiDoc();
private MaisDoc buildApiDoc(TDocCake docCake, Integer stopCakePoint) {
MaisDoc doc = new MaisDoc();
doc.setName("FourCorner");
doc.setDescription("FourCorner 18 bit text encoding format.");
doc.setDocAbout("FourCorner Indexes\nThe World Of Words™");
@ -142,10 +142,10 @@ public class FCDocWriter {
doc.addAnnotatedClasses(FCDocSegmentWriterCakeWord.class);
doc.addAnnotatedClasses(FCDocSegmentWriterCakeSlice.class);
ApiDocConcept adc1 = doc.addConcept(new ApiDocConcept(null,C_FC_ROOT,TDocCake.class));
ApiDocConcept adc2 = doc.addConcept(new ApiDocConcept(adc1,C_FC_TOWER,TDocCakeTower.class));
ApiDocConcept adc3 = doc.addConcept(new ApiDocConcept(adc2,C_FC_SLICE,TDocCakeSlice.class));
/*ApiDocConcept adc4 = */doc.addConcept(new ApiDocConcept(adc3,C_FC_WORD,TDocCakeWord.class));
MaisDocConcept adc1 = doc.addConcept(new MaisDocConcept(null,C_FC_ROOT,TDocCake.class));
MaisDocConcept adc2 = doc.addConcept(new MaisDocConcept(adc1,C_FC_TOWER,TDocCakeTower.class));
MaisDocConcept adc3 = doc.addConcept(new MaisDocConcept(adc2,C_FC_SLICE,TDocCakeSlice.class));
/*ApiDocConcept adc4 = */doc.addConcept(new MaisDocConcept(adc3,C_FC_WORD,TDocCakeWord.class));
//ApiDocConcept adc4 = doc.addConcept(new ApiDocConcept(adc3,C_TABLE,Table.class));
//adc4.addChildConcepts(new ApiDocConcept(adc4, CC_RS, Relationship.class));
@ -156,16 +156,16 @@ public class FCDocWriter {
//doc.addDocPage(DefaultPageWriterIndexAll.createDocPage());
doc.addDocPage(DefaultPageWriterHelp.createDocPage());
ApiDocNode rootNode = new ApiDocNode(docCake,"fc-root","Tower","All cake tower floors.");
MaisDocNode rootNode = new MaisDocNode(docCake,"fc-root","Tower","All cake tower floors.");
doc.setRootNode(rootNode);
for (FourCornerDotCakeTower tower : FourCornerDotCakeTower.values()) {
ApiDocNode towerNode = rootNode.addNode(createNodeCakeTower(tower));
MaisDocNode towerNode = rootNode.addNode(createNodeCakeTower(tower));
for (FourCornerDotCake dotCake : FourCornerDotCake.valuesByTower(tower)) {
if (stopCakePoint != null && dotCake.getStart() > stopCakePoint) {
break;
}
ApiDocNode sliceNode = towerNode.addNode(createNodeCakeSlice(dotCake));
MaisDocNode sliceNode = towerNode.addNode(createNodeCakeSlice(dotCake));
for (int i = 0; i < dotCake.getLength(); i++) {
/*ApiDocNode wordNode =*/ sliceNode.addNode(createNodeCakeWord(dotCake, i));
}
@ -176,15 +176,15 @@ public class FCDocWriter {
return doc;
}
private ApiDocNode createNodeCakeTower(FourCornerDotCakeTower tower) {
return new ApiDocNode(new TDocCakeTower(tower), tower.name(), tower.nameNice(), tower.description());
private MaisDocNode createNodeCakeTower(FourCornerDotCakeTower tower) {
return new MaisDocNode(new TDocCakeTower(tower), tower.name(), tower.nameNice(), tower.description());
}
private ApiDocNode createNodeCakeSlice(FourCornerDotCake slice) {
return new ApiDocNode(new TDocCakeSlice(slice), slice.name(), slice.nameSpec(), slice.description());
private MaisDocNode createNodeCakeSlice(FourCornerDotCake slice) {
return new MaisDocNode(new TDocCakeSlice(slice), slice.name(), slice.nameSpec(), slice.description());
}
private ApiDocNode createNodeCakeWord(FourCornerDotCake dotCake, int offset) {
private MaisDocNode createNodeCakeWord(FourCornerDotCake dotCake, int offset) {
int cakePoint = dotCake.getStart() + offset;
String idStr = String.format("0x%06X", cakePoint);
String name = idStr;
@ -203,6 +203,6 @@ public class FCDocWriter {
desc = buf.toString();
}
}
return new ApiDocNode(new TDocCakeWord(dotCake, offset), idStr, name, desc);
return new MaisDocNode(new TDocCakeWord(dotCake, offset), idStr, name, desc);
}
}

View file

@ -38,13 +38,13 @@ import org.apache.metamodel.schema.Column;
import org.apache.metamodel.schema.Relationship;
import org.apache.metamodel.schema.Schema;
import org.apache.metamodel.schema.Table;
import org.x4o.maisdoc.flake.ApiDocGenerator;
import org.x4o.maisdoc.flake.MaisDocGenerator;
import org.x4o.maisdoc.flake.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll;
import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNode;
import org.xml.sax.SAXException;
public class DocModelWriter {
@ -57,18 +57,18 @@ public class DocModelWriter {
private static final String[] CC_RS = {"relationship","Relationship","The relationships.","The telationships data."};
private ApiDocGenerator writer = null;
private ApiDoc doc = null;
private MaisDocGenerator writer = null;
private MaisDoc doc = null;
public DocModelWriter(DocModelDataStore dmds) {
if (dmds==null) {
throw new NullPointerException("Can't write null "+DocModelDataStore.class.getSimpleName());
}
doc = buildApiDoc(dmds);
writer = new ApiDocGenerator();
writer = new MaisDocGenerator();
}
public ApiDoc getApiDoc() {
public MaisDoc getApiDoc() {
return doc;
}
@ -77,8 +77,8 @@ public class DocModelWriter {
writer.write(doc,basePath);
}
private ApiDoc buildApiDoc(DocModelDataStore dmds) {
ApiDoc doc = new ApiDoc();
private MaisDoc buildApiDoc(DocModelDataStore dmds) {
MaisDoc doc = new MaisDoc();
doc.setName("MetaModel");
doc.setDescription("MetaModel generic schema overview.");
doc.setDocAbout("MetaModel of\nDataContexts");
@ -106,26 +106,26 @@ public class DocModelWriter {
doc.addAnnotatedClasses(DocModelWriterSchema.class);
doc.addAnnotatedClasses(DocModelWriterTable.class);
ApiDocConcept adc1 = doc.addConcept(new ApiDocConcept(null,C_DATA_STORE,DocModelDataStore.class));
ApiDocConcept adc2 = doc.addConcept(new ApiDocConcept(adc1,C_DATA_CONTEXT,DataContext.class));
ApiDocConcept adc3 = doc.addConcept(new ApiDocConcept(adc2,C_SCHEMA,Schema.class));
ApiDocConcept adc4 = doc.addConcept(new ApiDocConcept(adc3,C_TABLE,Table.class));
MaisDocConcept adc1 = doc.addConcept(new MaisDocConcept(null,C_DATA_STORE,DocModelDataStore.class));
MaisDocConcept adc2 = doc.addConcept(new MaisDocConcept(adc1,C_DATA_CONTEXT,DataContext.class));
MaisDocConcept adc3 = doc.addConcept(new MaisDocConcept(adc2,C_SCHEMA,Schema.class));
MaisDocConcept adc4 = doc.addConcept(new MaisDocConcept(adc3,C_TABLE,Table.class));
adc4.addChildConcepts(new ApiDocConcept(adc4, CC_RS, Relationship.class));
adc4.addChildConcepts(new MaisDocConcept(adc4, CC_RS, Relationship.class));
doc.addDocPage(DefaultPageWriterTree.createDocPage());
doc.addDocPage(DefaultPageWriterIndexAll.createDocPage());
doc.addDocPage(DefaultPageWriterHelp.createDocPage());
ApiDocNode rootNode = new ApiDocNode(dmds,"data-store","DataStore","All schemas from all data contexts.");
MaisDocNode rootNode = new MaisDocNode(dmds,"data-store","DataStore","All schemas from all data contexts.");
doc.setRootNode(rootNode);
for (Entry<String,DataContext> entry:dmds.entrySet()) {
ApiDocNode dcNode = rootNode.addNode(createNodeDataContext(entry));
MaisDocNode dcNode = rootNode.addNode(createNodeDataContext(entry));
for (Schema schema:entry.getValue().getSchemas()) {;
if (isInvalidDocSchema(schema)) {
continue;
}
ApiDocNode schemaNode = dcNode.addNode(createNodeSchema(schema));
MaisDocNode schemaNode = dcNode.addNode(createNodeSchema(schema));
for (Table table:schema.getTables()) {
schemaNode.addNode(createNodeTable(table));
}
@ -150,18 +150,18 @@ public class DocModelWriter {
return false;
}
private ApiDocNode createNodeDataContext(Entry<String,DataContext> entry) {
return new ApiDocNode(entry.getValue(),entry.getKey(),entry.getKey(),entry.getKey());
private MaisDocNode createNodeDataContext(Entry<String,DataContext> entry) {
return new MaisDocNode(entry.getValue(),entry.getKey(),entry.getKey(),entry.getKey());
}
private ApiDocNode createNodeSchema(Schema schema) {
return new ApiDocNode(schema,schema.getName(),schema.getQualifiedLabel(),schema.getName());
private MaisDocNode createNodeSchema(Schema schema) {
return new MaisDocNode(schema,schema.getName(),schema.getQualifiedLabel(),schema.getName());
}
private ApiDocNode createNodeTable(Table table) {
return new ApiDocNode(table,table.getName(),table.getQualifiedLabel(),table.getRemarks());
private MaisDocNode createNodeTable(Table table) {
return new MaisDocNode(table,table.getName(),table.getQualifiedLabel(),table.getRemarks());
}
private ApiDocNode createNodeRelationship(Relationship rs) {
private MaisDocNode createNodeRelationship(Relationship rs) {
String name = rsName(rs);
return new ApiDocNode(rs,name,name,name);
return new MaisDocNode(rs,name,name,name);
}
private String rsName(Relationship rs) {

View file

@ -37,12 +37,12 @@ import org.apache.metamodel.query.FunctionType;
import org.apache.metamodel.schema.Schema;
import org.apache.metamodel.schema.Table;
import org.apache.metamodel.schema.TableType;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.xml.sax.SAXException;
public class DocModelWriterSchema {
@ -57,16 +57,16 @@ public class DocModelWriterSchema {
return result;
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Schema.class})
public void writeSchemaTableSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Schema.class})
public void writeSchemaTableSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
MaisDocContentWriter writer = event.getWriter();
Schema schema = (Schema)event.getEventObject().getUserData();
DataContext dc = (DataContext)event.getEventObject().getParent().getUserData();
List<Table> tables = filterTables(schema,TableType.VIEW,false);
if (tables.isEmpty()) {
return;
}
writer.docTableStart("Table Summary", "All tables in the schema.",ApiDocContentCss.overviewSummary);
writer.docTableStart("Table Summary", "All tables in the schema.",MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Description");
for (Table table:tables) {
Number tableCount = 0l;
@ -76,27 +76,27 @@ public class DocModelWriterSchema {
tableCount = (Number)ds.getRow().getValue(0);
ds.close();
}
String link = ApiDocContentWriter.toSafeUri(table.getName())+"/index.html";
String link = MaisDocContentWriter.toSafeUri(table.getName())+"/index.html";
writer.docTableRowLink(link,table.getName(),"Record Count: "+tableCount);
}
writer.docTableEnd();
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Schema.class})
public void writeSchemaViewSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Schema.class})
public void writeSchemaViewSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
MaisDocContentWriter writer = event.getWriter();
Schema schema = (Schema)event.getEventObject().getUserData();
List<Table> tables = filterTables(schema,TableType.VIEW,true);
if (tables.isEmpty()) {
return;
}
writer.docTableStart("View Summary", "All views in the schema.",ApiDocContentCss.overviewSummary);
writer.docTableStart("View Summary", "All views in the schema.",MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Description");
for (Table table:schema.getTables()) {
if (!TableType.VIEW.equals(table.getType())) {
continue;
}
String link = ApiDocContentWriter.toSafeUri(table.getName())+"/index.html";
String link = MaisDocContentWriter.toSafeUri(table.getName())+"/index.html";
writer.docTableRowLink(link,table.getName(),table.getQualifiedLabel());
}
writer.docTableEnd();

View file

@ -44,13 +44,13 @@ import org.apache.metamodel.schema.Column;
import org.apache.metamodel.schema.Relationship;
import org.apache.metamodel.schema.Table;
import org.apache.metamodel.schema.TableType;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocIndexItem;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDocIndexItem;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
public class DocModelWriterTable {
@ -62,7 +62,7 @@ public class DocModelWriterTable {
dbTableFactory = new DBTableFactory();
}
private DBTable getDBTable(ApiDocWriteEvent<ApiDocNode> event) {
private DBTable getDBTable(MaisDocWriteEvent<MaisDocNode> event) {
Table table = (Table)event.getEventObject().getUserData();
if (currentDBTable!=null && currentDBTable.getTable().getQualifiedLabel().equals(table.getQualifiedLabel()))
{
@ -99,9 +99,9 @@ public class DocModelWriterTable {
return result;
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DESCRIPTION_LINKS,targetClasses={Table.class})
public void writeTableDescription(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DESCRIPTION_LINKS,targetClasses={Table.class})
public void writeTableDescription(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData();
if (!TableType.VIEW.equals(table.getType())) {
@ -115,7 +115,7 @@ public class DocModelWriterTable {
}
while (rsIn.hasNext()) {
Relationship rs = rsIn.next();
String uri = "../../"+ApiDocContentWriter.toSafeUri(rs.getForeignTable().getSchema().getName())+"/"+ApiDocContentWriter.toSafeUri(rs.getForeignTable().getName())+"/index.html";
String uri = "../../"+MaisDocContentWriter.toSafeUri(rs.getForeignTable().getSchema().getName())+"/"+MaisDocContentWriter.toSafeUri(rs.getForeignTable().getName())+"/index.html";
writer.printHref(uri, rs.getForeignTable().getName());
if (rsIn.hasNext()) {
writer.printCharacters(",&nbsp;");
@ -132,7 +132,7 @@ public class DocModelWriterTable {
}
while (rsOut.hasNext()) {
Relationship rs = rsOut.next();
String uri = "../../"+ApiDocContentWriter.toSafeUri(rs.getPrimaryTable().getSchema().getName())+"/"+ApiDocContentWriter.toSafeUri(rs.getPrimaryTable().getName())+"/index.html";
String uri = "../../"+MaisDocContentWriter.toSafeUri(rs.getPrimaryTable().getSchema().getName())+"/"+MaisDocContentWriter.toSafeUri(rs.getPrimaryTable().getName())+"/index.html";
writer.printHref(uri, rs.getPrimaryTable().getName());
if (rsOut.hasNext()) {
writer.printCharacters(",&nbsp;");
@ -143,9 +143,9 @@ public class DocModelWriterTable {
}
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DESCRIPTION_NODE,targetClasses={Table.class})
public void writeTableSqlView(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DESCRIPTION_NODE,targetClasses={Table.class})
public void writeTableSqlView(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData();
// fixme or only normal
@ -166,9 +166,9 @@ public class DocModelWriterTable {
}
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={3},contentGroup="Columns",contentGroupType="summary")
public void writeTableSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={3},contentGroup="Columns",contentGroupType="summary")
public void writeTableSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData();
if (TableType.VIEW.equals(table.getType())) {
writer.docTableStart("Column Summary", "All column of the view.",null);
@ -177,14 +177,14 @@ public class DocModelWriterTable {
}
writer.docTableHeader("Name", "Description");
for (Column column:table.getColumns()) {
writer.docTableRowLink("#"+ApiDocContentWriter.toSafeUri(column.getName()),column.getName(),column.getQualifiedLabel());
writer.docTableRowLink("#"+MaisDocContentWriter.toSafeUri(column.getName()),column.getName(),column.getQualifiedLabel());
}
writer.docTableEnd();
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Primary Key",contentGroupType="summary")
public void writeTablePKSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Primary Key",contentGroupType="summary")
public void writeTablePKSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event);
if (tableDB==null) {
@ -193,7 +193,7 @@ public class DocModelWriterTable {
List<Column> cols = table.getPrimaryKeys();
for (int i=0;i<cols.size();i++) {
Column column = cols.get(i);
writer.printHref("#"+ApiDocContentWriter.toSafeUri(column.getName()), column.getName());
writer.printHref("#"+MaisDocContentWriter.toSafeUri(column.getName()), column.getName());
if (i<cols.size()-1) {
writer.printCharacters(", ");
}
@ -215,7 +215,7 @@ public class DocModelWriterTable {
for (int i=0;i<cols.size();i++) {
String column = cols.get(i);
writer.printHref("#"+ApiDocContentWriter.toSafeUri(column), column);
writer.printHref("#"+MaisDocContentWriter.toSafeUri(column), column);
if (i<cols.size()-1) {
writer.printCharacters(", ");
}
@ -228,9 +228,9 @@ public class DocModelWriterTable {
}
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Indexes",contentGroupType="summary")
public void writeTableIDXSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Indexes",contentGroupType="summary")
public void writeTableIDXSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event);
if (tableDB==null) {
@ -242,7 +242,7 @@ public class DocModelWriterTable {
writer.printTagCharacters(Tag.h3, "Indexed Columns");
writer.printTagStart(Tag.code);
for (Column column:columns) {
writer.printHref("#"+ApiDocContentWriter.toSafeUri(column.getName()), column.getName());
writer.printHref("#"+MaisDocContentWriter.toSafeUri(column.getName()), column.getName());
}
writer.printTagEnd(Tag.code);
} else {
@ -260,7 +260,7 @@ public class DocModelWriterTable {
buf.append(",");
}
}
writer.docTableRowLink("#"+ApiDocContentWriter.toSafeUri(index.getName()),index.getName(),buf.toString());
writer.docTableRowLink("#"+MaisDocContentWriter.toSafeUri(index.getName()),index.getName(),buf.toString());
}
writer.docTableEnd();
@ -270,17 +270,17 @@ public class DocModelWriterTable {
}
}
private void writeSqlBlock(ApiDocContentWriter writer,String sql) throws IOException {
writer.printTagStart(Tag.div,ApiDocContentCss.block);
private void writeSqlBlock(MaisDocContentWriter writer,String sql) throws IOException {
writer.printTagStart(Tag.div,MaisDocContentCss.block);
writer.printTagStart(Tag.pre);
writer.printCharacters(sql);
writer.printTagEnd(Tag.pre);
writer.printTagEnd(Tag.div);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Indexes",contentGroupType="overview")
public void writeTableDetailIndex(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Indexes",contentGroupType="overview")
public void writeTableDetailIndex(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
//Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event);
if (tableDB==null) {
@ -310,7 +310,7 @@ public class DocModelWriterTable {
writer.printTagEnd(Tag.pre);
writer.printTagStart(Tag.div,ApiDocContentCss.block);
writer.printTagStart(Tag.div,MaisDocContentCss.block);
writer.printCharacters("Type: ");
writer.printCharacters(index.getType().name());
writer.printTagEnd(Tag.div);
@ -321,14 +321,14 @@ public class DocModelWriterTable {
writer.printTagStart(Tag.dl);
writer.printTagStart(Tag.dt);
writer.printTagStart(Tag.span,ApiDocContentCss.strong);
writer.printTagStart(Tag.span,MaisDocContentCss.strong);
writer.printCharacters("Columns:");
writer.printTagEnd(Tag.span);
writer.printTagEnd(Tag.dt);
for (DBIndexColumn column:index.getIndexColumns()) {
writer.printTagStart(Tag.dd);
writer.printTagStart(Tag.code);
writer.printHref("#"+ApiDocContentWriter.toSafeUri(column.getColumn()), column.getColumn());
writer.printHref("#"+MaisDocContentWriter.toSafeUri(column.getColumn()), column.getColumn());
writer.printTagEnd(Tag.code);
writer.printCharacters(" ORDER ");
if (column.getAscending()!=null && column.getAscending()) {
@ -344,14 +344,14 @@ public class DocModelWriterTable {
}
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Columns",contentGroupType="overview")
public void writeTableDetail(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Columns",contentGroupType="overview")
public void writeTableDetail(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event);
for (Column column:table.getColumns()) {
ApiDocIndexItem indexItem = new ApiDocIndexItem();
MaisDocIndexItem indexItem = new MaisDocIndexItem();
indexItem.setLinkText(column.getName());
event.getDoc().getNodeData().addIndexItem(indexItem);
@ -381,7 +381,7 @@ public class DocModelWriterTable {
writer.printTagEnd(Tag.pre);
writer.printTagStart(Tag.div,ApiDocContentCss.block);
writer.printTagStart(Tag.div,MaisDocContentCss.block);
writer.printCharacters("Description: ");
writer.printCharacters(column.getQuotedName());
writer.printTagEnd(Tag.div);
@ -393,7 +393,7 @@ public class DocModelWriterTable {
idx = tableDB.getIndexesByColumn(column.getName());
}
writer.printTagStart(Tag.dt);
writer.printTagStart(Tag.span,ApiDocContentCss.strong);
writer.printTagStart(Tag.span,MaisDocContentCss.strong);
writer.printCharacters("Indexes:");
writer.printTagEnd(Tag.span);
writer.printTagEnd(Tag.dt);
@ -403,7 +403,7 @@ public class DocModelWriterTable {
writer.printTagStart(Tag.code);
for (int i=0;i<idx.size();i++) {
DBIndex index = idx.get(i);
writer.printHref("#"+ApiDocContentWriter.toSafeUri(index.getName()), index.getName());
writer.printHref("#"+MaisDocContentWriter.toSafeUri(index.getName()), index.getName());
if (i<idx.size()-1) {
writer.printCharacters(",");
}
@ -421,7 +421,7 @@ public class DocModelWriterTable {
}
writer.printTagStart(Tag.dt);
writer.printTagStart(Tag.span,ApiDocContentCss.strong);
writer.printTagStart(Tag.span,MaisDocContentCss.strong);
writer.printCharacters("References:");
writer.printTagEnd(Tag.span);
writer.printTagEnd(Tag.dt);

View file

@ -29,14 +29,14 @@ import java.util.Calendar;
import java.util.List;
import java.util.Map;
import org.x4o.maisdoc.flake.ApiDocGenerator;
import org.x4o.maisdoc.flake.MaisDocGenerator;
import org.x4o.maisdoc.flake.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll;
import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocRemoteClass;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocRemoteClass;
import org.x4o.sax3.SAX3WriterXml;
import org.x4o.sax3.io.SAX3PropertyConfig;
import org.x4o.sax3.io.SAX3PropertyConfig.PropertyConfigItem;
@ -141,8 +141,8 @@ public class EldDocWriter {
public void writeDocumentation() throws ElementException {
try {
File basePath = propertyConfig.getPropertyFile(OUTPUT_PATH);
ApiDocGenerator writer = new ApiDocGenerator();
ApiDoc doc = buildLanguageDoc();
MaisDocGenerator writer = new MaisDocGenerator();
MaisDoc doc = buildLanguageDoc();
writer.write(doc, basePath);
} catch (IOException e) {
throw new ElementException(e);
@ -153,10 +153,10 @@ public class EldDocWriter {
* Creates a fully configured ApiDco object.
* @return The ApiDoc configured to write eld documentation.
*/
private ApiDoc buildLanguageDoc() {
private MaisDoc buildLanguageDoc() {
// Generic config
ApiDoc doc = new ApiDoc();
MaisDoc doc = new MaisDoc();
doc.setName( propertyConfig.getPropertyString(DOC_NAME, DEFAULT_NAME));
doc.setDescription( propertyConfig.getPropertyString(DOC_DESCRIPTION, DEFAULT_DESCRIPTION));
doc.setDocAbout( propertyConfig.getPropertyString(DOC_ABOUT, createLanguageAbout()));
@ -180,12 +180,12 @@ public class EldDocWriter {
Map<String,String> javadocLinkOfflineMap = propertyConfig.getPropertyMap(JAVADOC_LINK_OFFLINE);
if (javadocLinkList!=null) {
for (String javadocUrl:javadocLinkList) {
doc.addRemoteClass(new ApiDocRemoteClass(javadocUrl));
doc.addRemoteClass(new MaisDocRemoteClass(javadocUrl));
}
}
if (javadocLinkOfflineMap!=null) {
for (Map.Entry<String,String> offlineLink:javadocLinkOfflineMap.entrySet()) {
doc.addRemoteClass(new ApiDocRemoteClass(offlineLink.getKey(),offlineLink.getValue()));
doc.addRemoteClass(new MaisDocRemoteClass(offlineLink.getKey(),offlineLink.getValue()));
}
}
@ -203,20 +203,20 @@ public class EldDocWriter {
doc.addAnnotatedClasses(EldDocWriterElementNamespace.class);
doc.addAnnotatedClasses(EldDocWriterElementInterface.class);
ApiDocConcept adcRoot = doc.addConcept(new ApiDocConcept(null,C_CONTEXT,X4OLanguage.class));
ApiDocConcept adcMod = doc.addConcept(new ApiDocConcept(adcRoot,C_MODULE,X4OLanguageModule.class));
ApiDocConcept adcIface = doc.addConcept(new ApiDocConcept(adcMod,C_INTERFACE,ElementInterface.class));
ApiDocConcept adcNs = doc.addConcept(new ApiDocConcept(adcMod,C_NAMESPACE,ElementNamespace.class));
ApiDocConcept adcEc = doc.addConcept(new ApiDocConcept(adcNs,C_ELEMENT,ElementClass.class));
MaisDocConcept adcRoot = doc.addConcept(new MaisDocConcept(null,C_CONTEXT,X4OLanguage.class));
MaisDocConcept adcMod = doc.addConcept(new MaisDocConcept(adcRoot,C_MODULE,X4OLanguageModule.class));
MaisDocConcept adcIface = doc.addConcept(new MaisDocConcept(adcMod,C_INTERFACE,ElementInterface.class));
MaisDocConcept adcNs = doc.addConcept(new MaisDocConcept(adcMod,C_NAMESPACE,ElementNamespace.class));
MaisDocConcept adcEc = doc.addConcept(new MaisDocConcept(adcNs,C_ELEMENT,ElementClass.class));
// mm maybe redo something here
adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_ATTRIBUTE_H,ElementNamespaceAttribute.class));
adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_CONFIGURATOR_G,ElementConfiguratorGlobal.class));
adcMod.addChildConcepts(new ApiDocConcept(adcMod,CC_BINDING,ElementBindingHandler.class));
adcIface.addChildConcepts(new ApiDocConcept(adcMod,CC_ATTRIBUTE,ElementClassAttribute.class));
adcIface.addChildConcepts(new ApiDocConcept(adcMod,CC_CONFIGURATOR,ElementConfigurator.class));
adcEc.addChildConcepts(new ApiDocConcept(adcEc,CC_CONFIGURATOR,ElementConfigurator.class));
adcEc.addChildConcepts(new ApiDocConcept(adcEc,CC_ATTRIBUTE,ElementClassAttribute.class));
adcMod.addChildConcepts(new MaisDocConcept(adcMod,CC_ATTRIBUTE_H,ElementNamespaceAttribute.class));
adcMod.addChildConcepts(new MaisDocConcept(adcMod,CC_CONFIGURATOR_G,ElementConfiguratorGlobal.class));
adcMod.addChildConcepts(new MaisDocConcept(adcMod,CC_BINDING,ElementBindingHandler.class));
adcIface.addChildConcepts(new MaisDocConcept(adcMod,CC_ATTRIBUTE,ElementClassAttribute.class));
adcIface.addChildConcepts(new MaisDocConcept(adcMod,CC_CONFIGURATOR,ElementConfigurator.class));
adcEc.addChildConcepts(new MaisDocConcept(adcEc,CC_CONFIGURATOR,ElementConfigurator.class));
adcEc.addChildConcepts(new MaisDocConcept(adcEc,CC_ATTRIBUTE,ElementClassAttribute.class));
// Non-tree pages config
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_XTREE)) { doc.addDocPage(EldDocXTreePageWriter.createDocPage()); }
@ -225,49 +225,49 @@ public class EldDocWriter {
if (propertyConfig.getPropertyBoolean(PAGE_PRINT_HELP)) { doc.addDocPage(DefaultPageWriterHelp.createDocPage()); }
// Doc tree config
ApiDocNode rootNode = new ApiDocNode(language,"language",getLanguageNameUpperCase()+" Language","The X4O "+getLanguageNameUpperCase()+" Language");
MaisDocNode rootNode = new MaisDocNode(language,"language",getLanguageNameUpperCase()+" Language","The X4O "+getLanguageNameUpperCase()+" Language");
doc.setRootNode(rootNode);
for (X4OLanguageModule mod:language.getLanguageModules()) { ApiDocNode modNode = rootNode.addNode(createNodeLanguageModule(mod));
for (X4OLanguageModule mod:language.getLanguageModules()) { MaisDocNode modNode = rootNode.addNode(createNodeLanguageModule(mod));
for (ElementBindingHandler bind:mod.getElementBindingHandlers()) { modNode.addNode(createNodeElementBindingHandler(bind)); }
for (ElementConfiguratorGlobal conf:mod.getElementConfiguratorGlobals()) { modNode.addNode(createNodeElementConfiguratorGlobal(conf)); }
for (ElementInterface iface:mod.getElementInterfaces()) { ApiDocNode ifaceNode = modNode.addNode(createNodeElementInterface(iface));
for (ElementInterface iface:mod.getElementInterfaces()) { MaisDocNode ifaceNode = modNode.addNode(createNodeElementInterface(iface));
for (ElementClassAttribute eca:iface.getElementClassAttributes()) { ifaceNode.addNode(createNodeElementClassAttribute(eca)); }
for (ElementConfigurator conf:iface.getElementConfigurators()) { ifaceNode.addNode(createNodeElementConfigurator(conf)); } }
for (ElementNamespace ns:mod.getElementNamespaces()) { ApiDocNode nsNode = modNode.addNode(createNodeElementNamespace(ns));
for (ElementNamespace ns:mod.getElementNamespaces()) { MaisDocNode nsNode = modNode.addNode(createNodeElementNamespace(ns));
for (ElementNamespaceAttribute attr:ns.getElementNamespaceAttributes()) { nsNode.addNode(createNodeElementNamespaceAttribute(attr)); }
for (ElementClass ec:ns.getElementClasses()) { ApiDocNode ecNode = nsNode.addNode(createNodeElementClass(ec));
for (ElementClass ec:ns.getElementClasses()) { MaisDocNode ecNode = nsNode.addNode(createNodeElementClass(ec));
for (ElementClassAttribute eca:ec.getElementClassAttributes()) { ecNode.addNode(createNodeElementClassAttribute(eca)); }
for (ElementConfigurator conf:ec.getElementConfigurators()) { ecNode.addNode(createNodeElementConfigurator(conf)); } } }
}
return doc;
}
private ApiDocNode createNodeElementBindingHandler(ElementBindingHandler bind) {
return new ApiDocNode(bind,bind.getId(),bind.getId(),bind.getDescription());
private MaisDocNode createNodeElementBindingHandler(ElementBindingHandler bind) {
return new MaisDocNode(bind,bind.getId(),bind.getId(),bind.getDescription());
}
private ApiDocNode createNodeElementNamespaceAttribute(ElementNamespaceAttribute attr) {
return new ApiDocNode(attr,attr.getId(),attr.getId(),attr.getDescription());
private MaisDocNode createNodeElementNamespaceAttribute(ElementNamespaceAttribute attr) {
return new MaisDocNode(attr,attr.getId(),attr.getId(),attr.getDescription());
}
private ApiDocNode createNodeElementConfiguratorGlobal(ElementConfiguratorGlobal conf) {
return new ApiDocNode(conf,conf.getId(),conf.getId(),conf.getDescription());
private MaisDocNode createNodeElementConfiguratorGlobal(ElementConfiguratorGlobal conf) {
return new MaisDocNode(conf,conf.getId(),conf.getId(),conf.getDescription());
}
private ApiDocNode createNodeElementConfigurator(ElementConfigurator conf) {
return new ApiDocNode(conf,conf.getId(),conf.getId(),conf.getDescription());
private MaisDocNode createNodeElementConfigurator(ElementConfigurator conf) {
return new MaisDocNode(conf,conf.getId(),conf.getId(),conf.getDescription());
}
private ApiDocNode createNodeLanguageModule(X4OLanguageModule mod) {
return new ApiDocNode(mod,mod.getId(),mod.getId(),mod.getDescription());
private MaisDocNode createNodeLanguageModule(X4OLanguageModule mod) {
return new MaisDocNode(mod,mod.getId(),mod.getId(),mod.getDescription());
}
private ApiDocNode createNodeElementInterface(ElementInterface iface) {
return new ApiDocNode(iface,iface.getId(),iface.getId(),iface.getDescription());
private MaisDocNode createNodeElementInterface(ElementInterface iface) {
return new MaisDocNode(iface,iface.getId(),iface.getId(),iface.getDescription());
}
private ApiDocNode createNodeElementNamespace(ElementNamespace ns) {
return new ApiDocNode(ns,ns.getId(),ns.getUri(),ns.getDescription());
private MaisDocNode createNodeElementNamespace(ElementNamespace ns) {
return new MaisDocNode(ns,ns.getId(),ns.getUri(),ns.getDescription());
}
private ApiDocNode createNodeElementClass(ElementClass ec) {
return new ApiDocNode(ec,ec.getId(),ec.getId(),ec.getDescription());
private MaisDocNode createNodeElementClass(ElementClass ec) {
return new MaisDocNode(ec,ec.getId(),ec.getId(),ec.getDescription());
}
private ApiDocNode createNodeElementClassAttribute(ElementClassAttribute eca) {
return new ApiDocNode(eca,eca.getId(),eca.getId(),eca.getDescription());
private MaisDocNode createNodeElementClassAttribute(ElementClassAttribute eca) {
return new MaisDocNode(eca,eca.getId(),eca.getId(),eca.getDescription());
}
private String createPageSubTitle() {

View file

@ -25,15 +25,15 @@ package org.x4o.xml.eld.doc;
import java.io.IOException;
import java.util.List;
import org.x4o.maisdoc.flake.ApiDocContentPrinter;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocNodeData;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentPrinter;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeData;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.xml.eld.doc.EldDocXTreePageWriter.TreeNode;
import org.x4o.xml.element.ElementClass;
@ -49,10 +49,10 @@ import org.x4o.xml.lang.X4OLanguageModule;
* @author Willem Cazander
* @version 1.0 May 29, 2013
*/
public class EldDocWriterElementClass implements ApiDocContentPrinter {
public class EldDocWriterElementClass implements MaisDocContentPrinter {
@ApiDocNodeDataConfiguratorMethod(targetClasses={ElementClass.class})
public void configNavBar(ApiDoc doc,ApiDocNode node,ApiDocNodeData data) {
@MaisDocNodeDataConfiguratorMethod(targetClasses={ElementClass.class})
public void configNavBar(MaisDoc doc,MaisDocNode node,MaisDocNodeData data) {
/*
ElementClass ec = (ElementClass)node.getUserData();
Collection<ElementClassAttribute> list = ec.getElementClassAttributes();
@ -64,18 +64,18 @@ public class EldDocWriterElementClass implements ApiDocContentPrinter {
clearHrefContentGroup(doc,node,"summary","configurator",ElementConfigurator.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={1},contentGroup="element",contentGroupType="summary")
public void writeElementX4OSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={1},contentGroup="element",contentGroupType="summary")
public void writeElementX4OSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
printApiTableBean(event, "Element", "class","id","description");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementClassAttribute(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementClassAttribute(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
printApiTable(event,"Element Class Attribute Summary",ElementClassAttribute.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={3},contentGroup="configurator",contentGroupType="summary")
public void writeElementConfigurator(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={3},contentGroup="configurator",contentGroupType="summary")
public void writeElementConfigurator(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
printApiTable(event,"Element Configurator Summary",ElementConfigurator.class);
}
@ -97,8 +97,8 @@ public class EldDocWriterElementClass implements ApiDocContentPrinter {
}
*/
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={10},contentGroup="bean",contentGroupType="summary")
public void writeElementObjectPropertiesSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementClass.class},nodeBodyOrders={10},contentGroup="bean",contentGroupType="summary")
public void writeElementObjectPropertiesSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ElementClass ec = (ElementClass)event.getEventObject().getUserData();
Class<?> beanClass = ec.getObjectClass();
if (beanClass==null) {
@ -107,9 +107,9 @@ public class EldDocWriterElementClass implements ApiDocContentPrinter {
printApiTableBeanClass(event, beanClass, "Object");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DESCRIPTION_LINKS,targetClasses={ElementClass.class})
public void writeElementRelationLinks(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DESCRIPTION_LINKS,targetClasses={ElementClass.class})
public void writeElementRelationLinks(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
ElementClass ec = (ElementClass)event.getEventObject().getUserData();
ElementNamespace ns = (ElementNamespace)event.getEventObject().getParent().getUserData();
X4OLanguageModule mod = (X4OLanguageModule)event.getEventObject().getParent().getParent().getUserData();
@ -168,11 +168,11 @@ public class EldDocWriterElementClass implements ApiDocContentPrinter {
if (pathPrefix!=null) {
buf.append(pathPrefix);
}
buf.append(ApiDocContentWriter.toSafeUri(mod.getId()));
buf.append(MaisDocContentWriter.toSafeUri(mod.getId()));
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(namespace.getId()));
buf.append(MaisDocContentWriter.toSafeUri(namespace.getId()));
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(ec.getId()));
buf.append(MaisDocContentWriter.toSafeUri(ec.getId()));
buf.append("/index.html");
return buf.toString();
}

View file

@ -24,14 +24,14 @@ package org.x4o.xml.eld.doc;
import java.io.IOException;
import org.x4o.maisdoc.flake.ApiDocContentPrinter;
import org.x4o.maisdoc.flake.ApiDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocNodeData;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentPrinter;
import org.x4o.maisdoc.flake.MaisDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeData;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementConfigurator;
@ -44,33 +44,33 @@ import org.xml.sax.SAXException;
* @author Willem Cazander
* @version 1.0 Aug 17, 2013
*/
public class EldDocWriterElementInterface implements ApiDocContentPrinter {
public class EldDocWriterElementInterface implements MaisDocContentPrinter {
@ApiDocNodeDataConfiguratorMethod(targetClasses={ElementInterface.class})
public void configNavBar(ApiDoc doc,ApiDocNode node,ApiDocNodeData data) {
@MaisDocNodeDataConfiguratorMethod(targetClasses={ElementInterface.class})
public void configNavBar(MaisDoc doc,MaisDocNode node,MaisDocNodeData data) {
clearHrefContentGroup(doc,node,"summary","attribute",ElementClassAttribute.class);
clearHrefContentGroup(doc,node,"summary","binding",ElementBindingHandler.class);
clearHrefContentGroup(doc,node,"summary","configurator",ElementConfigurator.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event,"Interface","description");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementClassAttribute(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={2},contentGroup="attribute",contentGroupType="summary")
public void writeElementClassAttribute(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Element Class Attribute Summary",ElementClassAttribute.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={3},contentGroup="binding",contentGroupType="summary")
public void writeElementBindingHandler(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={3},contentGroup="binding",contentGroupType="summary")
public void writeElementBindingHandler(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Element Binding Handler Summary",ElementBindingHandler.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
public void writeElementConfigurator(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementInterface.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
public void writeElementConfigurator(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Element Configurator Summary",ElementConfigurator.class);
}
}

View file

@ -24,14 +24,14 @@ package org.x4o.xml.eld.doc;
import java.io.IOException;
import org.x4o.maisdoc.flake.ApiDocContentPrinter;
import org.x4o.maisdoc.flake.ApiDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocNodeData;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentPrinter;
import org.x4o.maisdoc.flake.MaisDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeData;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.xml.element.ElementClass;
import org.x4o.xml.element.ElementNamespace;
import org.xml.sax.SAXException;
@ -42,20 +42,20 @@ import org.xml.sax.SAXException;
* @author Willem Cazander
* @version 1.0 Aug 14, 2013
*/
public class EldDocWriterElementNamespace implements ApiDocContentPrinter {
public class EldDocWriterElementNamespace implements MaisDocContentPrinter {
@ApiDocNodeDataConfiguratorMethod(targetClasses={ElementNamespace.class})
public void configNavBar(ApiDoc doc,ApiDocNode node,ApiDocNodeData data) {
@MaisDocNodeDataConfiguratorMethod(targetClasses={ElementNamespace.class})
public void configNavBar(MaisDoc doc,MaisDocNode node,MaisDocNodeData data) {
clearHrefContentGroup(doc,node,"summary","element",ElementClass.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={1},contentGroup="namespace",contentGroupType="summary")
public void writeElementNamespaceBeanProperties(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event,"Namespace","description","elementClasses","elementNamespaceInstanceProvider","prefixMapping");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary")
public void writeElementNamespaceElements(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementNamespace.class},nodeBodyOrders={2},contentGroup="element",contentGroupType="summary")
public void writeElementNamespaceElements(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Element Summary",ElementClass.class);
}

View file

@ -24,13 +24,13 @@ package org.x4o.xml.eld.doc;
import java.io.IOException;
import org.x4o.maisdoc.flake.ApiDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentPrinter;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.MaisDocContentPrinter;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClassAttribute;
import org.x4o.xml.element.ElementConfigurator;
@ -45,31 +45,31 @@ import org.xml.sax.SAXException;
* @author Willem Cazander
* @version 1.0 May 29, 2013
*/
public class EldDocWriterLanguage implements ApiDocContentPrinter {
public class EldDocWriterLanguage implements MaisDocContentPrinter {
// TODO move
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementBindingHandler.class})
public void writeElementBindingHandlerBean(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementBindingHandler.class})
public void writeElementBindingHandlerBean(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event,"BindingHandler","description");
}
// TODO move
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementConfigurator.class})
public void writeElementConfiguratorBean(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementConfigurator.class})
public void writeElementConfiguratorBean(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event,"Configurator","description");
}
// TODO move
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={ElementClassAttribute.class})
public void writeElementClassAttributeBean(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={ElementClassAttribute.class})
public void writeElementClassAttributeBean(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTableBean(event,"Element Class Attribute","description");
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguage.class},nodeBodyOrders={1})
public void writeLanguageSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
ApiDocContentWriter writer = event.getWriter();
ApiDocNode node = event.getEventObject();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguage.class},nodeBodyOrders={1})
public void writeLanguageSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
MaisDocContentWriter writer = event.getWriter();
MaisDocNode node = event.getEventObject();
X4OLanguage language = (X4OLanguage)node.getUserData();
int attrHandlers = 0;
int bindHandlers = 0;
@ -87,7 +87,7 @@ public class EldDocWriterLanguage implements ApiDocContentPrinter {
attrHandlers += ns.getElementNamespaceAttributes().size();
}
}
writer.docTableStart("Language Summary", "Language Stats Summary.",ApiDocContentCss.overviewSummary);
writer.docTableStart("Language Summary", "Language Stats Summary.",MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Value");
writer.docTableRow("LanguageName:", ""+language.getLanguageName(), null);
writer.docTableRow("LanguageVersion:",""+language.getLanguageVersion(),null);
@ -101,21 +101,21 @@ public class EldDocWriterLanguage implements ApiDocContentPrinter {
writer.docTableEnd();
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguage.class},nodeBodyOrders={2})
public void writeModulesSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguage.class},nodeBodyOrders={2})
public void writeModulesSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Module Summary",X4OLanguageModule.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguage.class},nodeBodyOrders={3})
public void writeNamespaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
ApiDocContentWriter writer = event.getWriter();
ApiDocNode node = event.getEventObject();
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguage.class},nodeBodyOrders={3})
public void writeNamespaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
MaisDocContentWriter writer = event.getWriter();
MaisDocNode node = event.getEventObject();
X4OLanguage language = (X4OLanguage)node.getUserData();
writer.docTableStart("Namespace Summary", "All Language Namespaces Overview",ApiDocContentCss.overviewSummary);
writer.docTableStart("Namespace Summary", "All Language Namespaces Overview",MaisDocContentCss.overviewSummary);
writer.docTableHeader("ID", "URI");
for (X4OLanguageModule mod:language.getLanguageModules()) {
for (ElementNamespace ns:mod.getElementNamespaces()) {
writer.docTableRowLink("language/"+ApiDocContentWriter.toSafeUri(mod.getId())+"/"+ApiDocContentWriter.toSafeUri(ns.getId())+"/index.html",ns.getId(),ns.getUri());
writer.docTableRowLink("language/"+MaisDocContentWriter.toSafeUri(mod.getId())+"/"+MaisDocContentWriter.toSafeUri(ns.getId())+"/index.html",ns.getId(),ns.getUri());
}
}
writer.docTableEnd();

View file

@ -26,14 +26,14 @@ import org.x4o.xml.element.ElementNamespaceAttribute;
import java.io.IOException;
import org.x4o.maisdoc.flake.ApiDocContentPrinter;
import org.x4o.maisdoc.flake.ApiDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocNodeData;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.flake.MaisDocContentPrinter;
import org.x4o.maisdoc.flake.MaisDocNodeDataConfiguratorMethod;
import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeData;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementConfigurator;
import org.x4o.xml.element.ElementInterface;
@ -47,10 +47,10 @@ import org.xml.sax.SAXException;
* @author Willem Cazander
* @version 1.0 Aug 10, 2013
*/
public class EldDocWriterLanguageModule implements ApiDocContentPrinter {
public class EldDocWriterLanguageModule implements MaisDocContentPrinter {
@ApiDocNodeDataConfiguratorMethod(targetClasses={X4OLanguageModule.class})
public void configNavBar(ApiDoc doc,ApiDocNode node,ApiDocNodeData data) {
@MaisDocNodeDataConfiguratorMethod(targetClasses={X4OLanguageModule.class})
public void configNavBar(MaisDoc doc,MaisDocNode node,MaisDocNodeData data) {
clearHrefContentGroup(doc,node,"summary","interface",ElementInterface.class);
clearHrefContentGroup(doc,node,"summary","binding",ElementBindingHandler.class);
clearHrefContentGroup(doc,node,"summary","attribute",ElementNamespaceAttribute.class);
@ -58,28 +58,28 @@ public class EldDocWriterLanguageModule implements ApiDocContentPrinter {
clearHrefContentGroup(doc,node,"summary","namespace",ElementNamespace.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
public void writeInterfaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={1},contentGroup="interface",contentGroupType="summary")
public void writeInterfaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Interface Summary",ElementInterface.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={2},contentGroup="binding",contentGroupType="summary")
public void writeBindingSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={2},contentGroup="binding",contentGroupType="summary")
public void writeBindingSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Binding Summary",ElementBindingHandler.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={3},contentGroup="attribute",contentGroupType="summary")
public void writeAttributeSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={3},contentGroup="attribute",contentGroupType="summary")
public void writeAttributeSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Attribute Summary",ElementNamespaceAttribute.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
public void writeConfigutorSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={4},contentGroup="configurator",contentGroupType="summary")
public void writeConfigutorSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Configurator Summary",ElementConfigurator.class);
}
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={5},contentGroup="namespace",contentGroupType="summary")
public void writeNamespaceSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException {
@MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={X4OLanguageModule.class},nodeBodyOrders={5},contentGroup="namespace",contentGroupType="summary")
public void writeNamespaceSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
printApiTable(event,"Namespace Summary",ElementNamespace.class);
}
}

View file

@ -28,13 +28,13 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.xml.element.ElementBindingHandler;
import org.x4o.xml.element.ElementClass;
@ -49,14 +49,14 @@ import org.x4o.xml.lang.X4OLanguageModule;
* @author Willem Cazander
* @version 1.0 May 29, 2013
*/
public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiDocPageWriter {
public class EldDocXTreePageWriter extends DefaultPageWriterTree implements MaisDocPageWriter {
public static ApiDocPage createDocPage() {
return new ApiDocPage("overview-xtree","XTree","XTree of dom elements.",new EldDocXTreePageWriter());
public static MaisDocPage createDocPage() {
return new MaisDocPage("overview-xtree","XTree","XTree of dom elements.",new EldDocXTreePageWriter());
}
// TODO: rm this old tree code;
private void walkTree(TreeNode node,ApiDocContentWriter writer,String pathPrefix) throws IOException {
private void walkTree(TreeNode node,MaisDocContentWriter writer,String pathPrefix) throws IOException {
String href = toElementUri(pathPrefix,node.module,node.namespace,node.elementClass);
writer.printTagStart(Tag.ul);
@ -75,12 +75,12 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
/**
* TODO: remove this
* @see org.x4o.maisdoc.flake.DefaultPageWriterTree#writePageContent(org.x4o.maisdoc.model.ApiDocWriteEvent)
* @see org.x4o.maisdoc.flake.DefaultPageWriterTree#writePageContent(org.x4o.maisdoc.model.MaisDocWriteEvent)
*/
@Override
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException {
public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
//selectRootNode(e.getDoc()); // create
ApiDoc doc = e.getDoc();
MaisDoc doc = e.getDoc();
X4OLanguage language = (X4OLanguage)doc.getRootNode().getUserData();
String pathPrefix = "language/";
@ -112,11 +112,11 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
if (pathPrefix!=null) {
buf.append(pathPrefix);
}
buf.append(ApiDocContentWriter.toSafeUri(mod.getId()));
buf.append(MaisDocContentWriter.toSafeUri(mod.getId()));
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(namespace.getId()));
buf.append(MaisDocContentWriter.toSafeUri(namespace.getId()));
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(ec.getId()));
buf.append(MaisDocContentWriter.toSafeUri(ec.getId()));
buf.append("/index.html");
return buf.toString();
}
@ -124,10 +124,10 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
/**
* Overrided to select the dom view of the tree.
* @see org.x4o.maisdoc.flake.DefaultPageWriterTree#selectRootNode(org.x4o.maisdoc.model.ApiDoc)
* @see org.x4o.maisdoc.flake.DefaultPageWriterTree#selectRootNode(org.x4o.maisdoc.model.MaisDoc)
*/
@Override
protected ApiDocNode selectRootNode(ApiDoc doc) {
protected MaisDocNode selectRootNode(MaisDoc doc) {
try {
return createXTree(doc);
} catch (IOException e) {
@ -135,10 +135,10 @@ public class EldDocXTreePageWriter extends DefaultPageWriterTree implements ApiD
}
}
private ApiDocNode createXTree(ApiDoc doc) throws IOException {
private MaisDocNode createXTree(MaisDoc doc) throws IOException {
X4OLanguage language = (X4OLanguage)doc.getRootNode().getUserData();
ApiDocNode root = new ApiDocNode(language,"root","Root","Language root");
MaisDocNode root = new MaisDocNode(language,"root","Root","Language root");
List<TreeNode> rootNodes = new ArrayList<TreeNode>(3);
for (X4OLanguageModule mod:language.getLanguageModules()) {

View file

@ -29,9 +29,9 @@ package org.x4o.maisdoc;
import java.util.List;
public class ApiDocProject {
public class MaisDocProject {
private Class<?> frameNavConceptClass = null;
private List<ApiDocProjectPerspective> perspectives;
private List<MaisDocProjectPerspective> perspectives;
}

View file

@ -30,11 +30,11 @@ package org.x4o.maisdoc;
import java.util.ArrayList;
import java.util.List;
public class ApiDocProjectPerspective {
public class MaisDocProjectPerspective {
private List<ApiDocProjectPerspectiveWasp> wasps = new ArrayList<>();
private List<MaisDocProjectPerspectiveWing> wasps = new ArrayList<>();
public List<ApiDocProjectPerspectiveWasp> getWasps() {
public List<MaisDocProjectPerspectiveWing> getWasps() {
return wasps;
}
}

View file

@ -27,13 +27,13 @@
package org.x4o.maisdoc;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
public interface ApiDocProjectPerspectiveWasp {
public interface MaisDocProjectPerspectiveWing {
// note: a bit unsafe, TODO: Add interface for only ~3 methods of ApiDoc
void configureWasp(ApiDoc doc, ApiDocNode waspNode);
void configureWasp(MaisDoc doc, MaisDocNode waspNode);
// use: doc.addTreeNodePageModeClass
// use: doc.addAnnotatedClasses
// use: doc.addConcept

View file

@ -29,14 +29,14 @@ import java.util.Calendar;
import java.util.List;
import java.util.Map;
import org.x4o.maisdoc.flake.ApiDocGenerator;
import org.x4o.maisdoc.flake.MaisDocGenerator;
import org.x4o.maisdoc.flake.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll;
import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocRemoteClass;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocRemoteClass;
import org.x4o.sax3.SAX3WriterXml;
import org.x4o.sax3.io.SAX3PropertyConfig;
import org.x4o.sax3.io.SAX3PropertyConfig.PropertyConfigItem;
@ -49,7 +49,7 @@ import org.xml.sax.SAXException;
* @version 1.0 Aug 26, 2010
*/
@Deprecated // marked until make working to write multiple project or mix api docs in one big tree
public class ApiDocWriter {
public class MaisDocWriter {
// NOTE: this class is unused, and is waiting for ApiDocProject code and replaces most code in EldDocWriter to here.
@ -97,7 +97,7 @@ public class ApiDocWriter {
/** The config of this writer. */
private final SAX3PropertyConfig propertyConfig;
public ApiDocWriter(SAX3PropertyConfig parentConfig) {
public MaisDocWriter(SAX3PropertyConfig parentConfig) {
this.propertyConfig=new SAX3PropertyConfig(DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX);
this.propertyConfig.copyParentProperties(parentConfig);
}
@ -108,8 +108,8 @@ public class ApiDocWriter {
*/
public void writeDocumentation() throws IOException {
File basePath = propertyConfig.getPropertyFile(OUTPUT_PATH);
ApiDocGenerator writer = new ApiDocGenerator();
ApiDoc doc = buildLanguageDoc();
MaisDocGenerator writer = new MaisDocGenerator();
MaisDoc doc = buildLanguageDoc();
writer.write(doc, basePath);
}
@ -117,10 +117,10 @@ public class ApiDocWriter {
* Creates a fully configured ApiDoc object.
* @return The ApiDoc configured to write eld documentation.
*/
private ApiDoc buildLanguageDoc() {
private MaisDoc buildLanguageDoc() {
// Generic config
ApiDoc doc = new ApiDoc();
MaisDoc doc = new MaisDoc();
doc.setName( propertyConfig.getPropertyString(DOC_NAME));
doc.setDescription( propertyConfig.getPropertyString(DOC_DESCRIPTION));
doc.setDocAbout( propertyConfig.getPropertyString(DOC_ABOUT, () -> createDefaultAbout(doc.getName())));
@ -140,12 +140,12 @@ public class ApiDocWriter {
Map<String,String> javadocLinkOfflineMap = propertyConfig.getPropertyMap(JAVADOC_LINK_OFFLINE);
if (javadocLinkList!=null) {
for (String javadocUrl:javadocLinkList) {
doc.addRemoteClass(new ApiDocRemoteClass(javadocUrl));
doc.addRemoteClass(new MaisDocRemoteClass(javadocUrl));
}
}
if (javadocLinkOfflineMap!=null) {
for (Map.Entry<String,String> offlineLink:javadocLinkOfflineMap.entrySet()) {
doc.addRemoteClass(new ApiDocRemoteClass(offlineLink.getKey(),offlineLink.getValue()));
doc.addRemoteClass(new MaisDocRemoteClass(offlineLink.getKey(),offlineLink.getValue()));
}
}

View file

@ -24,11 +24,11 @@ package org.x4o.maisdoc.flake;
import java.io.IOException;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
/**
@ -37,16 +37,16 @@ import org.x4o.sax3.SAX3WriterHtml.Tag;
* @author Willem Cazander
* @version 1.0 May 22, 2013
*/
public class DefaultPageWriterHelp implements ApiDocPageWriter {
public class DefaultPageWriterHelp implements MaisDocPageWriter {
public static ApiDocPage createDocPage() {
return new ApiDocPage("doc-help","Help","This help file applies to the API documentation generated using the standard format.",new DefaultPageWriterHelp());
public static MaisDocPage createDocPage() {
return new MaisDocPage("doc-help","Help","This help file applies to the API documentation generated using the standard format.",new DefaultPageWriterHelp());
}
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException {
ApiDoc doc = e.getDoc();
public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
MaisDoc doc = e.getDoc();
//ApiDocPage page = e.getEvent();
ApiDocContentWriter writer = e.getWriter();
MaisDocContentWriter writer = e.getWriter();
writer.printTagStart(Tag.div,"header");
writer.printTagCharacters(Tag.h1, "How This API Document Is Organized", "title");
@ -57,14 +57,14 @@ public class DefaultPageWriterHelp implements ApiDocPageWriter {
writer.docPageContentStart();
writer.docPageBlockStart();
for (ApiDocConcept concept:doc.getConcepts()) {
for (MaisDocConcept concept:doc.getConcepts()) {
writer.printTagCharacters(Tag.h2, concept.getName());
writer.printTagStart(Tag.p);
writer.printCharacters(concept.getDescriptionHelp());
writer.printTagEnd(Tag.p);
writer.docPageBlockNext();
}
for (ApiDocPage docPage:doc.getDocPages()) {
for (MaisDocPage docPage:doc.getDocPages()) {
writer.printTagCharacters(Tag.h2, docPage.getName());
writer.printTagStart(Tag.p);
writer.printCharacters(docPage.getDescription());

View file

@ -24,9 +24,9 @@ package org.x4o.maisdoc.flake;
import java.io.IOException;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
/**
@ -35,16 +35,16 @@ import org.x4o.sax3.SAX3WriterHtml.Tag;
* @author Willem Cazander
* @version 1.0 May 22, 2013
*/
public class DefaultPageWriterIndexAll implements ApiDocPageWriter {
public class DefaultPageWriterIndexAll implements MaisDocPageWriter {
public static ApiDocPage createDocPage() {
return new ApiDocPage("index-all","Index","Index of all api ketwords.",new DefaultPageWriterIndexAll());
public static MaisDocPage createDocPage() {
return new MaisDocPage("index-all","Index","Index of all api ketwords.",new DefaultPageWriterIndexAll());
}
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException {
public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
// ApiDoc doc = e.getDoc();
// ApiDocPage page = e.getEvent();
ApiDocContentWriter writer = e.getWriter();
MaisDocContentWriter writer = e.getWriter();
writer.docPageContentStart();
for (char i='A';i<='Z';i++) {
writer.printHref("#_"+i+"_", ""+i);

View file

@ -24,11 +24,11 @@ package org.x4o.maisdoc.flake;
import java.io.IOException;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag;
/**
@ -37,24 +37,24 @@ import org.x4o.sax3.SAX3WriterHtml.Tag;
* @author Willem Cazander
* @version 1.0 May 22, 2013
*/
public class DefaultPageWriterTree implements ApiDocPageWriter {
public class DefaultPageWriterTree implements MaisDocPageWriter {
public static ApiDocPage createDocPage() {
return new ApiDocPage("overview-tree","Tree","Tree of api concepts.",new DefaultPageWriterTree());
public static MaisDocPage createDocPage() {
return new MaisDocPage("overview-tree","Tree","Tree of api concepts.",new DefaultPageWriterTree());
}
protected ApiDocNode selectRootNode(ApiDoc doc) {
ApiDocNode rootNode = doc.getRootNodeTreePage();
protected MaisDocNode selectRootNode(MaisDoc doc) {
MaisDocNode rootNode = doc.getRootNodeTreePage();
if (rootNode==null) {
rootNode = doc.getRootNode();
}
return rootNode;
}
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException {
ApiDoc doc = e.getDoc();
ApiDocPage page = e.getEventObject();
ApiDocContentWriter writer = e.getWriter();
public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
MaisDoc doc = e.getDoc();
MaisDocPage page = e.getEventObject();
MaisDocContentWriter writer = e.getWriter();
//writer.docPagePackageTitle(title, "Overview Tree");
writer.docPageContentStart();
writeTree(doc,selectRootNode(doc),writer,"");
@ -62,7 +62,7 @@ public class DefaultPageWriterTree implements ApiDocPageWriter {
writer.docPageContentEnd();
}
private void writeTree(ApiDoc doc, ApiDocNode node,ApiDocContentWriter writer,String pathPrefix) throws IOException {
private void writeTree(MaisDoc doc, MaisDocNode node,MaisDocContentWriter writer,String pathPrefix) throws IOException {
for (Class<?> excludeClass:doc.getTreeNodeClassExcludes()) {
if (excludeClass.isAssignableFrom(node.getUserData().getClass())) {
@ -87,20 +87,20 @@ public class DefaultPageWriterTree implements ApiDocPageWriter {
writer.printHref(href, node.getName(), node.getName(), "strong");
writer.printTagEnd(Tag.li);
for (ApiDocNode child:node.getNodes()) {
for (MaisDocNode child:node.getNodes()) {
writeTree(doc,child,writer,pathPrefix);
}
writer.printTagEnd(Tag.ul);
}
private void buildParentPath(ApiDocNode node,StringBuilder buf) {
private void buildParentPath(MaisDocNode node,StringBuilder buf) {
if (node.getParent()==null) {
buf.append(ApiDocContentWriter.toSafeUri(node.getId()));
buf.append(MaisDocContentWriter.toSafeUri(node.getId()));
buf.append('/');
return;
}
buildParentPath(node.getParent(),buf);
buf.append(ApiDocContentWriter.toSafeUri(node.getId()));
buf.append(MaisDocContentWriter.toSafeUri(node.getId()));
buf.append('/');
}
}

View file

@ -28,7 +28,7 @@ package org.x4o.maisdoc.flake;
* @author Willem Cazander
* @version 1.0 May 20, 2013
*/
public enum ApiDocContentCss {
public enum MaisDocContentCss {
indexHeader,
indexContainer,

View file

@ -28,11 +28,11 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNavLink;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocRemoteClass;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNavLink;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocRemoteClass;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
/**
* AbstractApiDocNodeWriter has some handy writer method for printing api doc html stuctures.
@ -40,9 +40,9 @@ import org.x4o.maisdoc.model.ApiDocWriteEvent;
* @author Willem Cazander
* @version 1.0 Aug 11, 2013
*/
public interface ApiDocContentPrinter {
public interface MaisDocContentPrinter {
default void clearHrefContentGroup(ApiDoc doc,ApiDocNode node,String groupType,String group,Class<?> filterClass) {
default void clearHrefContentGroup(MaisDoc doc,MaisDocNode node,String groupType,String group,Class<?> filterClass) {
boolean doClear = filterUserDataClassType(node,filterClass).isEmpty();
if (doClear==false) {
return;
@ -50,15 +50,15 @@ public interface ApiDocContentPrinter {
clearHrefContentGroupAlways(doc,groupType,group);
}
default void clearHrefContentGroupAlways(ApiDoc doc,String groupType,String group) {
ApiDocNavLink link = doc.getNodeData().getGroupTypeLink(groupType,group);
default void clearHrefContentGroupAlways(MaisDoc doc,String groupType,String group) {
MaisDocNavLink link = doc.getNodeData().getGroupTypeLink(groupType,group);
if (link==null) {
return;
}
link.setHref(null);
}
default void printApiTable(ApiDocWriteEvent<ApiDocNode> event,String name,Class<?> interfaceClass) throws IOException {
default void printApiTable(MaisDocWriteEvent<MaisDocNode> event,String name,Class<?> interfaceClass) throws IOException {
printApiTable(
event.getEventObject(),
filterUserDataClassType(event.getEventObject(),interfaceClass),
@ -67,25 +67,25 @@ public interface ApiDocContentPrinter {
);
}
default void printApiTable(ApiDocNode parent,List<ApiDocNode> nodes,ApiDocContentWriter writer,String name) throws IOException {
default void printApiTable(MaisDocNode parent,List<MaisDocNode> nodes,MaisDocContentWriter writer,String name) throws IOException {
if (nodes.isEmpty()) {
return;
}
writer.docTableStart(name, "All childeren in "+name,ApiDocContentCss.overviewSummary);
writer.docTableStart(name, "All childeren in "+name,MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Description");
for (ApiDocNode child:nodes) {
String link = ApiDocContentWriter.toSafeUri(child.getId())+"/index.html";
for (MaisDocNode child:nodes) {
String link = MaisDocContentWriter.toSafeUri(child.getId())+"/index.html";
if (parent.getParent()==null) {
link = ApiDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node
link = MaisDocContentWriter.toSafeUri(parent.getId())+"/"+link; // root node
}
writer.docTableRowLink(link,child.getName(),child.getDescription());
}
writer.docTableEnd();
}
private List<ApiDocNode> filterUserDataClassType(ApiDocNode filterNode,Class<?> interfaceClass) {
List<ApiDocNode> result = new ArrayList<ApiDocNode>(filterNode.getNodes().size()/2);
for (ApiDocNode node:filterNode.getNodes()) {
private List<MaisDocNode> filterUserDataClassType(MaisDocNode filterNode,Class<?> interfaceClass) {
List<MaisDocNode> result = new ArrayList<MaisDocNode>(filterNode.getNodes().size()/2);
for (MaisDocNode node:filterNode.getNodes()) {
if (interfaceClass.isAssignableFrom(node.getUserData().getClass())) {
result.add(node);
}
@ -93,20 +93,20 @@ public interface ApiDocContentPrinter {
return result;
}
default void printApiTableBean(ApiDocWriteEvent<ApiDocNode> event,String name,String...skipProperties) throws IOException {
default void printApiTableBean(MaisDocWriteEvent<MaisDocNode> event,String name,String...skipProperties) throws IOException {
printApiTableBean(event.getDoc(), event.getWriter(), event.getEventObject().getUserData(), name, skipProperties);
}
default void printApiTableBean(ApiDoc doc,ApiDocContentWriter writer,Object bean,String name,String...skipProperties) throws IOException {
default void printApiTableBean(MaisDoc doc,MaisDocContentWriter writer,Object bean,String name,String...skipProperties) throws IOException {
printApiTableBeanClass(doc, writer, bean, bean.getClass(), name, skipProperties);
}
default void printApiTableBeanClass(ApiDocWriteEvent<ApiDocNode> event,Class<?> beanClass,String name,String...skipProperties) throws IOException {
default void printApiTableBeanClass(MaisDocWriteEvent<MaisDocNode> event,Class<?> beanClass,String name,String...skipProperties) throws IOException {
printApiTableBeanClass(event.getDoc(), event.getWriter(), null,beanClass, name, skipProperties);
}
private void printApiTableBeanClass(ApiDoc doc,ApiDocContentWriter writer,Object bean,Class<?> beanClass,String name,String...skipProperties) throws IOException {
writer.docTableStart(name+" Properties", name+" properties overview.",ApiDocContentCss.overviewSummary);
private void printApiTableBeanClass(MaisDoc doc,MaisDocContentWriter writer,Object bean,Class<?> beanClass,String name,String...skipProperties) throws IOException {
writer.docTableStart(name+" Properties", name+" properties overview.",MaisDocContentCss.overviewSummary);
writer.docTableHeader("Name", "Value");
for (Method m:beanClass.getMethods()) {
if (m.getName().startsWith("get")) {
@ -155,7 +155,7 @@ public interface ApiDocContentPrinter {
writer.docTableEnd();
}
private String printValue(ApiDoc doc,ApiDocContentWriter writer,Object value) throws IOException {
private String printValue(MaisDoc doc,MaisDocContentWriter writer,Object value) throws IOException {
if (value==null) {
return "null";
}
@ -165,7 +165,7 @@ public interface ApiDocContentPrinter {
if (value instanceof Class) {
Class<?> cls = (Class<?>)value;
for (ApiDocRemoteClass rc:doc.getRemoteClasses()) {
for (MaisDocRemoteClass rc:doc.getRemoteClasses()) {
String remoteUrl = rc.getRemoteUrl(cls);
if (remoteUrl==null) {
continue;

View file

@ -38,16 +38,16 @@ import org.xml.sax.helpers.AttributesImpl;
* @author Willem Cazander
* @version 1.0 Apr 30, 2013
*/
public class ApiDocContentWriter extends SAX3WriterHtml {
public class MaisDocContentWriter extends SAX3WriterHtml {
private boolean isRowAlt = false;
public ApiDocContentWriter(Writer out, String encoding) {
public MaisDocContentWriter(Writer out, String encoding) {
super(out,encoding);
}
public void docCommentGenerated() throws IOException {
printComment("Generated by " + ApiDocContentWriter.class.getSimpleName( )+ " on " + new Date());
printComment("Generated by " + MaisDocContentWriter.class.getSimpleName( )+ " on " + new Date());
}
public void docHtmlStart(String title,List<String> keywords, String pathPrefix) throws IOException {
@ -80,7 +80,7 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
}
public void docHtmlEnd(String copyright, String statsJS) throws IOException {
printTagStart(Tag.p,ApiDocContentCss.legalCopy);
printTagStart(Tag.p,MaisDocContentCss.legalCopy);
printTagStart(Tag.small);
printCharacters(copyright);
printTagEnd(Tag.small);
@ -93,7 +93,7 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
}
public void docNavBarAbout(String about) throws IOException {
printTagStart(Tag.div,ApiDocContentCss.aboutLanguage); // Print about language
printTagStart(Tag.div,MaisDocContentCss.aboutLanguage); // Print about language
printTagStart(Tag.em);
printTagStart(Tag.strong);
String[] lines = about.split("\n");
@ -110,10 +110,10 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
}
public void docPagePackageTitle(String title, String summary) throws IOException {
printTagStart(Tag.div,ApiDocContentCss.header);
printTagStart(Tag.div,MaisDocContentCss.header);
printTagCharacters(Tag.h1, title,"title");
printTagStart(Tag.div,ApiDocContentCss.docSummary);
printTagCharacters(Tag.div, summary,ApiDocContentCss.block.name());
printTagStart(Tag.div,MaisDocContentCss.docSummary);
printTagCharacters(Tag.div, summary,MaisDocContentCss.block.name());
printTagEnd(Tag.div);
printTagStart(Tag.p);
printCharacters("See:&nbsp;");
@ -125,15 +125,15 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
public void docPagePackageDescription(String title, String summary, String description) throws IOException {
printHrefNamed("package_description");
printTagCharacters(Tag.h2, title);
printTagCharacters(Tag.div, summary,ApiDocContentCss.block.name());
printTagCharacters(Tag.div, summary,MaisDocContentCss.block.name());
printCharacters(description);
}
public void docPageClassStart(String title, String subTitle, Tag titleTag) throws IOException {
printComment("======== START OF CLASS DATA ========");
printTagStart(Tag.div,ApiDocContentCss.header);
printTagStart(Tag.div,MaisDocContentCss.header);
if (subTitle != null) {
printTagStart(Tag.div,ApiDocContentCss.subTitle);
printTagStart(Tag.div,MaisDocContentCss.subTitle);
printCharacters(subTitle);
printTagEnd(Tag.div);
}
@ -151,7 +151,7 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
}
public void docPageContentStart() throws IOException {
printTagStart(Tag.div,ApiDocContentCss.contentContainer);
printTagStart(Tag.div,MaisDocContentCss.contentContainer);
}
public void docPageContentEnd() throws IOException {
@ -168,8 +168,8 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
}
public void docPageBlockStart() throws IOException {
printTagStart(Tag.ul,ApiDocContentCss.blockList);
printTagStart(Tag.li,ApiDocContentCss.blockList);
printTagStart(Tag.ul,MaisDocContentCss.blockList);
printTagStart(Tag.li,MaisDocContentCss.blockList);
}
public void docPageBlockEnd() throws IOException {
@ -179,15 +179,15 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
public void docPageBlockNext() throws IOException {
printTagEnd(Tag.li);
printTagStart(Tag.li,ApiDocContentCss.blockList);
printTagStart(Tag.li,MaisDocContentCss.blockList);
}
public ContentCloseable docTable(String tableTitle, String tableDescription, ApiDocContentCss tableCss) throws IOException {
public ContentCloseable docTable(String tableTitle, String tableDescription, MaisDocContentCss tableCss) throws IOException {
docTableStart(tableTitle, tableDescription, tableCss);
return () -> docTableEnd();
}
public void docTableStart(String tableTitle, String tableDescription, ApiDocContentCss tableCss) throws IOException {
public void docTableStart(String tableTitle, String tableDescription, MaisDocContentCss tableCss) throws IOException {
isRowAlt = false;
AttributesImpl atts = new AttributesImpl();
if (tableCss != null) {
@ -203,7 +203,7 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
printTagStart(Tag.caption);
printTagStart(Tag.span);printCharacters(tableTitle);printTagEnd(Tag.span);
printTagStart(Tag.span,ApiDocContentCss.tabEnd);printCharacters("&nbsp;");printTagEnd(Tag.span);
printTagStart(Tag.span,MaisDocContentCss.tabEnd);printCharacters("&nbsp;");printTagEnd(Tag.span);
printTagEnd(Tag.caption);
}
@ -215,9 +215,9 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
printTagStart(Tag.tr);
AttributesImpl atts = new AttributesImpl();
if (titleLast == null) {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colOne.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colOne.name());
} else {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colFirst.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colFirst.name());
}
atts.addAttribute("", "scope", "", "", "col");
printTagStart(Tag.th,atts);
@ -228,7 +228,7 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
return;
}
atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colLast.name());
atts.addAttribute("", "class", "", "", MaisDocContentCss.colLast.name());
atts.addAttribute("", "scope", "", "", "col");
printTagStart(Tag.th,atts);
printCharacters(titleLast);
@ -259,9 +259,9 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
public ContentCloseable docTableRow() throws IOException {
if (isRowAlt) {
printTagStart(Tag.tr,ApiDocContentCss.altColor);
printTagStart(Tag.tr,MaisDocContentCss.altColor);
} else {
printTagStart(Tag.tr,ApiDocContentCss.rowColor);
printTagStart(Tag.tr,MaisDocContentCss.rowColor);
}
isRowAlt = !isRowAlt;
return () -> printTagEnd(Tag.tr);
@ -270,9 +270,9 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
private void docTableRowHref(String dataFirstHref, String dataFirst, String dataLast, String dataBlock, boolean dataFirstCode, boolean dataLastCode, boolean skipLast) throws IOException {
Closeable tableRow = docTableRow();
if (dataLast == null) {
printTagStart(Tag.td,ApiDocContentCss.colOne);
printTagStart(Tag.td,MaisDocContentCss.colOne);
} else {
printTagStart(Tag.td,ApiDocContentCss.colFirst);
printTagStart(Tag.td,MaisDocContentCss.colFirst);
}
if (dataFirstCode) {
printTagStart(Tag.code);
@ -288,7 +288,7 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
printTagEnd(Tag.td);
if (skipLast) {
printTagStart(Tag.td,ApiDocContentCss.colLast);
printTagStart(Tag.td,MaisDocContentCss.colLast);
return;
}
@ -297,14 +297,14 @@ public class ApiDocContentWriter extends SAX3WriterHtml {
return;
}
printTagStart(Tag.td,ApiDocContentCss.colLast);
printTagStart(Tag.td,MaisDocContentCss.colLast);
if (dataLastCode) {
printTagStart(Tag.code);printCharacters(dataLast);printTagEnd(Tag.code);
} else {
printTagStart(Tag.div,ApiDocContentCss.block);printCharacters(dataLast);printTagEnd(Tag.div);
printTagStart(Tag.div,MaisDocContentCss.block);printCharacters(dataLast);printTagEnd(Tag.div);
}
if (dataBlock != null) {
printTagStart(Tag.div,ApiDocContentCss.block);printCharacters(dataBlock);printTagEnd(Tag.div);
printTagStart(Tag.div,MaisDocContentCss.block);printCharacters(dataBlock);printTagEnd(Tag.div);
}
printTagEnd(Tag.td);

View file

@ -40,17 +40,17 @@ import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocConcept;
import org.x4o.maisdoc.model.ApiDocNavLink;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocNodeData;
import org.x4o.maisdoc.model.ApiDocNodeDataConfigurator;
import org.x4o.maisdoc.model.ApiDocNodeWriter;
import org.x4o.maisdoc.model.ApiDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.MaisDocNavLink;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeData;
import org.x4o.maisdoc.model.MaisDocNodeDataConfigurator;
import org.x4o.maisdoc.model.MaisDocNodeWriter;
import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterXml;
import org.x4o.sax3.SAX3WriterHtml.DocType;
import org.x4o.sax3.SAX3WriterHtml.Tag;
@ -64,9 +64,9 @@ import org.xml.sax.helpers.AttributesImpl;
* @author Willem Cazander
* @version 1.0 May 1, 2013
*/
public class ApiDocGenerator implements ApiDocContentPrinter {
public class MaisDocGenerator implements MaisDocContentPrinter {
private ApiDoc doc = null;
private MaisDoc doc = null;
private File basePath = null;
/**
@ -76,7 +76,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
* @throws IOException When file exception happens.
* @throws SAXException when xml exception happens.
*/
public void write(ApiDoc doc,File basePath) throws IOException {
public void write(MaisDoc doc,File basePath) throws IOException {
if (doc==null) {
throw new NullPointerException("Can't write with null ApiDoc.");
}
@ -98,13 +98,13 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writeNode(doc.getRootNode());
// Write pages last
for (ApiDocPage page:doc.getDocPages()) {
for (MaisDocPage page:doc.getDocPages()) {
writePage(page);
}
}
private void writeNode(ApiDocNode node) throws IOException {
ApiDocConcept concept = doc.findConceptByClass(node.getUserData().getClass());
private void writeNode(MaisDocNode node) throws IOException {
MaisDocConcept concept = doc.findConceptByClass(node.getUserData().getClass());
if (concept==null) {
concept = doc.findConceptChildByNode(node);
}
@ -124,7 +124,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
pathPrefix += "../";
}
File outputFile = createOutputPathFile(basePath,path.toArray(new String[]{}));
try (ApiDocContentWriter writer = createContentWriter(outputFile)) {
try (MaisDocContentWriter writer = createContentWriter(outputFile)) {
doc.getNodeData().clearGroupTypeLinks();
doc.getNodeData().setNavSelected(concept.getId());
configNodeData(pathPrefix,outputFile);
@ -133,7 +133,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
configSubNavLinks(node);
configData(node);
ApiDocWriteEvent<ApiDocNode> bodyEvent = new ApiDocWriteEvent<ApiDocNode>(doc,writer,node);
MaisDocWriteEvent<MaisDocNode> bodyEvent = new MaisDocWriteEvent<MaisDocNode>(doc,writer,node);
String titleNode = node.getName();
String titleNodeSub = null;
if (node.getParent()!=null) {
@ -143,7 +143,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
String titleContent = titleNode;
if (doc.isPrintConceptTitle()) {
String conceptTitle = concept.getName();
ApiDocConcept childConcept = doc.findConceptChildByNode(node);
MaisDocConcept childConcept = doc.findConceptChildByNode(node);
if (childConcept!=null) {
conceptTitle = childConcept.getName();
}
@ -181,12 +181,12 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
// Writer other files
writeAllFrameNavNode(node);
for (ApiDocNode child:node.getNodes()) {
for (MaisDocNode child:node.getNodes()) {
writeNode(child);
}
}
private boolean isNodePageMode(ApiDocNode node) {
private boolean isNodePageMode(MaisDocNode node) {
for (Class<?> pageModeClass:doc.getTreeNodePageModeClasses()) {
if (pageModeClass.isAssignableFrom(node.getUserData().getClass())) {
return true;
@ -195,33 +195,33 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
return false;
}
private void writeNodeTreePath(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
List<ApiDocNodeWriter> bodyWriterTreePath = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.TREE_PATH);
private void writeNodeTreePath(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
List<MaisDocNodeWriter> bodyWriterTreePath = findNodeBodyWriters(event.getEventObject(),MaisDocNodeBody.TREE_PATH);
if (bodyWriterTreePath.isEmpty()) {
defaultWriteTreePath(event.getEventObject(),event.getWriter());
}
for (int i=0;i<bodyWriterTreePath.size();i++) {
ApiDocNodeWriter nodeWriter = bodyWriterTreePath.get(i);
MaisDocNodeWriter nodeWriter = bodyWriterTreePath.get(i);
nodeWriter.writeNodeContent(event);
}
}
private void defaultWriteNodeDescription(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
private void defaultWriteNodeDescription(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
event.getWriter().printCharacters(event.getEventObject().getDescription());
}
private void writeNodeDescription(ApiDocWriteEvent<ApiDocNode> event,boolean isPageMode) throws IOException {
ApiDocContentWriter writer = event.getWriter();
List<ApiDocNodeWriter> bodyWriterDescriptionLinks = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.DESCRIPTION_LINKS);
List<ApiDocNodeWriter> bodyWriterDescriptionNode = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.DESCRIPTION_NODE);
writer.printTagStart(Tag.div, ApiDocContentCss.description);
private void writeNodeDescription(MaisDocWriteEvent<MaisDocNode> event,boolean isPageMode) throws IOException {
MaisDocContentWriter writer = event.getWriter();
List<MaisDocNodeWriter> bodyWriterDescriptionLinks = findNodeBodyWriters(event.getEventObject(),MaisDocNodeBody.DESCRIPTION_LINKS);
List<MaisDocNodeWriter> bodyWriterDescriptionNode = findNodeBodyWriters(event.getEventObject(),MaisDocNodeBody.DESCRIPTION_NODE);
writer.printTagStart(Tag.div, MaisDocContentCss.description);
writer.docPageBlockStart();
if (isPageMode==false) {
if (bodyWriterDescriptionLinks.isEmpty()) {
//defaultWriteTreePath(node,writer);
}
for (int i=0;i<bodyWriterDescriptionLinks.size();i++) {
ApiDocNodeWriter nodeWriter = bodyWriterDescriptionLinks.get(i);
MaisDocNodeWriter nodeWriter = bodyWriterDescriptionLinks.get(i);
nodeWriter.writeNodeContent(event);
writer.printTagStartEnd(Tag.br);
if (i+1<bodyWriterDescriptionLinks.size()) {
@ -235,7 +235,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
defaultWriteNodeDescription(event);
}
for (int i=0;i<bodyWriterDescriptionNode.size();i++) {
ApiDocNodeWriter nodeWriter = bodyWriterDescriptionNode.get(i);
MaisDocNodeWriter nodeWriter = bodyWriterDescriptionNode.get(i);
nodeWriter.writeNodeContent(event);
writer.printTagStartEnd(Tag.br);
if (i+1<bodyWriterDescriptionNode.size()) {
@ -246,11 +246,11 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writer.printTagEnd(Tag.div); // description
}
private void writeNodeSummary(ApiDocWriteEvent<ApiDocNode> event,boolean isPageMode) throws IOException {
ApiDocContentWriter writer = event.getWriter();
List<ApiDocNodeWriter> bodyWriterSummary = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.SUMMARY);
private void writeNodeSummary(MaisDocWriteEvent<MaisDocNode> event,boolean isPageMode) throws IOException {
MaisDocContentWriter writer = event.getWriter();
List<MaisDocNodeWriter> bodyWriterSummary = findNodeBodyWriters(event.getEventObject(),MaisDocNodeBody.SUMMARY);
if (!isPageMode) {
writer.printTagStart(Tag.div, ApiDocContentCss.summary);
writer.printTagStart(Tag.div, MaisDocContentCss.summary);
writer.docPageBlockStart();
}
if (bodyWriterSummary.isEmpty() && event.getEventObject().getNodes().isEmpty()==false) {
@ -259,7 +259,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
if (!isPageMode) { writer.docPageBlockEnd(); }
}
for (int i=0;i<bodyWriterSummary.size();i++) {
ApiDocNodeWriter nodeWriter = bodyWriterSummary.get(i);
MaisDocNodeWriter nodeWriter = bodyWriterSummary.get(i);
if (!isPageMode) { writer.docPageBlockStart(); }
writeSubNavNamedHref(event,nodeWriter);
if (!isPageMode) { writer.printTagCharacters(Tag.h3, "Summary"); }
@ -273,7 +273,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
private void writeSubNavNamedHref(ApiDocWriteEvent<ApiDocNode> event,ApiDocNodeWriter writer) throws IOException {
private void writeSubNavNamedHref(MaisDocWriteEvent<MaisDocNode> event,MaisDocNodeWriter writer) throws IOException {
String group = writer.getContentGroup();
String groupTypeKey = writer.getContentGroupType();
if (group==null | groupTypeKey==null) {
@ -282,13 +282,13 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
event.getWriter().printHrefNamed(groupTypeKey+"_"+group);
}
private void writeNodeDetails(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter();
List<ApiDocNodeWriter> bodyWriterDetail = findNodeBodyWriters(event.getEventObject(),ApiDocNodeBody.DETAIL);
private void writeNodeDetails(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
MaisDocContentWriter writer = event.getWriter();
List<MaisDocNodeWriter> bodyWriterDetail = findNodeBodyWriters(event.getEventObject(),MaisDocNodeBody.DETAIL);
if (bodyWriterDetail.isEmpty()) {
return;// no default ..
}
writer.printTagStart(Tag.div, ApiDocContentCss.details);
writer.printTagStart(Tag.div, MaisDocContentCss.details);
writer.docPageBlockStart();
//if (bodyWriterDetail.isEmpty()) {
// writer.docPageBlockStart();
@ -296,7 +296,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
// writer.docPageBlockEnd();
//}
for (int i=0;i<bodyWriterDetail.size();i++) {
ApiDocNodeWriter nodeWriter = bodyWriterDetail.get(i);
MaisDocNodeWriter nodeWriter = bodyWriterDetail.get(i);
writer.docPageBlockStart();
writeSubNavNamedHref(event,nodeWriter);
writer.printTagCharacters(Tag.h3, "Detail");
@ -309,7 +309,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
protected void configNodeData(String prefixPath,File frame) throws IOException {
ApiDocNodeData conf = doc.getNodeData();
MaisDocNodeData conf = doc.getNodeData();
String framePath = null;
String rootPath = new File(frame.getParentFile().getPath()+File.separatorChar+prefixPath).getCanonicalPath();
framePath = frame.getPath().substring(rootPath.length()+1);
@ -317,67 +317,67 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
conf.setFramePath(framePath);
// Reset hrefs
for (ApiDocNavLink link:doc.getNodeData().getNavLinks()) {
for (MaisDocNavLink link:doc.getNodeData().getNavLinks()) {
if (link.isResetHref()) {
link.setHref(null);
}
}
}
private void configActiveNavConceptLinks(ApiDocNode node,ApiDocConcept concept,String prefix) {
private void configActiveNavConceptLinks(MaisDocNode node,MaisDocConcept concept,String prefix) {
List<String> pathClean = new ArrayList<String>(10);
buildParentPath(node,pathClean);
if (concept.getParent()!=null && !concept.getParent().getId().equals(doc.getRootNode().getId())) {
ApiDocConcept conceptParent = concept.getParent();
ApiDocNavLink link = doc.getNodeData().getNavLinkById(conceptParent.getId());
MaisDocConcept conceptParent = concept.getParent();
MaisDocNavLink link = doc.getNodeData().getNavLinkById(conceptParent.getId());
link.setHref(ApiDocContentWriter.toSafeUri(pathClean)+prefix+"/index.html");
link.setHref(MaisDocContentWriter.toSafeUri(pathClean)+prefix+"/index.html");
link.setTitle(node.getParent().getId());
configActiveNavConceptLinks(node,concept.getParent(),prefix+"/..");
}
}
private void configNextPrevLinks(ApiDocNode node) {
private void configNextPrevLinks(MaisDocNode node) {
doc.getNodeData().setPrevLink(null);
doc.getNodeData().setNextLink(null);
if (node.getParent()==null) {
return;
}
List<ApiDocNode> pn = node.getParent().getNodes();
List<MaisDocNode> pn = node.getParent().getNodes();
int pnSize = pn.size();
int nodeIdx = pn.indexOf(node);
if (nodeIdx>0) {
List<String> pathClean = new ArrayList<String>(10);
ApiDocNode prevNode = pn.get(nodeIdx-1);
MaisDocNode prevNode = pn.get(nodeIdx-1);
if (node.getUserData().getClass().equals(prevNode.getUserData().getClass())) {
buildParentPath(prevNode,pathClean);
doc.getNodeData().setPrevLink(ApiDocContentWriter.toSafeUri(pathClean)+"/index.html");
doc.getNodeData().setPrevLink(MaisDocContentWriter.toSafeUri(pathClean)+"/index.html");
}
}
if ((nodeIdx+1)<pnSize) {
List<String> pathClean = new ArrayList<String>(10);
ApiDocNode nextNode = pn.get(nodeIdx+1);
MaisDocNode nextNode = pn.get(nodeIdx+1);
if (node.getUserData().getClass().equals(nextNode.getUserData().getClass())) {
buildParentPath(nextNode,pathClean);
doc.getNodeData().setNextLink(ApiDocContentWriter.toSafeUri(pathClean)+"/index.html");
doc.getNodeData().setNextLink(MaisDocContentWriter.toSafeUri(pathClean)+"/index.html");
}
}
}
private void configData(ApiDocNode node) {
ApiDocNodeData confData = doc.getNodeData();
for (ApiDocNodeDataConfigurator conf:findDataConfigurators(node)) {
private void configData(MaisDocNode node) {
MaisDocNodeData confData = doc.getNodeData();
for (MaisDocNodeDataConfigurator conf:findDataConfigurators(node)) {
conf.configNodeData(doc, node,confData);
}
}
private void configSubNavLinks(ApiDocNode node) {
ApiDocNodeData conf = doc.getNodeData();
List<ApiDocNodeWriter> orderedWriters = new ArrayList<ApiDocNodeWriter>(10);
for (ApiDocNodeBody bodyType:ApiDocNodeBody.values()) {
private void configSubNavLinks(MaisDocNode node) {
MaisDocNodeData conf = doc.getNodeData();
List<MaisDocNodeWriter> orderedWriters = new ArrayList<MaisDocNodeWriter>(10);
for (MaisDocNodeBody bodyType:MaisDocNodeBody.values()) {
orderedWriters.addAll(findNodeBodyWriters(node,bodyType)); // enum order is oke
}
for (ApiDocNodeWriter writer:orderedWriters) {
for (MaisDocNodeWriter writer:orderedWriters) {
String group = writer.getContentGroup();
String groupTypeKey = writer.getContentGroupType();
if (group==null | groupTypeKey==null) {
@ -388,7 +388,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
String groupTypeName = doc.getGroupTypeName(groupTypeKey);
String groupName = group.substring(0,1).toUpperCase()+group.substring(1);
ApiDocNavLink link = new ApiDocNavLink();
MaisDocNavLink link = new MaisDocNavLink();
link.setId(group);
link.setHref("#"+groupTypeKey+"_"+group);
link.setText(groupName);
@ -397,26 +397,26 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
public void defaultWriteSummary(ApiDocNode node,ApiDocContentWriter writer) throws IOException {
ApiDocConcept concept = doc.findConceptByClass(node.getUserData().getClass());
public void defaultWriteSummary(MaisDocNode node,MaisDocContentWriter writer) throws IOException {
MaisDocConcept concept = doc.findConceptByClass(node.getUserData().getClass());
printApiTable(node, node.getNodes(), writer, concept.getName()+" Summary");
}
public void defaultWriteTreePath(ApiDocNode node,ApiDocContentWriter writer) throws IOException {
public void defaultWriteTreePath(MaisDocNode node,MaisDocContentWriter writer) throws IOException {
if (node.getParent()==null) {
return; // no tree for root
}
List<ApiDocNode> rootPath = new ArrayList<ApiDocNode>(8);
List<MaisDocNode> rootPath = new ArrayList<MaisDocNode>(8);
defaultWriteTreePathBuildPath(node,rootPath);
defaultWriteTreePathWalker(rootPath.iterator(),writer,rootPath.size());
}
private void defaultWriteTreePathWalker(Iterator<ApiDocNode> nodes,ApiDocContentWriter writer,int linkPrefixCount) throws IOException {
private void defaultWriteTreePathWalker(Iterator<MaisDocNode> nodes,MaisDocContentWriter writer,int linkPrefixCount) throws IOException {
if (nodes.hasNext()==false) {
return;
}
ApiDocNode node = nodes.next();
writer.printTagStart(Tag.ul, ApiDocContentCss.inheritance);
MaisDocNode node = nodes.next();
writer.printTagStart(Tag.ul, MaisDocContentCss.inheritance);
String nodeTitle = node.getName();
if (nodes.hasNext()==false) {
writer.printTagStart(Tag.li);
@ -430,7 +430,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
String linkHref = buf+"index.html";
if (doc.getRootNode().equals(node)) {
ApiDocConcept concept = doc.findConceptByClass(node.getUserData().getClass());
MaisDocConcept concept = doc.findConceptByClass(node.getUserData().getClass());
linkHref = buf+"../overview-"+concept.getId()+".html";
}
writer.printHref(linkHref, nodeTitle, node.getDescription());
@ -443,7 +443,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writer.printTagEnd(Tag.ul);
}
private void defaultWriteTreePathBuildPath(ApiDocNode node,List<ApiDocNode> result) {
private void defaultWriteTreePathBuildPath(MaisDocNode node,List<MaisDocNode> result) {
if (node.getParent()!=null) {
defaultWriteTreePathBuildPath(node.getParent(),result);
} else if (doc.isSkipRootTreePathNode()) {
@ -452,11 +452,11 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
result.add(node);
}
private ApiDocContentWriter createContentWriter(File outputFile) throws IOException {
private MaisDocContentWriter createContentWriter(File outputFile) throws IOException {
String encoding = SAX3XMLConstants.XML_DEFAULT_ENCODING;
try {
Writer out = new OutputStreamWriter(new FileOutputStream(outputFile), encoding);
ApiDocContentWriter result = new ApiDocContentWriter(out,encoding);
MaisDocContentWriter result = new MaisDocContentWriter(out,encoding);
result.getPropertyConfig().setProperty(SAX3WriterXml.OUTPUT_CHAR_NEWLINE, SAX3XMLConstants.CHAR_NEWLINE+"");
result.getPropertyConfig().setProperty(SAX3WriterXml.OUTPUT_CHAR_TAB, " ");
return result;
@ -469,16 +469,16 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
private List<ApiDocNodeWriter> findNodeBodyWriters(ApiDocNode node,ApiDocNodeBody nodeBody) {
private List<MaisDocNodeWriter> findNodeBodyWriters(MaisDocNode node,MaisDocNodeBody nodeBody) {
if (node==null) {
throw new NullPointerException("Can't search writers on null node.");
}
if (nodeBody==null) {
throw new NullPointerException("Can't search writers with null nodeBody."); // for sorting rules
}
List<ApiDocNodeWriter> result = new ArrayList<ApiDocNodeWriter>();
List<MaisDocNodeWriter> result = new ArrayList<MaisDocNodeWriter>();
final Class<?> objClass = node.getUserData().getClass();
for (ApiDocNodeWriter writer:doc.getNodeBodyWriters()) {
for (MaisDocNodeWriter writer:doc.getNodeBodyWriters()) {
if (!nodeBody.equals(writer.getNodeBody())) {
continue;
}
@ -492,12 +492,12 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
return result;
}
private class ApiDocNodeWriterComparator implements Comparator<ApiDocNodeWriter> {
private class ApiDocNodeWriterComparator implements Comparator<MaisDocNodeWriter> {
final Class<?> objClass;
public ApiDocNodeWriterComparator(Class<?> objClass) {
this.objClass=objClass;
}
public int compare(ApiDocNodeWriter o1, ApiDocNodeWriter o2) {
public int compare(MaisDocNodeWriter o1, MaisDocNodeWriter o2) {
int index1 = -1;
int index2 = -1;
for (int i=0;i<o1.getTargetClasses().size();i++) {
@ -529,10 +529,10 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
private List<ApiDocNodeDataConfigurator> findDataConfigurators(ApiDocNode node) {
List<ApiDocNodeDataConfigurator> result = new ArrayList<ApiDocNodeDataConfigurator>();
private List<MaisDocNodeDataConfigurator> findDataConfigurators(MaisDocNode node) {
List<MaisDocNodeDataConfigurator> result = new ArrayList<MaisDocNodeDataConfigurator>();
final Class<?> objClass = node.getUserData().getClass();
for (ApiDocNodeDataConfigurator conf:doc.getDataConfigurators()) {
for (MaisDocNodeDataConfigurator conf:doc.getDataConfigurators()) {
for (Class<?> c:conf.getTargetClasses()) {
if (c.isAssignableFrom(objClass)) {
result.add(conf);
@ -542,7 +542,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
return result;
}
private void buildParentPath(ApiDocNode node,List<String> path) {
private void buildParentPath(MaisDocNode node,List<String> path) {
if (node.getParent()==null) {
path.add(node.getId());
return;
@ -613,7 +613,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writeFileString(css,basePath,"resources","stylesheet.css");
}
private void writeHeader(ApiDocContentWriter writer,String resourcePrefix,String title) throws IOException {
private void writeHeader(MaisDocContentWriter writer,String resourcePrefix,String title) throws IOException {
writer.printTagStart(Tag.head);
writer.docCommentGenerated();
writer.printHeadMetaContentType();
@ -631,13 +631,13 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
"\t { targetPage = \"undefined\"; }\n"+
"function loadFrames() {\n"+
"\tif (targetPage != \"\" && targetPage != \"undefined\")\n"+
"\t\t { top."+ApiDocContentCss.frameContent.name()+".location = top.targetPage; }\n"+
"\t\t { top."+MaisDocContentCss.frameContent.name()+".location = top.targetPage; }\n"+
"}\n";
public void writeIndex() throws IOException {
File outputFile = createOutputPathFile(basePath,"index.html");
try (ApiDocContentWriter writer = createContentWriter(outputFile)) {
try (MaisDocContentWriter writer = createContentWriter(outputFile)) {
writer.printDocType(DocType.HTML_4_FRAMESET);
writer.printComment("NewPage");
writer.printHtmlStart("en");
@ -650,7 +650,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
atts.addAttribute ("", "onload", "", "", "top.loadFrames()");
writer.printTagStart(Tag.frameset, atts);
ApiDocConcept navConcept = doc.findConceptByClass(doc.getFrameNavConceptClass());
MaisDocConcept navConcept = doc.findConceptByClass(doc.getFrameNavConceptClass());
atts = new AttributesImpl();
atts.addAttribute ("", "rows", "", "", "30%,70%");
atts.addAttribute ("", "title", "", "", "Left frames");
@ -659,23 +659,23 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
atts = new AttributesImpl();
atts.addAttribute ("", "src", "", "", "overview-frame.html");
atts.addAttribute ("", "title", "", "", "All Namspaces");
atts.addAttribute ("", "name", "", "", ApiDocContentCss.frameNavOverview.name());
atts.addAttribute ("", "name", "", "", MaisDocContentCss.frameNavOverview.name());
writer.printTagStart(Tag.frame, atts);
writer.printTagEnd(Tag.frame);
atts = new AttributesImpl();
atts.addAttribute ("", "src", "", "", "all"+navConcept.getId()+"-frame.html");
atts.addAttribute ("", "title", "", "", "All Elements");
atts.addAttribute ("", "name", "", "", ApiDocContentCss.frameNavDetail.name());
atts.addAttribute ("", "name", "", "", MaisDocContentCss.frameNavDetail.name());
writer.printTagStart(Tag.frame, atts);
writer.printTagEnd(Tag.frame);
writer.printTagEnd(Tag.frameset);
String rootLink = "overview-"+ApiDocContentWriter.toSafeUri(doc.getRootNode().getId())+".html";
String rootLink = "overview-"+MaisDocContentWriter.toSafeUri(doc.getRootNode().getId())+".html";
atts = new AttributesImpl();
atts.addAttribute ("", "src", "", "", rootLink);
atts.addAttribute ("", "title", "", "", "All Language Components");
atts.addAttribute ("", "name", "", "", ApiDocContentCss.frameContent.name());
atts.addAttribute ("", "name", "", "", MaisDocContentCss.frameContent.name());
atts.addAttribute ("", "scrolling", "", "", "yes");
writer.printTagStart(Tag.frame, atts);
writer.printTagEnd(Tag.frame);
@ -695,23 +695,23 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
private void findNodeByUserDataClass(ApiDocNode node,Class<?> userDataClass,List<ApiDocNode> result) {
private void findNodeByUserDataClass(MaisDocNode node,Class<?> userDataClass,List<MaisDocNode> result) {
if (userDataClass.isAssignableFrom(node.getUserData().getClass())) {
result.add(node);
}
for (ApiDocNode child:node.getNodes()) {
findNodeByUserDataClass((ApiDocNode)child,userDataClass,result);
for (MaisDocNode child:node.getNodes()) {
findNodeByUserDataClass((MaisDocNode)child,userDataClass,result);
}
}
public void writeOverviewFrame() throws IOException {
ApiDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
ApiDocConcept conceptParent = concept.getParent();
List<ApiDocNode> nodes = new ArrayList<ApiDocNode>(50);
MaisDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
MaisDocConcept conceptParent = concept.getParent();
List<MaisDocNode> nodes = new ArrayList<MaisDocNode>(50);
findNodeByUserDataClass(doc.getRootNode(),conceptParent.getConceptClass(),nodes);
File outputFile = createOutputPathFile(basePath,"overview-frame.html");
try (ApiDocContentWriter writer = createContentWriter(outputFile)) {
try (MaisDocContentWriter writer = createContentWriter(outputFile)) {
String conceptPlural = concept.getName()+"s";
String conceptParentPlural = conceptParent.getName()+"s";
@ -721,14 +721,14 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writeHeader(writer,"","All "+conceptPlural+" of "+doc.getName());
writer.printTagStart(Tag.body);
writer.printTagStart(Tag.div,ApiDocContentCss.indexHeader);
writer.printHrefTarget("all"+concept.getId()+"-frame.html", ApiDocContentCss.frameNavDetail.name(), "All " + conceptPlural);
writer.printTagStart(Tag.div,MaisDocContentCss.indexHeader);
writer.printHrefTarget("all"+concept.getId()+"-frame.html", MaisDocContentCss.frameNavDetail.name(), "All " + conceptPlural);
writer.printTagEnd(Tag.div);
writer.printTagStart(Tag.div,ApiDocContentCss.indexContainer);
writer.printTagStart(Tag.div,MaisDocContentCss.indexContainer);
writer.printTagCharacters(Tag.h2, conceptParentPlural);
writer.printTagStart(Tag.ul);
for (ApiDocNode node:nodes) {
for (MaisDocNode node:nodes) {
String linkName = node.getName();
if (doc.getFrameNavOverviewPrintParent()) {
if (doc.getFrameNavPrintParentId()) {
@ -742,14 +742,14 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
buf.append(doc.getRootNode().getId());
buf.append("/");
if (doc.getRootNode() != node.getParent()) {
buf.append(ApiDocContentWriter.toSafeUri(node.getParent().getId()));
buf.append(MaisDocContentWriter.toSafeUri(node.getParent().getId()));
buf.append("/");
}
buf.append(ApiDocContentWriter.toSafeUri(node.getId()));
buf.append(MaisDocContentWriter.toSafeUri(node.getId()));
buf.append("/");
buf.append(ApiDocContentWriter.toSafeUri(node.getId()));
buf.append(MaisDocContentWriter.toSafeUri(node.getId()));
buf.append("-frame.html");
writer.printHrefTarget(buf.toString(), ApiDocContentCss.frameNavDetail.name(), linkName);
writer.printHrefTarget(buf.toString(), MaisDocContentCss.frameNavDetail.name(), linkName);
writer.printTagEnd(Tag.li);
}
writer.printTagEnd(Tag.ul);
@ -761,7 +761,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
public void writeAllFrameNav(boolean isFrame) throws IOException {
ApiDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
MaisDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
if (isFrame) {
writeAllFrameNav("",true,null,"all"+concept.getId()+"-frame.html");
} else {
@ -769,9 +769,9 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
private void writeAllFrameNavNode(ApiDocNode node) throws IOException {
ApiDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
ApiDocConcept conceptParent = concept.getParent();
private void writeAllFrameNavNode(MaisDocNode node) throws IOException {
MaisDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
MaisDocConcept conceptParent = concept.getParent();
if (!conceptParent.getConceptClass().isAssignableFrom(node.getUserData().getClass())) {
return; // only frame nav nodes.
}
@ -785,14 +785,14 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writeAllFrameNav(pathS,true,node,path.toArray(new String[]{}));
}
private void writeAllFrameNav(String pathPrefix,boolean isFrame,ApiDocNode searchNode,String...fileName) throws IOException {
ApiDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
private void writeAllFrameNav(String pathPrefix,boolean isFrame,MaisDocNode searchNode,String...fileName) throws IOException {
MaisDocConcept concept = doc.findConceptByClass(doc.getFrameNavConceptClass());
//ApiDocConcept conceptParent = concept.getParent();
List<ApiDocNode> nodes = new ArrayList<ApiDocNode>(50);
List<MaisDocNode> nodes = new ArrayList<MaisDocNode>(50);
findNodeByUserDataClass(doc.getRootNode(),concept.getConceptClass(),nodes);
File outputFile = createOutputPathFile(basePath,fileName);
try (ApiDocContentWriter writer = createContentWriter(outputFile)) {
try (MaisDocContentWriter writer = createContentWriter(outputFile)) {
String conceptPlural = concept.getName()+"s";
//String conceptParentPlural = conceptParent.getName()+"s";
@ -804,18 +804,18 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
if (searchNode==null) {
writer.printTagCharacters(Tag.h1, "All "+conceptPlural, "bar");
} else {
writer.printTagStart(Tag.h1,ApiDocContentCss.bar);
writer.printHrefTarget("index.html", ApiDocContentCss.frameContent.name(), searchNode.getId());
writer.printTagStart(Tag.h1,MaisDocContentCss.bar);
writer.printHrefTarget("index.html", MaisDocContentCss.frameContent.name(), searchNode.getId());
writer.printTagEnd(Tag.h1);
}
writer.printTagStart(Tag.div,ApiDocContentCss.indexContainer);
writer.printTagStart(Tag.div,MaisDocContentCss.indexContainer);
writer.printTagStart(Tag.ul);
boolean printParent = new Boolean(true).equals(doc.getFrameNavPrintParent());
boolean printParentParent = new Boolean(true).equals(doc.getFrameNavPrintParentParent());
for (ApiDocNode node:nodes) {
for (MaisDocNode node:nodes) {
List<String> nodePath = new ArrayList<String>(10);
buildParentPath(node,nodePath);
if (searchNode!=null) {
@ -832,9 +832,9 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
String linkName = node.getName();
String linkUrl = ApiDocContentWriter.toSafeUri(nodePath)+"/index.html";
String linkUrl = MaisDocContentWriter.toSafeUri(nodePath)+"/index.html";
if (searchNode!=null) {
linkUrl = ApiDocContentWriter.toSafeUri(node.getId(),"index.html");
linkUrl = MaisDocContentWriter.toSafeUri(node.getId(),"index.html");
}
if (printParent) {
if (printParentParent) {
@ -853,7 +853,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
writer.printTagStart(Tag.li);
if (isFrame) {
writer.printHrefTarget(linkUrl, ApiDocContentCss.frameContent.name(), linkName);
writer.printHrefTarget(linkUrl, MaisDocContentCss.frameContent.name(), linkName);
} else {
writer.printHref(linkUrl, linkName);
}
@ -868,10 +868,10 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
}
private void writePage(ApiDocPage page) throws IOException {
private void writePage(MaisDocPage page) throws IOException {
File outputFile = createOutputPathFile(basePath,page.getId()+".html");
String pathPrefix = "";
try (ApiDocContentWriter writer = createContentWriter(outputFile)) {
try (MaisDocContentWriter writer = createContentWriter(outputFile)) {
configNodeData(pathPrefix,outputFile);
doc.getNodeData().setNavSelected(page.getId());
String title = page.getName();
@ -879,10 +879,10 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
docNavBar(writer,true,null,null);
writer.docPageClassStart(title, page.getDescription(),Tag.h1);
ApiDocWriteEvent<ApiDocPage> e = new ApiDocWriteEvent<ApiDocPage>(doc,writer,page);
MaisDocWriteEvent<MaisDocPage> e = new MaisDocWriteEvent<MaisDocPage>(doc,writer,page);
//writer.docPageContentStart();
for (ApiDocPageWriter pageWriter:page.getPageWriters()) {
for (MaisDocPageWriter pageWriter:page.getPageWriters()) {
pageWriter.writePageContent(e);
}
//writer.docPageContentEnd();
@ -933,7 +933,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
public static ClassLoader findClassLoader() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = ApiDocGenerator.class.getClassLoader();
cl = MaisDocGenerator.class.getClassLoader();
}
return cl;
}
@ -962,7 +962,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
buf.append(basePath.getAbsolutePath());
buf.append(File.separatorChar);
for (int i=0;i<argu.length-1;i++) {
buf.append(ApiDocContentWriter.toSafeUri(argu[i]));
buf.append(MaisDocContentWriter.toSafeUri(argu[i]));
buf.append(File.separatorChar);
}
File outputPath = new File(buf.toString());
@ -971,7 +971,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
outputPath.mkdirs();
}
buf.append(File.separatorChar);
buf.append(ApiDocContentWriter.toSafeUri(argu[argu.length-1]));
buf.append(MaisDocContentWriter.toSafeUri(argu[argu.length-1]));
File outputFile = new File(buf.toString());
if (outputFile.exists()) {
outputFile.delete();
@ -980,8 +980,8 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
return outputFile;
}
private void docNavBar(ApiDocContentWriter writer,boolean isTop,ApiDocConcept concept,ApiDocNode node) throws IOException {
ApiDocNodeData conf = doc.getNodeData();
private void docNavBar(MaisDocContentWriter writer,boolean isTop,MaisDocConcept concept,MaisDocNode node) throws IOException {
MaisDocNodeData conf = doc.getNodeData();
String pathPrefix = conf.getPrefixPath();
String barComment = "TOP";
String barCssDiv = "topNav";
@ -1008,7 +1008,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
atts.addAttribute ("", "title", "", "", "Navigation");
writer.printTagStart(Tag.ul, atts);
for (ApiDocNavLink navLink:conf.getNavLinks()) {
for (MaisDocNavLink navLink:conf.getNavLinks()) {
String selectedCss = null;
String href = navLink.getHref();
if (navLink.getId().equals(conf.getNavSelected())) {
@ -1031,12 +1031,12 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writer.printTagEnd(Tag.div); // end barCssDiv
writer.printTagStart(Tag.div,ApiDocContentCss.subNav);
writer.printTagStart(Tag.ul,ApiDocContentCss.navList);
writer.printTagStart(Tag.div,MaisDocContentCss.subNav);
writer.printTagStart(Tag.ul,MaisDocContentCss.navList);
String postFix = "";
if (concept!=null && doc.isPrintConceptPrevNext()) {
String conceptTitle = concept.getName();
ApiDocConcept childConcept = doc.findConceptChildByNode(node);
MaisDocConcept childConcept = doc.findConceptChildByNode(node);
if (childConcept!=null) {
conceptTitle = childConcept.getName();
}
@ -1054,7 +1054,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
}
writer.printTagEnd(Tag.ul);
if (conf.getFramePath()!=null) {
writer.printTagStart(Tag.ul,ApiDocContentCss.navList);
writer.printTagStart(Tag.ul,MaisDocContentCss.navList);
writer.printTagStart(Tag.li);
writer.printHrefTarget(pathPrefix+"index.html?"+conf.getFramePath(), "_top", "Frames");
writer.printTagEnd(Tag.li);
@ -1064,7 +1064,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writer.printTagEnd(Tag.ul);
}
if (doc.getNoFrameAllName()!=null && doc.getNoFrameAllLink()!=null) {
writer.printTagStart(Tag.ul,ApiDocContentCss.navList,"allclasses_"+barId);
writer.printTagStart(Tag.ul,MaisDocContentCss.navList,"allclasses_"+barId);
docNavBarListItemHref(writer,pathPrefix+doc.getNoFrameAllLink(),doc.getNoFrameAllName(),doc.getNoFrameAllName(),null,null,null);
writer.printTagEnd(Tag.ul);
writer.printTagStart(Tag.div);
@ -1089,16 +1089,16 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
for (int i=0;i<groupKeys.size();i++) {
String groupKey = groupKeys.get(i);
String groupName = doc.getGroupTypeName(groupKey);
List<ApiDocNavLink> links = conf.getGroupTypeLinks(groupKey);
List<MaisDocNavLink> links = conf.getGroupTypeLinks(groupKey);
if (links.isEmpty()==false) {
if (!printDiv) {
printDiv = true;
writer.printTagStart(Tag.div); // don't print empty div
}
writer.printTagStart(Tag.ul,ApiDocContentCss.subNavList);
writer.printTagStart(Tag.ul,MaisDocContentCss.subNavList);
writer.printTagStart(Tag.li);writer.printCharacters(groupName+":&nbsp;");writer.printTagEnd(Tag.li);
for (int l=0;l<links.size();l++) {
ApiDocNavLink link = links.get(l);
MaisDocNavLink link = links.get(l);
writer.printTagStart(Tag.li);
String tab = null;
if (l<links.size()-1) {
@ -1126,7 +1126,7 @@ public class ApiDocGenerator implements ApiDocContentPrinter {
writer.printComment("========= END OF "+barComment+" NAVBAR =======");
}
private void docNavBarListItemHref(ApiDocContentWriter writer, String href, String title, String text, String cssClass, String spanCss, String linkSpace) throws IOException {
private void docNavBarListItemHref(MaisDocContentWriter writer, String href, String title, String text, String cssClass, String spanCss, String linkSpace) throws IOException {
writer.printTagStart(Tag.li, cssClass);
writer.printHref(href, text, title, spanCss);
writer.printCharacters(linkSpace);

View file

@ -26,10 +26,10 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeData;
import org.x4o.maisdoc.model.ApiDocNodeDataConfigurator;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeData;
import org.x4o.maisdoc.model.MaisDocNodeDataConfigurator;
/**
* ApiDocNodeDataConfiguratorBean wraps the ApiDocNodeDataConfigurator to a single method of a bean.
@ -37,17 +37,17 @@ import org.x4o.maisdoc.model.ApiDocNodeDataConfigurator;
* @author Willem Cazander
* @version 1.0 May 1, 2013
*/
public class ApiDocNodeDataConfiguratorBean implements ApiDocNodeDataConfigurator {
public class MaisDocNodeDataConfiguratorBean implements MaisDocNodeDataConfigurator {
private Object bean = null;
private String method = null;
private List<Class<?>> targetClasses = null;
public ApiDocNodeDataConfiguratorBean() {
public MaisDocNodeDataConfiguratorBean() {
targetClasses = new ArrayList<Class<?>>(5);
}
public ApiDocNodeDataConfiguratorBean(Object bean,String method,Class<?>...classes) {
public MaisDocNodeDataConfiguratorBean(Object bean,String method,Class<?>...classes) {
this();
setBean(bean);
setMethod(method);
@ -56,7 +56,7 @@ public class ApiDocNodeDataConfiguratorBean implements ApiDocNodeDataConfigurato
}
}
public static void addAnnotatedNodeDataConfigurators(ApiDoc doc,Object bean) {
public static void addAnnotatedNodeDataConfigurators(MaisDoc doc,Object bean) {
if (doc==null) {
throw new NullPointerException("Can't add to null ApiDoc.");
}
@ -64,22 +64,22 @@ public class ApiDocNodeDataConfiguratorBean implements ApiDocNodeDataConfigurato
throw new NullPointerException("Can't scan null bean.");
}
for (Method method:bean.getClass().getMethods()) {
ApiDocNodeDataConfiguratorMethod ammo = method.getAnnotation(ApiDocNodeDataConfiguratorMethod.class);
MaisDocNodeDataConfiguratorMethod ammo = method.getAnnotation(MaisDocNodeDataConfiguratorMethod.class);
if (ammo==null) {
continue;
}
if (ammo.targetClasses().length==0) {
throw new IllegalArgumentException("Can't configure writer bean with empty 'targetClasses' parameter.");
}
ApiDocNodeDataConfiguratorBean methodConfig = new ApiDocNodeDataConfiguratorBean(bean, method.getName(), ammo.targetClasses());
MaisDocNodeDataConfiguratorBean methodConfig = new MaisDocNodeDataConfiguratorBean(bean, method.getName(), ammo.targetClasses());
doc.addDataConfigurator(methodConfig);
}
}
public void configNodeData(ApiDoc doc, ApiDocNode node,ApiDocNodeData data) {
public void configNodeData(MaisDoc doc, MaisDocNode node,MaisDocNodeData data) {
Class<?> beanClass = getBean().getClass();
try {
Method methodBean = beanClass.getMethod(getMethod(), new Class[]{ApiDoc.class,ApiDocNode.class,ApiDocNodeData.class});
Method methodBean = beanClass.getMethod(getMethod(), new Class[]{MaisDoc.class,MaisDocNode.class,MaisDocNodeData.class});
methodBean.invoke(getBean(), new Object[]{doc,node,data});
} catch (Exception e) {
throw new IllegalStateException(e);

View file

@ -35,7 +35,7 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface ApiDocNodeDataConfiguratorMethod {
public @interface MaisDocNodeDataConfiguratorMethod {
Class<?>[] targetClasses();
}

View file

@ -27,11 +27,11 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.x4o.maisdoc.model.ApiDoc;
import org.x4o.maisdoc.model.ApiDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.ApiDocNodeWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent;
import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeWriter;
import org.x4o.maisdoc.model.MaisDocWriteEvent;
/**
* ApiDocNodeWriterBean wraps the ApiDocNodeWriterEvent to a single method of a bean.
@ -39,9 +39,9 @@ import org.x4o.maisdoc.model.ApiDocWriteEvent;
* @author Willem Cazander
* @version 1.0 May 1, 2013
*/
public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
public class MaisDocNodeWriterBean implements MaisDocNodeWriter {
private ApiDocNodeBody nodeBody = null;
private MaisDocNodeBody nodeBody = null;
private List<Integer> nodeBodyOrders = null;
private Object bean = null;
private String method = null;
@ -49,11 +49,11 @@ public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
private String contentGroup = null;
private String contentGroupType = null;
public ApiDocNodeWriterBean() {
public MaisDocNodeWriterBean() {
targetClasses = new ArrayList<Class<?>>(5);
}
public ApiDocNodeWriterBean(ApiDocNodeBody nodeBody,Object bean,String method,Class<?>...classes) {
public MaisDocNodeWriterBean(MaisDocNodeBody nodeBody,Object bean,String method,Class<?>...classes) {
this();
setNodeBody(nodeBody);
setBean(bean);
@ -63,7 +63,7 @@ public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
}
}
public static void addAnnotatedNodeContentWriters(ApiDoc doc,Object bean) {
public static void addAnnotatedNodeContentWriters(MaisDoc doc,Object bean) {
if (doc==null) {
throw new NullPointerException("Can't add to null ApiDoc.");
}
@ -71,7 +71,7 @@ public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
throw new NullPointerException("Can't scan null bean.");
}
for (Method method:bean.getClass().getMethods()) {
ApiDocNodeWriterMethod ammo = method.getAnnotation(ApiDocNodeWriterMethod.class);
MaisDocNodeWriterMethod ammo = method.getAnnotation(MaisDocNodeWriterMethod.class);
if (ammo==null) {
continue;
}
@ -81,7 +81,7 @@ public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
if (ammo.targetClasses().length!=ammo.nodeBodyOrders().length) {
throw new IllegalArgumentException("Can't configure writer bean with non-equal array size of 'nodeBodyOrders'("+ammo.nodeBodyOrders().length+") and 'targetClasses'("+ammo.targetClasses().length+") parameters.");
}
ApiDocNodeWriterBean methodWriter = new ApiDocNodeWriterBean(ammo.nodeBody(), bean, method.getName(), ammo.targetClasses());
MaisDocNodeWriterBean methodWriter = new MaisDocNodeWriterBean(ammo.nodeBody(), bean, method.getName(), ammo.targetClasses());
List<Integer> nodeBodyOrder = new ArrayList<Integer>();
for (int order:ammo.nodeBodyOrders()) {
nodeBodyOrder.add(order);
@ -97,10 +97,10 @@ public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
}
}
public void writeNodeContent(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
public void writeNodeContent(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
Class<?> beanClass = getBean().getClass();
try {
Method methodBean = beanClass.getMethod(getMethod(), new Class[]{ApiDocWriteEvent.class});
Method methodBean = beanClass.getMethod(getMethod(), new Class[]{MaisDocWriteEvent.class});
methodBean.invoke(getBean(), new Object[]{event});
} catch (Exception e) {
throw new IOException(e);
@ -122,14 +122,14 @@ public class ApiDocNodeWriterBean implements ApiDocNodeWriter {
/**
* @return the nodeBody
*/
public ApiDocNodeBody getNodeBody() {
public MaisDocNodeBody getNodeBody() {
return nodeBody;
}
/**
* @param nodeBody the nodeBody to set
*/
public void setNodeBody(ApiDocNodeBody nodeBody) {
public void setNodeBody(MaisDocNodeBody nodeBody) {
this.nodeBody = nodeBody;
}

View file

@ -27,7 +27,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.x4o.maisdoc.model.ApiDocNodeBody;
import org.x4o.maisdoc.model.MaisDocNodeBody;
/**
* ApiDocNodeBodyWriterMethod wraps api doc file writer events to a method.
@ -37,11 +37,11 @@ import org.x4o.maisdoc.model.ApiDocNodeBody;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface ApiDocNodeWriterMethod {
public @interface MaisDocNodeWriterMethod {
Class<?>[] targetClasses();
ApiDocNodeBody nodeBody();
MaisDocNodeBody nodeBody();
int[] nodeBodyOrders() default {-1};

View file

@ -32,8 +32,8 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.x4o.maisdoc.flake.ApiDocNodeDataConfiguratorBean;
import org.x4o.maisdoc.flake.ApiDocNodeWriterBean;
import org.x4o.maisdoc.flake.MaisDocNodeDataConfiguratorBean;
import org.x4o.maisdoc.flake.MaisDocNodeWriterBean;
/**
* ApiDoc holds all config and data to write a full api doc structure.
@ -41,20 +41,20 @@ import org.x4o.maisdoc.flake.ApiDocNodeWriterBean;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public class ApiDoc {
public class MaisDoc {
private String name = null;
private String description = null;
private ApiDocNode rootNode = null;
private ApiDocNode rootNodeTreePage = null;
private List<ApiDocNodeWriter> nodeBodyWriters = null;
private List<ApiDocConcept> concepts = null;
private MaisDocNode rootNode = null;
private MaisDocNode rootNodeTreePage = null;
private List<MaisDocNodeWriter> nodeBodyWriters = null;
private List<MaisDocConcept> concepts = null;
private String docCopyright = null;
private String docAbout = null;
private List<String> metaKeywords = null;
private File metaStyleSheet = null;
private String metaStyleSheetThema = null;
private List<ApiDocPage> docPages = null;
private List<MaisDocPage> docPages = null;
private Class<?> frameNavConceptClass = null;
private Boolean frameNavOverviewPrintParent = null;
private Boolean frameNavPrintParentId = null;
@ -62,16 +62,16 @@ public class ApiDoc {
private Boolean frameNavPrintParentParent = null;
private List<Class<?>> treeNodeClassExcludes = null;
private List<Class<?>> treeNodePageModeClass = null;
private List<ApiDocNodeDataConfigurator> dataConfigurators = null;
private List<MaisDocNodeDataConfigurator> dataConfigurators = null;
private List<Class<?>> annotatedClasses = null;
private ApiDocNodeData nodeData = null;
private MaisDocNodeData nodeData = null;
private String docStatsJS = null;
private String noFrameAllName = null;
private String noFrameAllLink = null;
private String noFrameAllTopJS = null;
private String noFrameAllBottomJS = null;
private boolean fillOnce = false;
private List<ApiDocRemoteClass> remoteClasses = null;
private List<MaisDocRemoteClass> remoteClasses = null;
private boolean skipRootTreePathNode = true;
private boolean printConceptTitle = true;
private boolean printConceptPrevNext = true;
@ -79,16 +79,16 @@ public class ApiDoc {
private Map<String,Integer> groupTypeOrder = null;
private String docPageSubTitle = null;
public ApiDoc() {
nodeBodyWriters = new ArrayList<ApiDocNodeWriter>(20);
concepts = new ArrayList<ApiDocConcept>(10);
public MaisDoc() {
nodeBodyWriters = new ArrayList<MaisDocNodeWriter>(20);
concepts = new ArrayList<MaisDocConcept>(10);
metaKeywords = new ArrayList<String>(5);
docPages = new ArrayList<ApiDocPage>(5);
docPages = new ArrayList<MaisDocPage>(5);
treeNodeClassExcludes = new ArrayList<Class<?>>(5);
treeNodePageModeClass = new ArrayList<Class<?>>(5);
dataConfigurators = new ArrayList<ApiDocNodeDataConfigurator>(5);
dataConfigurators = new ArrayList<MaisDocNodeDataConfigurator>(5);
annotatedClasses = new ArrayList<Class<?>>(5);
remoteClasses = new ArrayList<ApiDocRemoteClass>(5);
remoteClasses = new ArrayList<MaisDocRemoteClass>(5);
groupTypeNames = new HashMap<String,String>(3);
groupTypeOrder = new HashMap<String,Integer>(3);
}
@ -127,7 +127,7 @@ public class ApiDoc {
"if(window==top) {\n\tallClassesLink.style.display = \"block\";\n} else {\n\tallClassesLink.style.display = \"none\";\n}\n";
}
if (noFrameAllLink==null) {
ApiDocConcept navConcept = findConceptByClass(getFrameNavConceptClass());
MaisDocConcept navConcept = findConceptByClass(getFrameNavConceptClass());
setNoFrameAllLink("all"+navConcept.getId()+"-noframe.html");
}
@ -144,19 +144,19 @@ public class ApiDoc {
if (fillOnce) {
return;
}
setNodeData(new ApiDocNodeData());
setNodeData(new MaisDocNodeData());
try {
for (Class<?> annoClass:getAnnotatedClasses()) {
Object bean = annoClass.newInstance();
ApiDocNodeWriterBean.addAnnotatedNodeContentWriters(this,bean);
ApiDocNodeDataConfiguratorBean.addAnnotatedNodeDataConfigurators(this, bean);
MaisDocNodeWriterBean.addAnnotatedNodeContentWriters(this,bean);
MaisDocNodeDataConfiguratorBean.addAnnotatedNodeDataConfigurators(this, bean);
}
} catch (InstantiationException e) {
throw new IllegalArgumentException(e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException(e);
}
for (ApiDocConcept concept:getConcepts()) {
for (MaisDocConcept concept:getConcepts()) {
String navLink = "overview-"+concept.getId()+".html";
boolean resetHref = true;
if (concept.getParent()==null) {
@ -164,15 +164,15 @@ public class ApiDoc {
} else {
navLink = null; // rest start with null href's
}
ApiDocNavLink link = new ApiDocNavLink(concept.getId(), navLink, concept.getName(),concept.getName(),resetHref);
MaisDocNavLink link = new MaisDocNavLink(concept.getId(), navLink, concept.getName(),concept.getName(),resetHref);
getNodeData().addNavLink(link);
}
for (ApiDocPage page:getDocPages()) {
for (MaisDocPage page:getDocPages()) {
String navLink = page.getId()+".html";
ApiDocNavLink link = new ApiDocNavLink(page.getId(), navLink, page.getName(),page.getName(),false);
MaisDocNavLink link = new MaisDocNavLink(page.getId(), navLink, page.getName(),page.getName(),false);
getNodeData().addNavLink(link);
}
for (ApiDocRemoteClass rc:getRemoteClasses()) {
for (MaisDocRemoteClass rc:getRemoteClasses()) {
try {
rc.parseRemotePackageList();
} catch (IOException e) {
@ -188,12 +188,12 @@ public class ApiDoc {
}
}
public ApiDocConcept findConceptByClass(Class<?> objClass) {
for (ApiDocConcept concept:getConcepts()) {
public MaisDocConcept findConceptByClass(Class<?> objClass) {
for (MaisDocConcept concept:getConcepts()) {
if (concept.getConceptClass().isAssignableFrom(objClass)) {
return concept;
}
for (ApiDocConcept c:concept.getChildConcepts()) {
for (MaisDocConcept c:concept.getChildConcepts()) {
if (c.getConceptClass().isAssignableFrom(objClass)) {
return concept;
}
@ -202,17 +202,17 @@ public class ApiDoc {
return null;
}
public ApiDocConcept findConceptChildByNode(ApiDocNode node) {
public MaisDocConcept findConceptChildByNode(MaisDocNode node) {
Class<?> objClass = node.getUserData().getClass();
Class<?> parentClass = null;
if (node.getParent()!=null) {
parentClass = node.getParent().getUserData().getClass();
}
for (ApiDocConcept concept:getConcepts()) {
for (MaisDocConcept concept:getConcepts()) {
if (parentClass!=null && concept.getConceptClass().isAssignableFrom(parentClass)==false) {
continue;
}
for (ApiDocConcept c:concept.getChildConcepts()) {
for (MaisDocConcept c:concept.getChildConcepts()) {
if (c.getConceptClass().isAssignableFrom(objClass)) {
return c;
}
@ -221,15 +221,15 @@ public class ApiDoc {
return null;
}
public List<ApiDocRemoteClass> getRemoteClasses() {
public List<MaisDocRemoteClass> getRemoteClasses() {
return remoteClasses;
}
public void addRemoteClass(ApiDocRemoteClass remoteClass) {
public void addRemoteClass(MaisDocRemoteClass remoteClass) {
remoteClasses.add(remoteClass);
}
public void removeRemoteClass(ApiDocRemoteClass remoteClass) {
public void removeRemoteClass(MaisDocRemoteClass remoteClass) {
remoteClasses.add(remoteClass);
}
@ -245,41 +245,41 @@ public class ApiDoc {
annotatedClasses.add(annotatedClass);
}
public List<ApiDocNodeDataConfigurator> getDataConfigurators() {
public List<MaisDocNodeDataConfigurator> getDataConfigurators() {
return dataConfigurators;
}
public void removeDataConfigurator(ApiDocNodeDataConfigurator conf) {
public void removeDataConfigurator(MaisDocNodeDataConfigurator conf) {
dataConfigurators.remove(conf);
}
public void addDataConfigurator(ApiDocNodeDataConfigurator conf) {
public void addDataConfigurator(MaisDocNodeDataConfigurator conf) {
dataConfigurators.add(conf);
}
public ApiDocNodeWriter addNodeBodyWriter(ApiDocNodeWriter writer) {
public MaisDocNodeWriter addNodeBodyWriter(MaisDocNodeWriter writer) {
nodeBodyWriters.add(writer);
return writer;
}
public boolean removeNodeBodyWriter(ApiDocNodeWriter writer) {
public boolean removeNodeBodyWriter(MaisDocNodeWriter writer) {
return nodeBodyWriters.remove(writer);
}
public List<ApiDocNodeWriter> getNodeBodyWriters() {
public List<MaisDocNodeWriter> getNodeBodyWriters() {
return nodeBodyWriters;
}
public ApiDocConcept addConcept(ApiDocConcept concept) {
public MaisDocConcept addConcept(MaisDocConcept concept) {
concepts.add(concept);
return concept;
}
public boolean removeConcept(ApiDocConcept concept) {
public boolean removeConcept(MaisDocConcept concept) {
return concepts.remove(concept);
}
public List<ApiDocConcept> getConcepts() {
public List<MaisDocConcept> getConcepts() {
return concepts;
}
@ -381,24 +381,24 @@ public class ApiDoc {
this.docAbout = docAbout;
}
public ApiDocPage addDocPage(ApiDocPage page) {
public MaisDocPage addDocPage(MaisDocPage page) {
docPages.add(page);
return page;
}
public boolean removeDocPage(ApiDocPage page) {
public boolean removeDocPage(MaisDocPage page) {
return docPages.remove(page);
}
public List<ApiDocPage> getDocPages() {
public List<MaisDocPage> getDocPages() {
return docPages;
}
public ApiDocPage findDocPageById(String docPageId) {
public MaisDocPage findDocPageById(String docPageId) {
if (docPageId==null) {
throw new NullPointerException("Can't search for null id.");
}
for (ApiDocPage page:docPages) {
for (MaisDocPage page:docPages) {
if (page.getId().equals(docPageId)) {
return page;
}
@ -463,28 +463,28 @@ public class ApiDoc {
/**
* @return the rootNodeTreePage
*/
public ApiDocNode getRootNodeTreePage() {
public MaisDocNode getRootNodeTreePage() {
return rootNodeTreePage;
}
/**
* @param rootNodeTreePage the rootNodeTreePage to set
*/
public void setRootNodeTreePage(ApiDocNode rootNodeTreePage) {
public void setRootNodeTreePage(MaisDocNode rootNodeTreePage) {
this.rootNodeTreePage = rootNodeTreePage;
}
/**
* @return the rootNode
*/
public ApiDocNode getRootNode() {
public MaisDocNode getRootNode() {
return rootNode;
}
/**
* @param rootNode the rootNode to set
*/
public void setRootNode(ApiDocNode rootNode) {
public void setRootNode(MaisDocNode rootNode) {
this.rootNode = rootNode;
}
@ -561,14 +561,14 @@ public class ApiDoc {
/**
* @return the nodeData
*/
public ApiDocNodeData getNodeData() {
public MaisDocNodeData getNodeData() {
return nodeData;
}
/**
* @param nodeData the nodeData to set
*/
public void setNodeData(ApiDocNodeData nodeData) {
public void setNodeData(MaisDocNodeData nodeData) {
this.nodeData = nodeData;
}

View file

@ -31,32 +31,32 @@ import java.util.List;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public class ApiDocConcept {
public class MaisDocConcept {
private String id = null;
private String name = null;
private String descriptionName = null;
private String descriptionHelp = null;
private ApiDocConcept parent = null;
private MaisDocConcept parent = null;
private Class<?> conceptClass = null;
private List<ApiDocConcept> childConcepts = null;
private List<MaisDocConcept> childConcepts = null;
public ApiDocConcept() {
childConcepts = new ArrayList<ApiDocConcept>(5);
public MaisDocConcept() {
childConcepts = new ArrayList<MaisDocConcept>(5);
}
public ApiDocConcept(ApiDocConcept parent,String id,Class<?> conceptClass) {
public MaisDocConcept(MaisDocConcept parent,String id,Class<?> conceptClass) {
this();
setId(id);
setConceptClass(conceptClass);
setParent(parent);
}
public ApiDocConcept(ApiDocConcept parent,String[] text,Class<?> conceptClass) {
public MaisDocConcept(MaisDocConcept parent,String[] text,Class<?> conceptClass) {
this(parent,text[0],text[1],text[2],text[3],conceptClass);
}
public ApiDocConcept(ApiDocConcept parent,String id,String name,String descriptionName,String descriptionHelp,Class<?> conceptClass) {
public MaisDocConcept(MaisDocConcept parent,String id,String name,String descriptionName,String descriptionHelp,Class<?> conceptClass) {
this(parent,id,conceptClass);
setName(name);
setDescriptionName(descriptionName);
@ -133,29 +133,29 @@ public class ApiDocConcept {
this.conceptClass = conceptClass;
}
public void addChildConcepts(ApiDocConcept childConcept) {
public void addChildConcepts(MaisDocConcept childConcept) {
childConcepts.add(childConcept);
}
public void removeChildConcept(ApiDocConcept childConcept) {
public void removeChildConcept(MaisDocConcept childConcept) {
childConcepts.remove(childConcept);
}
public List<ApiDocConcept> getChildConcepts() {
public List<MaisDocConcept> getChildConcepts() {
return childConcepts;
}
/**
* @return the parent
*/
public ApiDocConcept getParent() {
public MaisDocConcept getParent() {
return parent;
}
/**
* @param parent the parent to set
*/
public void setParent(ApiDocConcept parent) {
public void setParent(MaisDocConcept parent) {
this.parent = parent;
}

View file

@ -28,7 +28,7 @@ package org.x4o.maisdoc.model;
* @author Willem Cazander
* @version 1.0 Nov 09, 2013
*/
public class ApiDocIndexItem {
public class MaisDocIndexItem {
private String linkHref = null;
private String linkText = null;
@ -38,7 +38,7 @@ public class ApiDocIndexItem {
private String title = null;
private String description = null;
public ApiDocIndexItem() {
public MaisDocIndexItem() {
}
/**

View file

@ -28,7 +28,7 @@ package org.x4o.maisdoc.model;
* @author Willem Cazander
* @version 1.0 Aug 11, 2013
*/
public class ApiDocNavLink {
public class MaisDocNavLink {
private String id = null;
private String href = null;
@ -36,10 +36,10 @@ public class ApiDocNavLink {
private String text = null;
private boolean resetHref = false;
public ApiDocNavLink() {
public MaisDocNavLink() {
}
public ApiDocNavLink(String id,String href,String title,String text,boolean resetHref) {
public MaisDocNavLink(String id,String href,String title,String text,boolean resetHref) {
setId(id);
setHref(href);
setTitle(title);

View file

@ -31,20 +31,20 @@ import java.util.List;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public class ApiDocNode {
public class MaisDocNode {
private Object userData = null;
private String id = null;
private String name = null;
private String description = null;
private ApiDocNode parent = null;
private List<ApiDocNode> nodes = null;
private MaisDocNode parent = null;
private List<MaisDocNode> nodes = null;
public ApiDocNode() {
nodes = new ArrayList<ApiDocNode>(30);
public MaisDocNode() {
nodes = new ArrayList<MaisDocNode>(30);
}
public ApiDocNode(Object userData,String id,String name,String description) {
public MaisDocNode(Object userData,String id,String name,String description) {
this();
setUserData(userData);
setId(id);
@ -55,17 +55,17 @@ public class ApiDocNode {
setDescription(description);
}
public ApiDocNode addNode(ApiDocNode node) {
public MaisDocNode addNode(MaisDocNode node) {
node.setParent(this);
nodes.add(node);
return node;
}
public boolean removeNode(ApiDocNode node) {
public boolean removeNode(MaisDocNode node) {
return nodes.remove(node);
}
public List<ApiDocNode> getNodes() {
public List<MaisDocNode> getNodes() {
return nodes;
}
@ -133,14 +133,14 @@ public class ApiDocNode {
/**
* @return the parent
*/
public ApiDocNode getParent() {
public MaisDocNode getParent() {
return parent;
}
/**
* @param parent the parent to set
*/
public void setParent(ApiDocNode parent) {
public void setParent(MaisDocNode parent) {
this.parent = parent;
}
}

View file

@ -28,7 +28,7 @@ package org.x4o.maisdoc.model;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public enum ApiDocNodeBody {
public enum MaisDocNodeBody {
TREE_PATH,
DESCRIPTION_LINKS,

View file

@ -33,30 +33,30 @@ import java.util.Map;
* @author Willem Cazander
* @version 1.0 Aug 11, 2013
*/
public class ApiDocNodeData {
public class MaisDocNodeData {
private String prefixPath;
private String navSelected = null;
private List<String> groupTypeKeys = null;
private Map<String,List<ApiDocNavLink>> groupTypeLinks = null;
private Map<String,List<MaisDocNavLink>> groupTypeLinks = null;
private String prevLink = null;
private String nextLink = null;
private String framePath = null;;
private List<ApiDocNavLink> navLinks = null;
private List<ApiDocIndexItem> indexItems = null;
private List<MaisDocNavLink> navLinks = null;
private List<MaisDocIndexItem> indexItems = null;
public ApiDocNodeData() {
navLinks = new ArrayList<ApiDocNavLink>(12);
public MaisDocNodeData() {
navLinks = new ArrayList<MaisDocNavLink>(12);
groupTypeKeys = new ArrayList<String>(navLinks.size()/3);
groupTypeLinks = new HashMap<String,List<ApiDocNavLink>>(groupTypeKeys.size());
indexItems = new ArrayList<ApiDocIndexItem>(500);
groupTypeLinks = new HashMap<String,List<MaisDocNavLink>>(groupTypeKeys.size());
indexItems = new ArrayList<MaisDocIndexItem>(500);
}
public List<ApiDocIndexItem> getIndexItems() {
public List<MaisDocIndexItem> getIndexItems() {
return indexItems;
}
public void addIndexItem(ApiDocIndexItem indexItem) {
public void addIndexItem(MaisDocIndexItem indexItem) {
indexItems.add(indexItem);
}
@ -68,26 +68,26 @@ public class ApiDocNodeData {
return groupTypeKeys;
}
public void addGroupTypeLink(String groupTypeKey,ApiDocNavLink link) {
List<ApiDocNavLink> result = groupTypeLinks.get(groupTypeKey);
public void addGroupTypeLink(String groupTypeKey,MaisDocNavLink link) {
List<MaisDocNavLink> result = groupTypeLinks.get(groupTypeKey);
if (result==null) {
result = new ArrayList<ApiDocNavLink>(10);
result = new ArrayList<MaisDocNavLink>(10);
groupTypeLinks.put(groupTypeKey, result);
}
result.add(link);
}
public List<ApiDocNavLink> getGroupTypeLinks(String groupTypeKey) {
List<ApiDocNavLink> result = groupTypeLinks.get(groupTypeKey);
public List<MaisDocNavLink> getGroupTypeLinks(String groupTypeKey) {
List<MaisDocNavLink> result = groupTypeLinks.get(groupTypeKey);
if (result==null) {
result = new ArrayList<ApiDocNavLink>(0);
result = new ArrayList<MaisDocNavLink>(0);
}
return result;
}
public ApiDocNavLink getGroupTypeLink(String groupTypeKey,String group) {
List<ApiDocNavLink> links = getGroupTypeLinks(groupTypeKey);
for (ApiDocNavLink link:links) {
public MaisDocNavLink getGroupTypeLink(String groupTypeKey,String group) {
List<MaisDocNavLink> links = getGroupTypeLinks(groupTypeKey);
for (MaisDocNavLink link:links) {
if (link.getId().equals(group)) {
return link;
}
@ -99,12 +99,12 @@ public class ApiDocNodeData {
groupTypeLinks.clear();
}
public List<ApiDocNavLink> getNavLinks() {
public List<MaisDocNavLink> getNavLinks() {
return navLinks;
}
public ApiDocNavLink getNavLinkById(String id) {
for (ApiDocNavLink link:navLinks) {
public MaisDocNavLink getNavLinkById(String id) {
for (MaisDocNavLink link:navLinks) {
if (link.getId().equals(id)) {
return link;
}
@ -112,11 +112,11 @@ public class ApiDocNodeData {
return null;
}
public void addNavLink(ApiDocNavLink link) {
public void addNavLink(MaisDocNavLink link) {
navLinks.add(link);
}
public void removeNavLink(ApiDocNavLink link) {
public void removeNavLink(MaisDocNavLink link) {
navLinks.remove(link);
}

View file

@ -30,9 +30,9 @@ import java.util.List;
* @author Willem Cazander
* @version 1.0 Aug 11, 2013
*/
public interface ApiDocNodeDataConfigurator {
public interface MaisDocNodeDataConfigurator {
List<Class<?>> getTargetClasses();
void configNodeData(ApiDoc doc,ApiDocNode node,ApiDocNodeData data);
void configNodeData(MaisDoc doc,MaisDocNode node,MaisDocNodeData data);
}

View file

@ -31,13 +31,13 @@ import java.util.List;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public interface ApiDocNodeWriter {
public interface MaisDocNodeWriter {
ApiDocNodeBody getNodeBody();
MaisDocNodeBody getNodeBody();
List<Class<?>> getTargetClasses();
List<Integer> getNodeBodyOrders();
String getContentGroup();
String getContentGroupType();
void writeNodeContent(ApiDocWriteEvent<ApiDocNode> e) throws IOException;
void writeNodeContent(MaisDocWriteEvent<MaisDocNode> e) throws IOException;
}

View file

@ -31,23 +31,23 @@ import java.util.List;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public class ApiDocPage {
public class MaisDocPage {
private String id = null;
private String name = null;
private String description = null;
private List<ApiDocPageWriter> pageWriters = null;
private List<MaisDocPageWriter> pageWriters = null;
public ApiDocPage() {
pageWriters = new ArrayList<ApiDocPageWriter>(30);
public MaisDocPage() {
pageWriters = new ArrayList<MaisDocPageWriter>(30);
}
public ApiDocPage(String id,String name,String description,ApiDocPageWriter...writers) {
public MaisDocPage(String id,String name,String description,MaisDocPageWriter...writers) {
this();
setId(id);
setName(name);
setDescription(description);
for (ApiDocPageWriter writer:writers) {
for (MaisDocPageWriter writer:writers) {
addPageWriter(writer);
}
}
@ -97,21 +97,21 @@ public class ApiDocPage {
/**
* @return the page writers.
*/
public List<ApiDocPageWriter> getPageWriters() {
public List<MaisDocPageWriter> getPageWriters() {
return pageWriters;
}
/**
* @param writer the writer to add.
*/
public void addPageWriter(ApiDocPageWriter writer) {
public void addPageWriter(MaisDocPageWriter writer) {
pageWriters.add(writer);
}
/**
* @param writer the writer to add.
*/
public void removePageWriter(ApiDocPageWriter writer) {
public void removePageWriter(MaisDocPageWriter writer) {
pageWriters.remove(writer);
}
}

View file

@ -30,7 +30,7 @@ import java.io.IOException;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public interface ApiDocPageWriter {
public interface MaisDocPageWriter {
void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException;
void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException;
}

View file

@ -39,10 +39,10 @@ import java.util.logging.Logger;
* @author Willem Cazander
* @version 1.0 Aug 15, 2013
*/
public class ApiDocRemoteClass {
public class MaisDocRemoteClass {
public final static String REMOTE_FILE = "package-list";
private Logger logger = Logger.getLogger(ApiDocRemoteClass.class.getName());
private Logger logger = Logger.getLogger(MaisDocRemoteClass.class.getName());
private String docUrl = null;
private String packageListUrl = null;
private List<String> packageList = null;
@ -50,7 +50,7 @@ public class ApiDocRemoteClass {
/**
* Creates the ApiDocRemoteClass.
*/
private ApiDocRemoteClass() {
private MaisDocRemoteClass() {
packageList = new ArrayList<String>(100);
}
@ -58,7 +58,7 @@ public class ApiDocRemoteClass {
* Creates the ApiDocRemoteClass with a javadoc url to fetch the package-list from.
* @param docUrl The remote javadoc base url.
*/
public ApiDocRemoteClass(String docUrl) {
public MaisDocRemoteClass(String docUrl) {
this();
setDocUrl(docUrl);
}
@ -68,7 +68,7 @@ public class ApiDocRemoteClass {
* @param docUrl The remote javadoc base url.
* @param packageListUrl The remote/local package-list url.
*/
public ApiDocRemoteClass(String docUrl,String packageListUrl) {
public MaisDocRemoteClass(String docUrl,String packageListUrl) {
this(docUrl);
setPackageListUrl(packageListUrl);
}

View file

@ -22,7 +22,7 @@
*/
package org.x4o.maisdoc.model;
import org.x4o.maisdoc.flake.ApiDocContentWriter;
import org.x4o.maisdoc.flake.MaisDocContentWriter;
/**
* ApiDocWriteEvent holds the needed objects to process write events of content parts.
@ -30,11 +30,11 @@ import org.x4o.maisdoc.flake.ApiDocContentWriter;
* @author Willem Cazander
* @version 1.0 May 12, 2013
*/
public class ApiDocWriteEvent<T> {
public class MaisDocWriteEvent<T> {
private ApiDoc doc = null;
private MaisDoc doc = null;
private T eventObject = null;
private ApiDocContentWriter writer = null;
private MaisDocContentWriter writer = null;
/**
* Creates an ApiDocNodeBodyEvent.
@ -42,7 +42,7 @@ public class ApiDocWriteEvent<T> {
* @param writer The content writer to write to.
* @param eventObject The event we are firing this event for.
*/
public ApiDocWriteEvent(ApiDoc doc,ApiDocContentWriter writer,T eventObject) {
public MaisDocWriteEvent(MaisDoc doc,MaisDocContentWriter writer,T eventObject) {
this.doc=doc;
this.writer=writer;
this.eventObject=eventObject;
@ -51,7 +51,7 @@ public class ApiDocWriteEvent<T> {
/**
* @return the doc
*/
public ApiDoc getDoc() {
public MaisDoc getDoc() {
return doc;
}
@ -65,7 +65,7 @@ public class ApiDocWriteEvent<T> {
/**
* @return the writer
*/
public ApiDocContentWriter getWriter() {
public MaisDocContentWriter getWriter() {
return writer;
}
}