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.Arrays;
import java.util.List; import java.util.List;
import org.x4o.maisdoc.ApiDocProject; import org.x4o.maisdoc.MaisDocProject;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注; import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@ -53,10 +53,10 @@ public class Java3Documentation extends PrintStream {
public void start(List<String> args) { public void start(List<String> args) {
println("TODO:"); 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; return null;
// try { // try {
// return PopCornDriver.newInstance().createReader().readFile(popcornFile); // 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.FourCornerDotCake;
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0; import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.model.ApiDocPage; import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter; import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag; import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable; import org.x4o.sax3.io.ContentCloseable;
@ -44,37 +44,37 @@ import org.x4o.sax3.io.ContentCloseable;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Jan 17, 2025 * @version 1.0 Jan 17, 2025
*/ */
public class FCDocPageWriterBaklava implements ApiDocPageWriter, FCDocSegmentWriter { public class FCDocPageWriterBaklava implements MaisDocPageWriter, FCDocSegmentWriter {
public static ApiDocPage createDocPage() { public static MaisDocPage createDocPage() {
return new ApiDocPage("overview-baklave","Baklava","Overview of all 6 bit baklava NCR1632 fractions.",new FCDocPageWriterBaklava()); return new MaisDocPage("overview-baklave","Baklava","Overview of all 6 bit baklava NCR1632 fractions.",new FCDocPageWriterBaklava());
} }
// TODO: make all symbols href links // TODO: make all symbols href links
@Override @Override
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException { public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
ApiDocContentWriter writer = e.getWriter(); MaisDocContentWriter writer = e.getWriter();
try (ContentCloseable content = writer.docPageContent()) { 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); writeTableBoxHeaderNumeric(writer, 28);
writePIN(writer); writePIN(writer);
} }
} }
} }
private void writePIN(ApiDocContentWriter writer) throws IOException { private void writePIN(MaisDocContentWriter writer) throws IOException {
for (int t = 0; t < 27; t++) { for (int t = 0; t < 27; t++) {
try (ContentCloseable tableRow = writer.docTableRow()) { try (ContentCloseable tableRow = writer.docTableRow()) {
String prefixNCR = String.format("T%03d", t + 1); String prefixNCR = String.format("T%03d", t + 1);
writer.printTagStart(Tag.td, ApiDocContentCss.colOne); writer.printTagStart(Tag.td, MaisDocContentCss.colOne);
writer.printCharacters(prefixNCR); writer.printCharacters(prefixNCR);
writer.printTagEnd(Tag.td); writer.printTagEnd(Tag.td);
for (int i = 0; i < 27; i++) { for (int i = 0; i < 27; i++) {
if (i + 1 < 27) { if (i + 1 < 27) {
writer.printTagStart(Tag.td); writer.printTagStart(Tag.td);
} else { } else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast); writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
} }
if (i > t) { if (i > t) {
writer.printTagEnd(Tag.td); 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.FCDotBYD0127DashP7D;
import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7E; import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7E;
import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7F; import org.x4o.fc18.cake2.zero33.FCDotBYD0127DashP7F;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.model.ApiDocPage; import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter; import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag; import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable; import org.x4o.sax3.io.ContentCloseable;
@ -47,19 +47,19 @@ import org.x4o.sax3.io.ContentCloseable;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Jan 17, 2025 * @version 1.0 Jan 17, 2025
*/ */
public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWriter { public class FCDocPageWriterMuffin implements MaisDocPageWriter, FCDocSegmentWriter {
public static ApiDocPage createDocPage() { public static MaisDocPage createDocPage() {
return new ApiDocPage("overview-muffin","Muffins","Overview of all muffin symbols.",new FCDocPageWriterMuffin()); return new MaisDocPage("overview-muffin","Muffins","Overview of all muffin symbols.",new FCDocPageWriterMuffin());
} }
// TODO: make all symbols href links // TODO: make all symbols href links
@Override @Override
public void writePageContent(ApiDocWriteEvent<ApiDocPage> e) throws IOException { public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
ApiDocContentWriter writer = e.getWriter(); MaisDocContentWriter writer = e.getWriter();
try (ContentCloseable content = writer.docPageContent()) { 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); writeTableBoxHeaderNumeric(writer, 17);
writeCDC(writer, 0x00); writeCDC(writer, 0x00);
writeCDC(writer, 0x10); writeCDC(writer, 0x10);
@ -69,7 +69,7 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
} }
try (ContentCloseable content = writer.docPageContent()) { try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_APL0127_P7A.nameSpec().replaceAll("P7A", "P7x"); 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); writeTableBoxHeaderNumeric(writer, 28, true);
writeP7x(writer, FourCornerDotCake.FC_APL0127_P7A, v -> FCDotAPL0127DashP7A.valueOf(v).codePointDotIndex()); writeP7x(writer, FourCornerDotCake.FC_APL0127_P7A, v -> FCDotAPL0127DashP7A.valueOf(v).codePointDotIndex());
writeP7x(writer, FourCornerDotCake.FC_APL0127_P7B, v -> FCDotAPL0127DashP7B.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()) { try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_BYD0127_P7D.nameSpec().replaceAll("P7D", "P7x"); 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); writeTableBoxHeaderNumeric(writer, 28, true);
writeP7x(writer, FourCornerDotCake.FC_BYD0127_P7D, v -> FCDotBYD0127DashP7D.valueOf(v).codePointDotIndex()); writeP7x(writer, FourCornerDotCake.FC_BYD0127_P7D, v -> FCDotBYD0127DashP7D.valueOf(v).codePointDotIndex());
writeP7x(writer, FourCornerDotCake.FC_BYD0127_P7E, v -> FCDotBYD0127DashP7E.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()) { try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_PIE9C_01.nameSpec().replaceAll("01", "Cake"); 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); writeTableBoxHeaderNumeric(writer, 28, true);
writePIE(writer, FourCornerDotCake.FC_PIE9C_01); writePIE(writer, FourCornerDotCake.FC_PIE9C_01);
writePIE(writer, FourCornerDotCake.FC_PIE9C_02); writePIE(writer, FourCornerDotCake.FC_PIE9C_02);
@ -120,7 +120,7 @@ public class FCDocPageWriterMuffin implements ApiDocPageWriter, FCDocSegmentWrit
} }
try (ContentCloseable content = writer.docPageContent()) { try (ContentCloseable content = writer.docPageContent()) {
String xSpec = FourCornerDotCake.FC_PIE9D_01.nameSpec().replaceAll("01", "Cake"); 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); writeTableBoxHeaderNumeric(writer, 28, true);
writePIE(writer, FourCornerDotCake.FC_PIE9D_01); writePIE(writer, FourCornerDotCake.FC_PIE9D_01);
writePIE(writer, FourCornerDotCake.FC_PIE9D_02); 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()) { try (ContentCloseable tableRow = writer.docTableRow()) {
String prefixHex = String.format("0x%06X", slice.getStart()); String prefixHex = String.format("0x%06X", slice.getStart());
writer.printTagStart(Tag.td, ApiDocContentCss.colFirst); writer.printTagStart(Tag.td, MaisDocContentCss.colFirst);
writer.printCharacters(prefixHex); writer.printCharacters(prefixHex);
writer.printTagEnd(Tag.td); writer.printTagEnd(Tag.td);
writer.printTagStart(Tag.td, ApiDocContentCss.colOne); writer.printTagStart(Tag.td, MaisDocContentCss.colOne);
writer.printCharacters(slice.nameSpec()); writer.printCharacters(slice.nameSpec());
writer.printTagEnd(Tag.td); writer.printTagEnd(Tag.td);
for (int i = 0; i < 27; i++) { for (int i = 0; i < 27; i++) {
if (i + 1 < 27) { if (i + 1 < 27) {
writer.printTagStart(Tag.td); writer.printTagStart(Tag.td);
} else { } else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast); writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
} }
if (i >= slice.getLength()) { if (i >= slice.getLength()) {
writer.printTagEnd(Tag.td); 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.FourCornerDotCake;
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.sax3.SAX3WriterHtml.Tag; import org.x4o.sax3.SAX3WriterHtml.Tag;
import org.x4o.sax3.io.ContentCloseable; import org.x4o.sax3.io.ContentCloseable;
import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.AttributesImpl;
@ -41,13 +41,13 @@ import org.xml.sax.helpers.AttributesImpl;
*/ */
public interface FCDocSegmentWriter { 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()); String prefixHex = String.format("0x%06X", slice.getStart());
try (ContentCloseable tableRow = writer.docTableRow()) { 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); 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()); writer.printCharacters(slice.nameSpec());
} }
for (int i = 0; i < 27; i++) { for (int i = 0; i < 27; i++) {
@ -55,7 +55,7 @@ public interface FCDocSegmentWriter {
if (i + 1 < 27) { if (i + 1 < 27) {
writer.printTagStart(Tag.td); writer.printTagStart(Tag.td);
} else { } else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast); writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
} }
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
if (codePoint == '\u0000') { 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); String prefixHex = String.format("0x%05X0", off >> 4);
try (ContentCloseable tableRow = writer.docTableRow()) { try (ContentCloseable tableRow = writer.docTableRow()) {
writer.printTagStart(Tag.td, ApiDocContentCss.colOne); writer.printTagStart(Tag.td, MaisDocContentCss.colOne);
writer.printCharacters(prefixHex); writer.printCharacters(prefixHex);
writer.printTagEnd(Tag.td); writer.printTagEnd(Tag.td);
for (int i = off; i < 16 + off; i++) { for (int i = off; i < 16 + off; i++) {
@ -81,7 +81,7 @@ public interface FCDocSegmentWriter {
if (i + 1 < 16 + off) { if (i + 1 < 16 + off) {
writer.printTagStart(Tag.td); writer.printTagStart(Tag.td);
} else { } else {
writer.printTagStart(Tag.td, ApiDocContentCss.colLast); writer.printTagStart(Tag.td, MaisDocContentCss.colLast);
} }
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
if (codePoint == '\u0000') { 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)) { try (ContentCloseable td = writer.printTag(Tag.tr)) {
AttributesImpl atts; AttributesImpl atts;
for (int i = 0; i < headers.length; i++) { for (int i = 0; i < headers.length; i++) {
atts = new AttributesImpl(); atts = new AttributesImpl();
if (i == 0) { if (i == 0) {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colFirst.name()); atts.addAttribute("", "class", "", "", MaisDocContentCss.colFirst.name());
} else if (i == 1) { } else if (i == 1) {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colOne.name()); atts.addAttribute("", "class", "", "", MaisDocContentCss.colOne.name());
} else { } else {
atts.addAttribute("", "class", "", "", ApiDocContentCss.colLast.name()); atts.addAttribute("", "class", "", "", MaisDocContentCss.colLast.name());
} }
atts.addAttribute("", "scope", "", "", "col"); atts.addAttribute("", "scope", "", "", "col");
try (ContentCloseable th = writer.printTag(Tag.th, atts)) { 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); 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); writer.printTagStart(Tag.tr);
AttributesImpl atts; AttributesImpl atts;
if (colFirst) { if (colFirst) {
atts = new AttributesImpl(); atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colFirst.name()); atts.addAttribute("", "class", "", "", MaisDocContentCss.colFirst.name());
atts.addAttribute("", "scope", "", "", "col"); atts.addAttribute("", "scope", "", "", "col");
writer.printTagStart(Tag.th, atts); writer.printTagStart(Tag.th, atts);
writer.printTagEnd(Tag.th); writer.printTagEnd(Tag.th);
} }
atts = new AttributesImpl(); atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colOne.name()); atts.addAttribute("", "class", "", "", MaisDocContentCss.colOne.name());
atts.addAttribute("", "scope", "", "", "col"); atts.addAttribute("", "scope", "", "", "col");
writer.printTagStart(Tag.th, atts); writer.printTagStart(Tag.th, atts);
writer.printTagEnd(Tag.th); writer.printTagEnd(Tag.th);
for (int i = 0; i < num - 1; i++) { for (int i = 0; i < num - 1; i++) {
atts = new AttributesImpl(); atts = new AttributesImpl();
atts.addAttribute("", "class", "", "", ApiDocContentCss.colLast.name()); atts.addAttribute("", "class", "", "", MaisDocContentCss.colLast.name());
atts.addAttribute("", "scope", "", "", "col"); atts.addAttribute("", "scope", "", "", "col");
writer.printTagStart(Tag.th, atts); writer.printTagStart(Tag.th, atts);
writer.printCharacters("0x"); writer.printCharacters("0x");

View file

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

View file

@ -26,13 +26,13 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import org.x4o.fc18.cake2.FourCornerDotCake; import org.x4o.fc18.cake2.FourCornerDotCake;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod; import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocConcept; import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody; import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.io.ContentCloseable; import org.x4o.sax3.io.ContentCloseable;
/** /**
@ -45,33 +45,33 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter {
// NOTE: Table are not allowed in details // NOTE: Table are not allowed in details
// @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=20) // @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 // NOTE: copyed from defaultWriteSummary as that only called with zero summaries + changes name end in; Words
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
ApiDocNode parent = event.getEventObject(); MaisDocNode parent = event.getEventObject();
ApiDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass()); MaisDocConcept concept = event.getDoc().findConceptByClass(parent.getUserData().getClass());
List<ApiDocNode> nodes = parent.getNodes(); List<MaisDocNode> nodes = parent.getNodes();
if (nodes.isEmpty()) { if (nodes.isEmpty()) {
return; return;
} }
String name = concept.getName()+" Words"; 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"); writer.docTableHeader("Name", "Description");
for (ApiDocNode child : nodes) { for (MaisDocNode child : nodes) {
String link = ApiDocContentWriter.toSafeUri(child.getId())+"/index.html"; String link = MaisDocContentWriter.toSafeUri(child.getId())+"/index.html";
if (parent.getParent()==null) { 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.docTableRowLink(link,child.getName(),child.getDescription());
} }
writer.docTableEnd(); writer.docTableEnd();
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=1) @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=1)
public void writeCakeSliceDetails(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeCakeSliceDetails(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
FourCornerDotCake slice = event.getEventObject().toUserData(TDocCakeSlice.class).getSlice(); 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.docTableHeader("Information", "Value");
writer.docTableRow("Start index", String.format("0x%06X", slice.getStart())); writer.docTableRow("Start index", String.format("0x%06X", slice.getStart()));
writer.docTableRow("Stop index", String.format("0x%06X", slice.getStop())); 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.FourCornerX18CakePointDotName;
import org.x4o.fc18.cake2.FourCornerX18CakePointSequence; import org.x4o.fc18.cake2.FourCornerX18CakePointSequence;
import org.x4o.fc18.cake2.FourCornerX21CodePointSequence; import org.x4o.fc18.cake2.FourCornerX21CodePointSequence;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod; import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody; import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.fc18.cake2.FourCornerX00PetitVide; import org.x4o.fc18.cake2.FourCornerX00PetitVide;
import org.x4o.sax3.SAX3WriterHtml.Tag; import org.x4o.sax3.SAX3WriterHtml.Tag;
@ -52,9 +52,9 @@ import org.x4o.sax3.SAX3WriterHtml.Tag;
*/ */
public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter { public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={TDocCakeWord.class}) @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={TDocCakeWord.class})
public void writeCakeWordSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeCakeWordSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
TDocCakeWord word = event.getEventObject().toUserData(TDocCakeWord.class); TDocCakeWord word = event.getEventObject().toUserData(TDocCakeWord.class);
FourCornerX00PetitVide[] videPoints = word.getSlice().getVidePoints(); FourCornerX00PetitVide[] videPoints = word.getSlice().getVidePoints();
if (videPoints.length == 0) { if (videPoints.length == 0) {
@ -70,7 +70,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
Optional<FourCornerX18CakePointSequence> x18CakeSequence = videPoint.kaasX18CakeSequence(); Optional<FourCornerX18CakePointSequence> x18CakeSequence = videPoint.kaasX18CakeSequence();
Optional<FourCornerX18CakePointDotName> x18DotName = videPoint.kaasX18CakeDotName(); 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"); writer.docTableHeader("Point", "Value");
String name = word.toString(); String name = word.toString();
String value = ""; String value = "";
@ -130,7 +130,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
Optional<FourCornerX00PetitVideCoinCarne> x00CoinCarne = videPoint.kaasX00CoinCarne(); Optional<FourCornerX00PetitVideCoinCarne> x00CoinCarne = videPoint.kaasX00CoinCarne();
if (x00CoinCarne.isPresent()) { if (x00CoinCarne.isPresent()) {
FourCornerX00PetitVideCoinCarne cornerKerning = x00CoinCarne.get(); 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.docTableHeader("Location", "Corner dents");
writer.docTableRow("Top", cornerKerning.coinCarneFrapper().kerningTop().name()); writer.docTableRow("Top", cornerKerning.coinCarneFrapper().kerningTop().name());
writer.docTableRow("Bottom", cornerKerning.coinCarneFrapper().kerningBottom().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"; String displayFormat = "0x%0" + minHex + "X";
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
for (int i = 0; i < sequence.size(); i++) { 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.FourCornerX00PetitVide;
import org.x4o.fc18.cake2.FourCornerX18CakePointDotName; import org.x4o.fc18.cake2.FourCornerX18CakePointDotName;
import org.x4o.fc18.cake2.FourCornerX21CodePointSequence; 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.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterTree; import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc; import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.ApiDocConcept; import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.xml.sax.SAXException; 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_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 static final String[] C_FC_WORD = {"fc-word","Word","An FC18 word.","The word of an number."};
private ApiDocGenerator writer = null; private MaisDocGenerator writer = null;
private ApiDoc doc = null; private MaisDoc doc = null;
static public void main(String[] args) { static public void main(String[] args) {
Iterator<String> arguments = Arrays.asList(args).iterator(); Iterator<String> arguments = Arrays.asList(args).iterator();
@ -104,10 +104,10 @@ public class FCDocWriter {
public FCDocWriter(Integer stopCakePoint) { public FCDocWriter(Integer stopCakePoint) {
this.doc = buildApiDoc(new TDocCake(), stopCakePoint); this.doc = buildApiDoc(new TDocCake(), stopCakePoint);
this.writer = new ApiDocGenerator(); this.writer = new MaisDocGenerator();
} }
public ApiDoc getApiDoc() { public MaisDoc getApiDoc() {
return doc; return doc;
} }
@ -116,8 +116,8 @@ public class FCDocWriter {
writer.write(doc,basePath); writer.write(doc,basePath);
} }
private ApiDoc buildApiDoc(TDocCake docCake, Integer stopCakePoint) { private MaisDoc buildApiDoc(TDocCake docCake, Integer stopCakePoint) {
ApiDoc doc = new ApiDoc(); MaisDoc doc = new MaisDoc();
doc.setName("FourCorner"); doc.setName("FourCorner");
doc.setDescription("FourCorner 18 bit text encoding format."); doc.setDescription("FourCorner 18 bit text encoding format.");
doc.setDocAbout("FourCorner Indexes\nThe World Of Words™"); doc.setDocAbout("FourCorner Indexes\nThe World Of Words™");
@ -142,10 +142,10 @@ public class FCDocWriter {
doc.addAnnotatedClasses(FCDocSegmentWriterCakeWord.class); doc.addAnnotatedClasses(FCDocSegmentWriterCakeWord.class);
doc.addAnnotatedClasses(FCDocSegmentWriterCakeSlice.class); doc.addAnnotatedClasses(FCDocSegmentWriterCakeSlice.class);
ApiDocConcept adc1 = doc.addConcept(new ApiDocConcept(null,C_FC_ROOT,TDocCake.class)); MaisDocConcept adc1 = doc.addConcept(new MaisDocConcept(null,C_FC_ROOT,TDocCake.class));
ApiDocConcept adc2 = doc.addConcept(new ApiDocConcept(adc1,C_FC_TOWER,TDocCakeTower.class)); MaisDocConcept adc2 = doc.addConcept(new MaisDocConcept(adc1,C_FC_TOWER,TDocCakeTower.class));
ApiDocConcept adc3 = doc.addConcept(new ApiDocConcept(adc2,C_FC_SLICE,TDocCakeSlice.class)); MaisDocConcept adc3 = doc.addConcept(new MaisDocConcept(adc2,C_FC_SLICE,TDocCakeSlice.class));
/*ApiDocConcept adc4 = */doc.addConcept(new ApiDocConcept(adc3,C_FC_WORD,TDocCakeWord.class)); /*ApiDocConcept adc4 = */doc.addConcept(new MaisDocConcept(adc3,C_FC_WORD,TDocCakeWord.class));
//ApiDocConcept adc4 = doc.addConcept(new ApiDocConcept(adc3,C_TABLE,Table.class)); //ApiDocConcept adc4 = doc.addConcept(new ApiDocConcept(adc3,C_TABLE,Table.class));
//adc4.addChildConcepts(new ApiDocConcept(adc4, CC_RS, Relationship.class)); //adc4.addChildConcepts(new ApiDocConcept(adc4, CC_RS, Relationship.class));
@ -156,16 +156,16 @@ public class FCDocWriter {
//doc.addDocPage(DefaultPageWriterIndexAll.createDocPage()); //doc.addDocPage(DefaultPageWriterIndexAll.createDocPage());
doc.addDocPage(DefaultPageWriterHelp.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); doc.setRootNode(rootNode);
for (FourCornerDotCakeTower tower : FourCornerDotCakeTower.values()) { for (FourCornerDotCakeTower tower : FourCornerDotCakeTower.values()) {
ApiDocNode towerNode = rootNode.addNode(createNodeCakeTower(tower)); MaisDocNode towerNode = rootNode.addNode(createNodeCakeTower(tower));
for (FourCornerDotCake dotCake : FourCornerDotCake.valuesByTower(tower)) { for (FourCornerDotCake dotCake : FourCornerDotCake.valuesByTower(tower)) {
if (stopCakePoint != null && dotCake.getStart() > stopCakePoint) { if (stopCakePoint != null && dotCake.getStart() > stopCakePoint) {
break; break;
} }
ApiDocNode sliceNode = towerNode.addNode(createNodeCakeSlice(dotCake)); MaisDocNode sliceNode = towerNode.addNode(createNodeCakeSlice(dotCake));
for (int i = 0; i < dotCake.getLength(); i++) { for (int i = 0; i < dotCake.getLength(); i++) {
/*ApiDocNode wordNode =*/ sliceNode.addNode(createNodeCakeWord(dotCake, i)); /*ApiDocNode wordNode =*/ sliceNode.addNode(createNodeCakeWord(dotCake, i));
} }
@ -176,15 +176,15 @@ public class FCDocWriter {
return doc; return doc;
} }
private ApiDocNode createNodeCakeTower(FourCornerDotCakeTower tower) { private MaisDocNode createNodeCakeTower(FourCornerDotCakeTower tower) {
return new ApiDocNode(new TDocCakeTower(tower), tower.name(), tower.nameNice(), tower.description()); return new MaisDocNode(new TDocCakeTower(tower), tower.name(), tower.nameNice(), tower.description());
} }
private ApiDocNode createNodeCakeSlice(FourCornerDotCake slice) { private MaisDocNode createNodeCakeSlice(FourCornerDotCake slice) {
return new ApiDocNode(new TDocCakeSlice(slice), slice.name(), slice.nameSpec(), slice.description()); 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; int cakePoint = dotCake.getStart() + offset;
String idStr = String.format("0x%06X", cakePoint); String idStr = String.format("0x%06X", cakePoint);
String name = idStr; String name = idStr;
@ -203,6 +203,6 @@ public class FCDocWriter {
desc = buf.toString(); 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.Relationship;
import org.apache.metamodel.schema.Schema; import org.apache.metamodel.schema.Schema;
import org.apache.metamodel.schema.Table; 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.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll; import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll;
import org.x4o.maisdoc.flake.DefaultPageWriterTree; import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc; import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.ApiDocConcept; import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
public class DocModelWriter { public class DocModelWriter {
@ -57,18 +57,18 @@ public class DocModelWriter {
private static final String[] CC_RS = {"relationship","Relationship","The relationships.","The telationships data."}; private static final String[] CC_RS = {"relationship","Relationship","The relationships.","The telationships data."};
private ApiDocGenerator writer = null; private MaisDocGenerator writer = null;
private ApiDoc doc = null; private MaisDoc doc = null;
public DocModelWriter(DocModelDataStore dmds) { public DocModelWriter(DocModelDataStore dmds) {
if (dmds==null) { if (dmds==null) {
throw new NullPointerException("Can't write null "+DocModelDataStore.class.getSimpleName()); throw new NullPointerException("Can't write null "+DocModelDataStore.class.getSimpleName());
} }
doc = buildApiDoc(dmds); doc = buildApiDoc(dmds);
writer = new ApiDocGenerator(); writer = new MaisDocGenerator();
} }
public ApiDoc getApiDoc() { public MaisDoc getApiDoc() {
return doc; return doc;
} }
@ -77,8 +77,8 @@ public class DocModelWriter {
writer.write(doc,basePath); writer.write(doc,basePath);
} }
private ApiDoc buildApiDoc(DocModelDataStore dmds) { private MaisDoc buildApiDoc(DocModelDataStore dmds) {
ApiDoc doc = new ApiDoc(); MaisDoc doc = new MaisDoc();
doc.setName("MetaModel"); doc.setName("MetaModel");
doc.setDescription("MetaModel generic schema overview."); doc.setDescription("MetaModel generic schema overview.");
doc.setDocAbout("MetaModel of\nDataContexts"); doc.setDocAbout("MetaModel of\nDataContexts");
@ -106,26 +106,26 @@ public class DocModelWriter {
doc.addAnnotatedClasses(DocModelWriterSchema.class); doc.addAnnotatedClasses(DocModelWriterSchema.class);
doc.addAnnotatedClasses(DocModelWriterTable.class); doc.addAnnotatedClasses(DocModelWriterTable.class);
ApiDocConcept adc1 = doc.addConcept(new ApiDocConcept(null,C_DATA_STORE,DocModelDataStore.class)); MaisDocConcept adc1 = doc.addConcept(new MaisDocConcept(null,C_DATA_STORE,DocModelDataStore.class));
ApiDocConcept adc2 = doc.addConcept(new ApiDocConcept(adc1,C_DATA_CONTEXT,DataContext.class)); MaisDocConcept adc2 = doc.addConcept(new MaisDocConcept(adc1,C_DATA_CONTEXT,DataContext.class));
ApiDocConcept adc3 = doc.addConcept(new ApiDocConcept(adc2,C_SCHEMA,Schema.class)); MaisDocConcept adc3 = doc.addConcept(new MaisDocConcept(adc2,C_SCHEMA,Schema.class));
ApiDocConcept adc4 = doc.addConcept(new ApiDocConcept(adc3,C_TABLE,Table.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(DefaultPageWriterTree.createDocPage());
doc.addDocPage(DefaultPageWriterIndexAll.createDocPage()); doc.addDocPage(DefaultPageWriterIndexAll.createDocPage());
doc.addDocPage(DefaultPageWriterHelp.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); doc.setRootNode(rootNode);
for (Entry<String,DataContext> entry:dmds.entrySet()) { 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()) {; for (Schema schema:entry.getValue().getSchemas()) {;
if (isInvalidDocSchema(schema)) { if (isInvalidDocSchema(schema)) {
continue; continue;
} }
ApiDocNode schemaNode = dcNode.addNode(createNodeSchema(schema)); MaisDocNode schemaNode = dcNode.addNode(createNodeSchema(schema));
for (Table table:schema.getTables()) { for (Table table:schema.getTables()) {
schemaNode.addNode(createNodeTable(table)); schemaNode.addNode(createNodeTable(table));
} }
@ -150,18 +150,18 @@ public class DocModelWriter {
return false; return false;
} }
private ApiDocNode createNodeDataContext(Entry<String,DataContext> entry) { private MaisDocNode createNodeDataContext(Entry<String,DataContext> entry) {
return new ApiDocNode(entry.getValue(),entry.getKey(),entry.getKey(),entry.getKey()); return new MaisDocNode(entry.getValue(),entry.getKey(),entry.getKey(),entry.getKey());
} }
private ApiDocNode createNodeSchema(Schema schema) { private MaisDocNode createNodeSchema(Schema schema) {
return new ApiDocNode(schema,schema.getName(),schema.getQualifiedLabel(),schema.getName()); return new MaisDocNode(schema,schema.getName(),schema.getQualifiedLabel(),schema.getName());
} }
private ApiDocNode createNodeTable(Table table) { private MaisDocNode createNodeTable(Table table) {
return new ApiDocNode(table,table.getName(),table.getQualifiedLabel(),table.getRemarks()); return new MaisDocNode(table,table.getName(),table.getQualifiedLabel(),table.getRemarks());
} }
private ApiDocNode createNodeRelationship(Relationship rs) { private MaisDocNode createNodeRelationship(Relationship rs) {
String name = rsName(rs); String name = rsName(rs);
return new ApiDocNode(rs,name,name,name); return new MaisDocNode(rs,name,name,name);
} }
private String rsName(Relationship rs) { 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.Schema;
import org.apache.metamodel.schema.Table; import org.apache.metamodel.schema.Table;
import org.apache.metamodel.schema.TableType; import org.apache.metamodel.schema.TableType;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod; import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody; import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
public class DocModelWriterSchema { public class DocModelWriterSchema {
@ -57,16 +57,16 @@ public class DocModelWriterSchema {
return result; return result;
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Schema.class}) @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Schema.class})
public void writeSchemaTableSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException { public void writeSchemaTableSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Schema schema = (Schema)event.getEventObject().getUserData(); Schema schema = (Schema)event.getEventObject().getUserData();
DataContext dc = (DataContext)event.getEventObject().getParent().getUserData(); DataContext dc = (DataContext)event.getEventObject().getParent().getUserData();
List<Table> tables = filterTables(schema,TableType.VIEW,false); List<Table> tables = filterTables(schema,TableType.VIEW,false);
if (tables.isEmpty()) { if (tables.isEmpty()) {
return; 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"); writer.docTableHeader("Name", "Description");
for (Table table:tables) { for (Table table:tables) {
Number tableCount = 0l; Number tableCount = 0l;
@ -76,27 +76,27 @@ public class DocModelWriterSchema {
tableCount = (Number)ds.getRow().getValue(0); tableCount = (Number)ds.getRow().getValue(0);
ds.close(); 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.docTableRowLink(link,table.getName(),"Record Count: "+tableCount);
} }
writer.docTableEnd(); writer.docTableEnd();
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Schema.class}) @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Schema.class})
public void writeSchemaViewSummary(ApiDocWriteEvent<ApiDocNode> event) throws SAXException, IOException { public void writeSchemaViewSummary(MaisDocWriteEvent<MaisDocNode> event) throws SAXException, IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Schema schema = (Schema)event.getEventObject().getUserData(); Schema schema = (Schema)event.getEventObject().getUserData();
List<Table> tables = filterTables(schema,TableType.VIEW,true); List<Table> tables = filterTables(schema,TableType.VIEW,true);
if (tables.isEmpty()) { if (tables.isEmpty()) {
return; 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"); writer.docTableHeader("Name", "Description");
for (Table table:schema.getTables()) { for (Table table:schema.getTables()) {
if (!TableType.VIEW.equals(table.getType())) { if (!TableType.VIEW.equals(table.getType())) {
continue; 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.docTableRowLink(link,table.getName(),table.getQualifiedLabel());
} }
writer.docTableEnd(); 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.Relationship;
import org.apache.metamodel.schema.Table; import org.apache.metamodel.schema.Table;
import org.apache.metamodel.schema.TableType; import org.apache.metamodel.schema.TableType;
import org.x4o.maisdoc.flake.ApiDocContentCss; import org.x4o.maisdoc.flake.MaisDocContentCss;
import org.x4o.maisdoc.flake.ApiDocContentWriter; import org.x4o.maisdoc.flake.MaisDocContentWriter;
import org.x4o.maisdoc.flake.ApiDocNodeWriterMethod; import org.x4o.maisdoc.flake.MaisDocNodeWriterMethod;
import org.x4o.maisdoc.model.ApiDocIndexItem; import org.x4o.maisdoc.model.MaisDocIndexItem;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.ApiDocNodeBody; import org.x4o.maisdoc.model.MaisDocNodeBody;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag; import org.x4o.sax3.SAX3WriterHtml.Tag;
public class DocModelWriterTable { public class DocModelWriterTable {
@ -62,7 +62,7 @@ public class DocModelWriterTable {
dbTableFactory = new DBTableFactory(); dbTableFactory = new DBTableFactory();
} }
private DBTable getDBTable(ApiDocWriteEvent<ApiDocNode> event) { private DBTable getDBTable(MaisDocWriteEvent<MaisDocNode> event) {
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
if (currentDBTable!=null && currentDBTable.getTable().getQualifiedLabel().equals(table.getQualifiedLabel())) if (currentDBTable!=null && currentDBTable.getTable().getQualifiedLabel().equals(table.getQualifiedLabel()))
{ {
@ -99,9 +99,9 @@ public class DocModelWriterTable {
return result; return result;
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DESCRIPTION_LINKS,targetClasses={Table.class}) @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DESCRIPTION_LINKS,targetClasses={Table.class})
public void writeTableDescription(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTableDescription(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
if (!TableType.VIEW.equals(table.getType())) { if (!TableType.VIEW.equals(table.getType())) {
@ -115,7 +115,7 @@ public class DocModelWriterTable {
} }
while (rsIn.hasNext()) { while (rsIn.hasNext()) {
Relationship rs = rsIn.next(); 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()); writer.printHref(uri, rs.getForeignTable().getName());
if (rsIn.hasNext()) { if (rsIn.hasNext()) {
writer.printCharacters(",&nbsp;"); writer.printCharacters(",&nbsp;");
@ -132,7 +132,7 @@ public class DocModelWriterTable {
} }
while (rsOut.hasNext()) { while (rsOut.hasNext()) {
Relationship rs = rsOut.next(); 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()); writer.printHref(uri, rs.getPrimaryTable().getName());
if (rsOut.hasNext()) { if (rsOut.hasNext()) {
writer.printCharacters(",&nbsp;"); writer.printCharacters(",&nbsp;");
@ -143,9 +143,9 @@ public class DocModelWriterTable {
} }
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DESCRIPTION_NODE,targetClasses={Table.class}) @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DESCRIPTION_NODE,targetClasses={Table.class})
public void writeTableSqlView(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTableSqlView(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
// fixme or only normal // fixme or only normal
@ -166,9 +166,9 @@ public class DocModelWriterTable {
} }
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={3},contentGroup="Columns",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={3},contentGroup="Columns",contentGroupType="summary")
public void writeTableSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTableSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
if (TableType.VIEW.equals(table.getType())) { if (TableType.VIEW.equals(table.getType())) {
writer.docTableStart("Column Summary", "All column of the view.",null); writer.docTableStart("Column Summary", "All column of the view.",null);
@ -177,14 +177,14 @@ public class DocModelWriterTable {
} }
writer.docTableHeader("Name", "Description"); writer.docTableHeader("Name", "Description");
for (Column column:table.getColumns()) { 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(); writer.docTableEnd();
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Primary Key",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Primary Key",contentGroupType="summary")
public void writeTablePKSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTablePKSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event); DBTable tableDB = getDBTable(event);
if (tableDB==null) { if (tableDB==null) {
@ -193,7 +193,7 @@ public class DocModelWriterTable {
List<Column> cols = table.getPrimaryKeys(); List<Column> cols = table.getPrimaryKeys();
for (int i=0;i<cols.size();i++) { for (int i=0;i<cols.size();i++) {
Column column = cols.get(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) { if (i<cols.size()-1) {
writer.printCharacters(", "); writer.printCharacters(", ");
} }
@ -215,7 +215,7 @@ public class DocModelWriterTable {
for (int i=0;i<cols.size();i++) { for (int i=0;i<cols.size();i++) {
String column = cols.get(i); String column = cols.get(i);
writer.printHref("#"+ApiDocContentWriter.toSafeUri(column), column); writer.printHref("#"+MaisDocContentWriter.toSafeUri(column), column);
if (i<cols.size()-1) { if (i<cols.size()-1) {
writer.printCharacters(", "); writer.printCharacters(", ");
} }
@ -228,9 +228,9 @@ public class DocModelWriterTable {
} }
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Indexes",contentGroupType="summary") @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.SUMMARY,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Indexes",contentGroupType="summary")
public void writeTableIDXSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTableIDXSummary(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event); DBTable tableDB = getDBTable(event);
if (tableDB==null) { if (tableDB==null) {
@ -242,7 +242,7 @@ public class DocModelWriterTable {
writer.printTagCharacters(Tag.h3, "Indexed Columns"); writer.printTagCharacters(Tag.h3, "Indexed Columns");
writer.printTagStart(Tag.code); writer.printTagStart(Tag.code);
for (Column column:columns) { for (Column column:columns) {
writer.printHref("#"+ApiDocContentWriter.toSafeUri(column.getName()), column.getName()); writer.printHref("#"+MaisDocContentWriter.toSafeUri(column.getName()), column.getName());
} }
writer.printTagEnd(Tag.code); writer.printTagEnd(Tag.code);
} else { } else {
@ -260,7 +260,7 @@ public class DocModelWriterTable {
buf.append(","); buf.append(",");
} }
} }
writer.docTableRowLink("#"+ApiDocContentWriter.toSafeUri(index.getName()),index.getName(),buf.toString()); writer.docTableRowLink("#"+MaisDocContentWriter.toSafeUri(index.getName()),index.getName(),buf.toString());
} }
writer.docTableEnd(); writer.docTableEnd();
@ -270,17 +270,17 @@ public class DocModelWriterTable {
} }
} }
private void writeSqlBlock(ApiDocContentWriter writer,String sql) throws IOException { private void writeSqlBlock(MaisDocContentWriter writer,String sql) throws IOException {
writer.printTagStart(Tag.div,ApiDocContentCss.block); writer.printTagStart(Tag.div,MaisDocContentCss.block);
writer.printTagStart(Tag.pre); writer.printTagStart(Tag.pre);
writer.printCharacters(sql); writer.printCharacters(sql);
writer.printTagEnd(Tag.pre); writer.printTagEnd(Tag.pre);
writer.printTagEnd(Tag.div); writer.printTagEnd(Tag.div);
} }
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Indexes",contentGroupType="overview") @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={1},contentGroup="Indexes",contentGroupType="overview")
public void writeTableDetailIndex(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTableDetailIndex(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
//Table table = (Table)event.getEventObject().getUserData(); //Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event); DBTable tableDB = getDBTable(event);
if (tableDB==null) { if (tableDB==null) {
@ -310,7 +310,7 @@ public class DocModelWriterTable {
writer.printTagEnd(Tag.pre); writer.printTagEnd(Tag.pre);
writer.printTagStart(Tag.div,ApiDocContentCss.block); writer.printTagStart(Tag.div,MaisDocContentCss.block);
writer.printCharacters("Type: "); writer.printCharacters("Type: ");
writer.printCharacters(index.getType().name()); writer.printCharacters(index.getType().name());
writer.printTagEnd(Tag.div); writer.printTagEnd(Tag.div);
@ -321,14 +321,14 @@ public class DocModelWriterTable {
writer.printTagStart(Tag.dl); writer.printTagStart(Tag.dl);
writer.printTagStart(Tag.dt); writer.printTagStart(Tag.dt);
writer.printTagStart(Tag.span,ApiDocContentCss.strong); writer.printTagStart(Tag.span,MaisDocContentCss.strong);
writer.printCharacters("Columns:"); writer.printCharacters("Columns:");
writer.printTagEnd(Tag.span); writer.printTagEnd(Tag.span);
writer.printTagEnd(Tag.dt); writer.printTagEnd(Tag.dt);
for (DBIndexColumn column:index.getIndexColumns()) { for (DBIndexColumn column:index.getIndexColumns()) {
writer.printTagStart(Tag.dd); writer.printTagStart(Tag.dd);
writer.printTagStart(Tag.code); 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.printTagEnd(Tag.code);
writer.printCharacters(" ORDER "); writer.printCharacters(" ORDER ");
if (column.getAscending()!=null && column.getAscending()) { 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") @MaisDocNodeWriterMethod(nodeBody=MaisDocNodeBody.DETAIL,targetClasses={Table.class},nodeBodyOrders={2},contentGroup="Columns",contentGroupType="overview")
public void writeTableDetail(ApiDocWriteEvent<ApiDocNode> event) throws IOException { public void writeTableDetail(MaisDocWriteEvent<MaisDocNode> event) throws IOException {
ApiDocContentWriter writer = event.getWriter(); MaisDocContentWriter writer = event.getWriter();
Table table = (Table)event.getEventObject().getUserData(); Table table = (Table)event.getEventObject().getUserData();
DBTable tableDB = getDBTable(event); DBTable tableDB = getDBTable(event);
for (Column column:table.getColumns()) { for (Column column:table.getColumns()) {
ApiDocIndexItem indexItem = new ApiDocIndexItem(); MaisDocIndexItem indexItem = new MaisDocIndexItem();
indexItem.setLinkText(column.getName()); indexItem.setLinkText(column.getName());
event.getDoc().getNodeData().addIndexItem(indexItem); event.getDoc().getNodeData().addIndexItem(indexItem);
@ -381,7 +381,7 @@ public class DocModelWriterTable {
writer.printTagEnd(Tag.pre); writer.printTagEnd(Tag.pre);
writer.printTagStart(Tag.div,ApiDocContentCss.block); writer.printTagStart(Tag.div,MaisDocContentCss.block);
writer.printCharacters("Description: "); writer.printCharacters("Description: ");
writer.printCharacters(column.getQuotedName()); writer.printCharacters(column.getQuotedName());
writer.printTagEnd(Tag.div); writer.printTagEnd(Tag.div);
@ -393,7 +393,7 @@ public class DocModelWriterTable {
idx = tableDB.getIndexesByColumn(column.getName()); idx = tableDB.getIndexesByColumn(column.getName());
} }
writer.printTagStart(Tag.dt); writer.printTagStart(Tag.dt);
writer.printTagStart(Tag.span,ApiDocContentCss.strong); writer.printTagStart(Tag.span,MaisDocContentCss.strong);
writer.printCharacters("Indexes:"); writer.printCharacters("Indexes:");
writer.printTagEnd(Tag.span); writer.printTagEnd(Tag.span);
writer.printTagEnd(Tag.dt); writer.printTagEnd(Tag.dt);
@ -403,7 +403,7 @@ public class DocModelWriterTable {
writer.printTagStart(Tag.code); writer.printTagStart(Tag.code);
for (int i=0;i<idx.size();i++) { for (int i=0;i<idx.size();i++) {
DBIndex index = idx.get(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) { if (i<idx.size()-1) {
writer.printCharacters(","); writer.printCharacters(",");
} }
@ -421,7 +421,7 @@ public class DocModelWriterTable {
} }
writer.printTagStart(Tag.dt); writer.printTagStart(Tag.dt);
writer.printTagStart(Tag.span,ApiDocContentCss.strong); writer.printTagStart(Tag.span,MaisDocContentCss.strong);
writer.printCharacters("References:"); writer.printCharacters("References:");
writer.printTagEnd(Tag.span); writer.printTagEnd(Tag.span);
writer.printTagEnd(Tag.dt); writer.printTagEnd(Tag.dt);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -29,9 +29,9 @@ package org.x4o.maisdoc;
import java.util.List; import java.util.List;
public class ApiDocProject { public class MaisDocProject {
private Class<?> frameNavConceptClass = null; 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.ArrayList;
import java.util.List; 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; return wasps;
} }
} }

View file

@ -27,13 +27,13 @@
package org.x4o.maisdoc; package org.x4o.maisdoc;
import org.x4o.maisdoc.model.ApiDoc; import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.ApiDocNode; 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 // 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.addTreeNodePageModeClass
// use: doc.addAnnotatedClasses // use: doc.addAnnotatedClasses
// use: doc.addConcept // use: doc.addConcept

View file

@ -29,14 +29,14 @@ import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Map; 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.DefaultPageWriterHelp;
import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll; import org.x4o.maisdoc.flake.DefaultPageWriterIndexAll;
import org.x4o.maisdoc.flake.DefaultPageWriterTree; import org.x4o.maisdoc.flake.DefaultPageWriterTree;
import org.x4o.maisdoc.model.ApiDoc; import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.ApiDocConcept; import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.ApiDocNode; import org.x4o.maisdoc.model.MaisDocNode;
import org.x4o.maisdoc.model.ApiDocRemoteClass; import org.x4o.maisdoc.model.MaisDocRemoteClass;
import org.x4o.sax3.SAX3WriterXml; import org.x4o.sax3.SAX3WriterXml;
import org.x4o.sax3.io.SAX3PropertyConfig; import org.x4o.sax3.io.SAX3PropertyConfig;
import org.x4o.sax3.io.SAX3PropertyConfig.PropertyConfigItem; import org.x4o.sax3.io.SAX3PropertyConfig.PropertyConfigItem;
@ -49,7 +49,7 @@ import org.xml.sax.SAXException;
* @version 1.0 Aug 26, 2010 * @version 1.0 Aug 26, 2010
*/ */
@Deprecated // marked until make working to write multiple project or mix api docs in one big tree @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. // 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. */ /** The config of this writer. */
private final SAX3PropertyConfig propertyConfig; private final SAX3PropertyConfig propertyConfig;
public ApiDocWriter(SAX3PropertyConfig parentConfig) { public MaisDocWriter(SAX3PropertyConfig parentConfig) {
this.propertyConfig=new SAX3PropertyConfig(DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX); this.propertyConfig=new SAX3PropertyConfig(DEFAULT_PROPERTY_CONFIG,PROPERTY_CONTEXT_PREFIX);
this.propertyConfig.copyParentProperties(parentConfig); this.propertyConfig.copyParentProperties(parentConfig);
} }
@ -108,8 +108,8 @@ public class ApiDocWriter {
*/ */
public void writeDocumentation() throws IOException { public void writeDocumentation() throws IOException {
File basePath = propertyConfig.getPropertyFile(OUTPUT_PATH); File basePath = propertyConfig.getPropertyFile(OUTPUT_PATH);
ApiDocGenerator writer = new ApiDocGenerator(); MaisDocGenerator writer = new MaisDocGenerator();
ApiDoc doc = buildLanguageDoc(); MaisDoc doc = buildLanguageDoc();
writer.write(doc, basePath); writer.write(doc, basePath);
} }
@ -117,10 +117,10 @@ public class ApiDocWriter {
* Creates a fully configured ApiDoc object. * Creates a fully configured ApiDoc object.
* @return The ApiDoc configured to write eld documentation. * @return The ApiDoc configured to write eld documentation.
*/ */
private ApiDoc buildLanguageDoc() { private MaisDoc buildLanguageDoc() {
// Generic config // Generic config
ApiDoc doc = new ApiDoc(); MaisDoc doc = new MaisDoc();
doc.setName( propertyConfig.getPropertyString(DOC_NAME)); doc.setName( propertyConfig.getPropertyString(DOC_NAME));
doc.setDescription( propertyConfig.getPropertyString(DOC_DESCRIPTION)); doc.setDescription( propertyConfig.getPropertyString(DOC_DESCRIPTION));
doc.setDocAbout( propertyConfig.getPropertyString(DOC_ABOUT, () -> createDefaultAbout(doc.getName()))); 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); Map<String,String> javadocLinkOfflineMap = propertyConfig.getPropertyMap(JAVADOC_LINK_OFFLINE);
if (javadocLinkList!=null) { if (javadocLinkList!=null) {
for (String javadocUrl:javadocLinkList) { for (String javadocUrl:javadocLinkList) {
doc.addRemoteClass(new ApiDocRemoteClass(javadocUrl)); doc.addRemoteClass(new MaisDocRemoteClass(javadocUrl));
} }
} }
if (javadocLinkOfflineMap!=null) { if (javadocLinkOfflineMap!=null) {
for (Map.Entry<String,String> offlineLink:javadocLinkOfflineMap.entrySet()) { 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 java.io.IOException;
import org.x4o.maisdoc.model.ApiDoc; import org.x4o.maisdoc.model.MaisDoc;
import org.x4o.maisdoc.model.ApiDocConcept; import org.x4o.maisdoc.model.MaisDocConcept;
import org.x4o.maisdoc.model.ApiDocPage; import org.x4o.maisdoc.model.MaisDocPage;
import org.x4o.maisdoc.model.ApiDocPageWriter; import org.x4o.maisdoc.model.MaisDocPageWriter;
import org.x4o.maisdoc.model.ApiDocWriteEvent; import org.x4o.maisdoc.model.MaisDocWriteEvent;
import org.x4o.sax3.SAX3WriterHtml.Tag; import org.x4o.sax3.SAX3WriterHtml.Tag;
/** /**
@ -37,16 +37,16 @@ import org.x4o.sax3.SAX3WriterHtml.Tag;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 May 22, 2013 * @version 1.0 May 22, 2013
*/ */
public class DefaultPageWriterHelp implements ApiDocPageWriter { public class DefaultPageWriterHelp implements MaisDocPageWriter {
public static ApiDocPage createDocPage() { public static MaisDocPage createDocPage() {
return new ApiDocPage("doc-help","Help","This help file applies to the API documentation generated using the standard format.",new DefaultPageWriterHelp()); 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 { public void writePageContent(MaisDocWriteEvent<MaisDocPage> e) throws IOException {
ApiDoc doc = e.getDoc(); MaisDoc doc = e.getDoc();
//ApiDocPage page = e.getEvent(); //ApiDocPage page = e.getEvent();
ApiDocContentWriter writer = e.getWriter(); MaisDocContentWriter writer = e.getWriter();
writer.printTagStart(Tag.div,"header"); writer.printTagStart(Tag.div,"header");
writer.printTagCharacters(Tag.h1, "How This API Document Is Organized", "title"); writer.printTagCharacters(Tag.h1, "How This API Document Is Organized", "title");
@ -57,14 +57,14 @@ public class DefaultPageWriterHelp implements ApiDocPageWriter {
writer.docPageContentStart(); writer.docPageContentStart();
writer.docPageBlockStart(); writer.docPageBlockStart();
for (ApiDocConcept concept:doc.getConcepts()) { for (MaisDocConcept concept:doc.getConcepts()) {
writer.printTagCharacters(Tag.h2, concept.getName()); writer.printTagCharacters(Tag.h2, concept.getName());
writer.printTagStart(Tag.p); writer.printTagStart(Tag.p);
writer.printCharacters(concept.getDescriptionHelp()); writer.printCharacters(concept.getDescriptionHelp());
writer.printTagEnd(Tag.p); writer.printTagEnd(Tag.p);
writer.docPageBlockNext(); writer.docPageBlockNext();
} }
for (ApiDocPage docPage:doc.getDocPages()) { for (MaisDocPage docPage:doc.getDocPages()) {
writer.printTagCharacters(Tag.h2, docPage.getName()); writer.printTagCharacters(Tag.h2, docPage.getName());
writer.printTagStart(Tag.p); writer.printTagStart(Tag.p);
writer.printCharacters(docPage.getDescription()); writer.printCharacters(docPage.getDescription());

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -30,9 +30,9 @@ import java.util.List;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Aug 11, 2013 * @version 1.0 Aug 11, 2013
*/ */
public interface ApiDocNodeDataConfigurator { public interface MaisDocNodeDataConfigurator {
List<Class<?>> getTargetClasses(); 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 * @author Willem Cazander
* @version 1.0 May 12, 2013 * @version 1.0 May 12, 2013
*/ */
public interface ApiDocNodeWriter { public interface MaisDocNodeWriter {
ApiDocNodeBody getNodeBody(); MaisDocNodeBody getNodeBody();
List<Class<?>> getTargetClasses(); List<Class<?>> getTargetClasses();
List<Integer> getNodeBodyOrders(); List<Integer> getNodeBodyOrders();
String getContentGroup(); String getContentGroup();
String getContentGroupType(); 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 * @author Willem Cazander
* @version 1.0 May 12, 2013 * @version 1.0 May 12, 2013
*/ */
public class ApiDocPage { public class MaisDocPage {
private String id = null; private String id = null;
private String name = null; private String name = null;
private String description = null; private String description = null;
private List<ApiDocPageWriter> pageWriters = null; private List<MaisDocPageWriter> pageWriters = null;
public ApiDocPage() { public MaisDocPage() {
pageWriters = new ArrayList<ApiDocPageWriter>(30); 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(); this();
setId(id); setId(id);
setName(name); setName(name);
setDescription(description); setDescription(description);
for (ApiDocPageWriter writer:writers) { for (MaisDocPageWriter writer:writers) {
addPageWriter(writer); addPageWriter(writer);
} }
} }
@ -97,21 +97,21 @@ public class ApiDocPage {
/** /**
* @return the page writers. * @return the page writers.
*/ */
public List<ApiDocPageWriter> getPageWriters() { public List<MaisDocPageWriter> getPageWriters() {
return pageWriters; return pageWriters;
} }
/** /**
* @param writer the writer to add. * @param writer the writer to add.
*/ */
public void addPageWriter(ApiDocPageWriter writer) { public void addPageWriter(MaisDocPageWriter writer) {
pageWriters.add(writer); pageWriters.add(writer);
} }
/** /**
* @param writer the writer to add. * @param writer the writer to add.
*/ */
public void removePageWriter(ApiDocPageWriter writer) { public void removePageWriter(MaisDocPageWriter writer) {
pageWriters.remove(writer); pageWriters.remove(writer);
} }
} }

View file

@ -30,7 +30,7 @@ import java.io.IOException;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 May 12, 2013 * @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 * @author Willem Cazander
* @version 1.0 Aug 15, 2013 * @version 1.0 Aug 15, 2013
*/ */
public class ApiDocRemoteClass { public class MaisDocRemoteClass {
public final static String REMOTE_FILE = "package-list"; 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 docUrl = null;
private String packageListUrl = null; private String packageListUrl = null;
private List<String> packageList = null; private List<String> packageList = null;
@ -50,7 +50,7 @@ public class ApiDocRemoteClass {
/** /**
* Creates the ApiDocRemoteClass. * Creates the ApiDocRemoteClass.
*/ */
private ApiDocRemoteClass() { private MaisDocRemoteClass() {
packageList = new ArrayList<String>(100); 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. * Creates the ApiDocRemoteClass with a javadoc url to fetch the package-list from.
* @param docUrl The remote javadoc base url. * @param docUrl The remote javadoc base url.
*/ */
public ApiDocRemoteClass(String docUrl) { public MaisDocRemoteClass(String docUrl) {
this(); this();
setDocUrl(docUrl); setDocUrl(docUrl);
} }
@ -68,7 +68,7 @@ public class ApiDocRemoteClass {
* @param docUrl The remote javadoc base url. * @param docUrl The remote javadoc base url.
* @param packageListUrl The remote/local package-list url. * @param packageListUrl The remote/local package-list url.
*/ */
public ApiDocRemoteClass(String docUrl,String packageListUrl) { public MaisDocRemoteClass(String docUrl,String packageListUrl) {
this(docUrl); this(docUrl);
setPackageListUrl(packageListUrl); setPackageListUrl(packageListUrl);
} }

View file

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