From 5cbca31db155f5299361a00c48974b80d3b8332a Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 8 Aug 2026 20:44:13 +0200 Subject: [PATCH] Convert the SAX plugin page to Markdown using a code block Follows the suggestion that the method signatures in these pages are code snippets, so the inline formatting is not needed. The xdoc used nested markup inside a code span and
with   runs for indentation, which is why a straight conversion mangled it. As a fenced code block the same content converts cleanly and reads better: real monospace, real indentation, and the two parenthetical notes become comments on the methods they describe. The variable parts were marked up as my.model.package and ModelName; a code block cannot express that, so the sentence above now says where those come from. Also fixes the subsection heading, which read 'jackson-writer' on the SAX plugin page - copied from the Jackson page. The other nine plugin pages name their generators correctly. Part of codehaus-plexus/.github#58 --- .../src/site/markdown/index.md | 31 ++++++++++++++ .../src/site/xdoc/index.xml | 40 ------------------- 2 files changed, 31 insertions(+), 40 deletions(-) create mode 100644 modello-plugins/modello-plugin-sax/src/site/markdown/index.md delete mode 100644 modello-plugins/modello-plugin-sax/src/site/xdoc/index.xml diff --git a/modello-plugins/modello-plugin-sax/src/site/markdown/index.md b/modello-plugins/modello-plugin-sax/src/site/markdown/index.md new file mode 100644 index 000000000..6d9d8b4a8 --- /dev/null +++ b/modello-plugins/modello-plugin-sax/src/site/markdown/index.md @@ -0,0 +1,31 @@ +--- +title: Modello SAX Plugin +author: Simone Tripodi +--- + +# Modello SAX Plugin + +Modello SAX Plugin generates SAX writers based on +[SAX APIs](http://docs.oracle.com/javase/1.4.2/docs/api/org/xml/sax/package-summary.html), +plus reader delegates to be able to read multiple model versions. + +## sax-writer + +The `sax-writer` generator creates a `my.model.package.io.sax.ModelNameSAXWriter` class — where +`my.model.package` and `ModelName` come from your model — with the following public methods: + +```java +public void write( OutputStream output, RootClass root ) + throws SAXException, TransformerException + +public void write( Writer writer, RootClass root ) + throws SAXException, TransformerException, UnsupportedEncodingException + +// opens and closes the XML document +public void write( ContentHandler handler, RootClass root ) + throws SAXException + +// opens and closes the XML document depending on the startDocument flag +public void write( ContentHandler handler, RootClass root, boolean startDocument ) + throws SAXException +``` diff --git a/modello-plugins/modello-plugin-sax/src/site/xdoc/index.xml b/modello-plugins/modello-plugin-sax/src/site/xdoc/index.xml deleted file mode 100644 index 8d8731151..000000000 --- a/modello-plugins/modello-plugin-sax/src/site/xdoc/index.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Modello SAX Plugin - Simone Tripodi - - - - -
- -

Modello SAX Plugin generates SAX writers based on - SAX APIs, - plus reader delegates to be able to read multiple model versions.

- - -

sax-writer generator creates - my.model.package.io.sax.ModelNameSAXWriter class with following - public methods: -

- -
    -
  • public void write( OutputStream output, RootClass root )
    -     throws SAXException, TransformerException
  • -
  • public void write( Writer writer, RootClass root )
    -     throws SAXException, TransformerException, UnsupportedEncodingException
  • -
  • public void write( org.xml.sax.ContentHandler, RootClass root )
    -     throws SAXException
    (this method will take care to open/close the XML document)
  • -
  • public void write( org.xml.sax.ContentHandler, RootClass root, boolean startDocument )
    -     throws SAXException
    (this method will take care to open/close the XML document depending on the startDocument flag)
  • -
-
- -
- - - -