we override the onGenericTag method.

@param writer
PdfWriter
@param document
Document
@param rect
Rectangle
@param text
String
176137
@Override
	public void onGenericTag(final PdfWriter writer, final Document document, final Rectangle rect,
			final String text) {
		// rien ici
	}
465396
@Override
    public void writeText(PDDocument doc, Writer outputStream) throws IOException
    {
        try
        {
            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
            DOMImplementationLS impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
            LSSerializer writer = impl.createLSSerializer();
            LSOutput output = impl.createLSOutput();
            writer.getDomConfig().setParameter("format-pretty-print", true);
            output.setCharacterStream(outputStream);
            createDOM(doc);
            writer.write(getDocument(), output);
        } catch (ClassCastException e) {
            throw new IOException("Error: cannot initialize the DOM serializer", e);
        } catch (ClassNotFoundException e) {
            throw new IOException("Error: cannot initialize the DOM serializer", e);
        } catch (InstantiationException e) {
            throw new IOException("Error: cannot initialize the DOM serializer", e);
        } catch (IllegalAccessException e) {
            throw new IOException("Error: cannot initialize the DOM serializer", e);
        }
    }
697242
public void write(BufferedWriter writer) throws Exception {
		Enumeration enm;

		// header
		writer.write("# generated " + new Date());
		writer.newLine();

		enm = elements();

		while (enm.hasMoreElements()) {
			writer.write(enm.nextElement().toString());
			writer.newLine();
		}

		writer.flush();
		writer.close();
	}
1284836
private GraphicsDocument createFeatureDocument(StringWriter writer) throws RenderException {
		if (TileMetadata.PARAM_SVG_RENDERER.equalsIgnoreCase(renderer)) {
			DefaultSvgDocument document = new DefaultSvgDocument(writer, false);
			document.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS);
			document.registerWriter(InternalFeatureImpl.class, new SvgFeatureWriter(getTransformer()));
			document.registerWriter(InternalTileImpl.class, new SvgTileWriter());
			return document;
		} else if (TileMetadata.PARAM_VML_RENDERER.equalsIgnoreCase(renderer)) {
			DefaultVmlDocument document = new DefaultVmlDocument(writer);
			int coordWidth = tile.getScreenWidth();
			int coordHeight = tile.getScreenHeight();
			document.registerWriter(InternalFeatureImpl.class, new VmlFeatureWriter(getTransformer(), coordWidth,
					coordHeight));
			document.registerWriter(InternalTileImpl.class, new VmlTileWriter(coordWidth, coordHeight));
			document.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS);
			return document;
		} else {
			throw new RenderException(ExceptionCode.RENDERER_TYPE_NOT_SUPPORTED, renderer);
		}
	}
965610
@Override
    public void xmlWriteOn(FormattedWriter writer) throws IOException
    {
        super.xmlWriteOn(writer);
        writer.newLine();
        writer.taggedValue("toBeDeleted", _toBeDeleted);
        writer.newLine();
        writer.taggedValue("toBeIgnored", _toBeIgnored);
    }
1133320
public void xmlWriteOn(FormattedWriter writer) throws IOException {
        writer.newLine();
        writer.startTag(XML_ITEM_MAP);
        writer.indent();
        for (int i = 0; i < _entry.length; i++) {
            Entry entry =  _entry[i];
            while (null != entry) {
                AbstractItemLink ail = entry.link;
                writer.newLine();
                ail.xmlShortWriteOn(writer);
                entry = entry.next;
            }
        }
        writer.outdent();
        writer.newLine();
        writer.endTag(XML_ITEM_MAP);
    }
700608
public static void debugAnnotation(Rectangle rectangle, String styleClass, PdfWriter writer) {
      if (styleClass == null) {
         log.warning("not showing link to styleClass because there is no styleClass");
         return;
      }
      // only now we can define a goto action, we know the position of the image
      PdfAction act = PdfAction.gotoLocalPage(styleClass, true);
      writer.getDirectContent().setAction(act, rectangle.getLeft(), rectangle.getBottom(), rectangle.getRight(), rectangle.getTop());
   }
1264327
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    if(durablePseudoDestID != null)
    {
      writer.newLine();
      writer.taggedValue("durablePseudoDestID", durablePseudoDestID);
    }
    if(durableSubName != null)
    {
      writer.newLine();
      writer.taggedValue("durableSubName", durableSubName);
    }
  }
998627
public void write(XMLStreamWriter writer, AttributeDefinition<?> def, Enum<?> name) throws XMLStreamException {
      write(writer, def, name.toString());
   }
303881
public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
        if (bytes != null)
            os.write(bytes);
    }
603157
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    super.xmlWriteOn(writer);
    
    writer.newLine();
    writer.taggedValue("subscriberID", _subState.getSubscriberID());

    writer.newLine();
    writer.startTag("topics");
    writer.indent();

    String[] topics = _subState.getTopics();

    if (topics != null)
    {
      for (int i = 0; i < topics.length; i++)
      {
        writer.newLine();
        writer.taggedValue("topic", topics[i]);
      }
    }

    writer.outdent();
    writer.newLine();
    writer.endTag("topics");
    writer.newLine();
    writer.taggedValue("toBeDeleted", toBeDeleted);
  }
27075
@Override
	public void onEndPage(final PdfWriter writer, final Document document) {
		final int pageN = writer.getPageNumber();
		final String text = pageN + " / ";
		final float len = bf.getWidthPoint(text, 8);
		cb.beginText();
		cb.setFontAndSize(bf, 8);
		final float width = document.getPageSize().getWidth();
		cb.setTextMatrix(width / 2, 30);
		cb.showText(text);
		cb.endText();
		cb.addTemplate(template, width / 2 + len, 30);
	}
192567
public static <T> void registerWriter(Class<?> cls, JsonWriterI<T> writer) {
		defaultWriter.registerWriter(writer, cls);
	}
159018
private void writeDocument( Document document, File file )
        throws TransformerException, FileNotFoundException
    {
        document.normalize();
        DOMSource source = new DOMSource( document );
        StreamResult result = new StreamResult( new FileOutputStream( file ) );
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.setOutputProperty( OutputKeys.INDENT, "yes" );
        transformer.transform( source, result );
    }
933796
public void writeTags(Writer writer, boolean useLemmas, boolean useNormNer, boolean useNerTags) throws IOException {
        for (int i=0; i<tokens.size(); i++) {
            AgigaToken tok = tokens.get(i);
            if (useNormNer && tok.getNormNer() != null) {
                require(prefs.readNormNer, 
                        "AgigaPrefs.readNormNer must be true if useNormNer=true for writeTags()");
                writer.write(tok.getNormNer());
            } else if (useLemmas) {
                require(prefs.readLemma, 
                        "AgigaPrefs.readLemma must be true if useLemmas=true for writeTags()");
                writer.write(tok.getLemma());
            } else {
                require(prefs.readWord, 
                        "AgigaPrefs.readWord must be true if useLemmas and useNormNer are false for writeTags()");
                writer.write(tok.getWord());                
            }
            writer.write("/");
            if (useNerTags) {
                require(prefs.readNer,
                        "AgigaPrefs.readNer must be true if useNerTags=true for writeTags()");
                if (prefs.strict) { 
                    writer.write(tok.getNerTag());
                } else {
                    if (tok.getNerTag() != null) {
                        writer.write(tok.getNerTag());
                    } else {
                        log.warning("Missing NER annotation written as '__MISSING_NER_ANNOTATION__'");
                        writer.write("__MISSING_NER_ANNOTATION__");
                    }
                }
            } else {
                require(prefs.readPos,
                        "AgigaPrefs.readPos must be true if useNerTags=false for writeTags()");
                writer.write(tok.getPosTag());
            }
            if (i < tokens.size()-1) {
                writer.write(" ");
            }
        }
        writer.write("\n");
    }
323720
public void write(Writer out)
         throws IOException
    {
        out.write('<'+tag+attributes()+'>');
        super.write(out);
        out.write("</"+tag+"\n>");
    }
26222
function (writer, filter) {
            var self = this, tmp, attrName, tagName = self.tagName;    // special treat for doctype
            // special treat for doctype
            if (tagName === '!doctype') {
                writer.append(this.toHtml() + '\n');
                return;
            }
            self.__filter = filter;
            self.isChildrenFiltered = 0;    // process its open tag
            // process its open tag
            if (filter) {
                // element filtered by its name directly
                if (!(tagName = filter.onTagName(tagName))) {
                    return;
                }
                self.tagName = tagName;
                tmp = filter.onTag(self);
                if (tmp === false) {
                    return;
                }    // replaced
                // replaced
                if (tmp) {
                    self = tmp;
                }    // replaced by other type of node
                // replaced by other type of node
                if (self.nodeType !== 1) {
                    self.writeHtml(writer, filter);
                    return;
                }    // preserve children but delete itself
                // preserve children but delete itself
                if (!self.tagName) {
                    self._writeChildrenHTML(writer);
                    return;
                }
            }
            writer.openTag(self);    // process its attributes
            // process its attributes
            var attributes = self.attributes;
            for (var i = 0; i < attributes.length; i++) {
                var attr = attributes[i];
                attrName = attr.name;
                if (filter) {
                    // filtered directly by name
                    if (!(attrName = filter.onAttributeName(attrName, self))) {
                        continue;
                    }
                    attr.name = attrName;    // filtered by value and node
                    // filtered by value and node
                    if (filter.onAttribute(attr, self) === false) {
                        continue;
                    }
                }
                writer.attribute(attr, self);
            }    // close its open tag
            // close its open tag
            writer.openTagClose(self);
            if (!self.isSelfClosed) {
                self._writeChildrenHTML(writer);    // process its close tag
                // process its close tag
                writer.closeTag(self);
            }
        }