Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.util
Class DOMElementWriter

    java.lang.Object
      |
      +--org.apache.tools.ant.util.DOMElementWriter

public class DOMElementWriter
extends java.lang.Object

Writes a DOM tree to a given Writer.

Utility class used by `XmlLogger` and org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter XMLJUnitResultFormatter}.

Author:
  The original author of XmlLogger, Stefan Bodewig, Stephane Bailliez

Field Summary
`protected java.lang.String[]` | `knownEntities` Don't try to be too smart but at least recognize the predefined entities.

Constructor Summary
`DOMElementWriter()`

Method Summary
`java.lang.String` | `encode(java.lang.String value)` Escape <, & and " as their entities.
`boolean` | `isReference(java.lang.String ent)` Is the given argument a character or entity reference?
`void` | `write(org.w3c.dom.Element element, java.io.Writer out, int indent, java.lang.String indentWith)` Writes a DOM tree to a stream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### knownEntities

    protected java.lang.String[] knownEntities

  Don't try to be too smart but at least recognize the predefined entities.

Constructor Detail

### DOMElementWriter

    public DOMElementWriter()

Method Detail

### write

    public void write(org.w3c.dom.Element element,
                      java.io.Writer out,
                      int indent,
                      java.lang.String indentWith)
               throws java.io.IOException

  Writes a DOM tree to a stream.
  Parameters:
    `element` - the Root DOM element of the tree
    `out` - where to send the output
    `indent` - number of
    `indentWith` - strings, that should be used to indent the corresponding tag.

### encode

    public java.lang.String encode(java.lang.String value)

  Escape <, & and " as their entities.

### isReference

    public boolean isReference(java.lang.String ent)

  Is the given argument a character or entity reference?

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.