Package org.apache.sling.sitemap.spi.builder

## Class AbstractExtension

- java.lang.Object
- - org.apache.sling.sitemap.spi.builder.AbstractExtension

All Implemented Interfaces:
  `Extension`

Direct Known Subclasses:
  `AlternateLanguageExtensionProvider.ExtensionImpl`

    @ConsumerType
    public abstract class AbstractExtension
    extends Object
    implements Extension

The producer API of an `Extension`.

### Constructor Summary

Constructors
`AbstractExtension()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract void` `writeTo​(@NotNull XMLStreamWriter writer)` Implementations must write their content to the given `XMLStreamWriter`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AbstractExtension

    public AbstractExtension()

### Method Detail

#### writeTo

    public abstract void writeTo​(@NotNull
                                 @NotNull XMLStreamWriter writer)
                          throws XMLStreamException

Implementations must write their content to the given `XMLStreamWriter`.

The extension must not open/close its own surrounding tag. This is done by the caller in order to guarantee proper isolation between the core implementation and the extensions. Furthermore, when an extension fails and throws an `XMLStreamException` the extensions output will be discarded but the sitemap generation will not fail.

Parameters:
  `writer` -
Throws:
  `XMLStreamException`