Package com.independentsoft.office.spreadsheet.extensions

# Class Extension

java.lang.Object
com.independentsoft.office.spreadsheet.extensions.Extension

public class Extension extends Object
Represents a future-feature data storage area (`ext` element) inside an `ExtensionList`: a `uri` that identifies the extension and its content. Known content elements parse into typed `IExtensionContent` classes; anything unrecognized is preserved through `RawExtensionContent`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Extension()`
  Instantiates a new extension.
  `Extension​(InternalXMLStreamReader reader, ExtensionContentFactory factory)`
  Instantiates a new extension.
  `Extension​(String uri, IExtensionContent content)`
  Instantiates a new extension.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Extension`
  `clone()`
  `IExtensionContent`
  `getContent()`
  Gets the first extension content, or null when the extension is empty.
  `List<IExtensionContent>`
  `getContents()`
  Gets the extension contents.
  `String`
  `getUri()`
  Gets the URI identifying the extension.
  `void`
  `setUri​(String uri)`
  Sets the URI identifying the extension.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### Extension

    public Extension()
    Instantiates a new extension.

  - ### Extension

    public Extension​(String uri, IExtensionContent content)
    Instantiates a new extension.
    Parameters:
      `uri` - the URI identifying the extension
      `content` - the extension content

  - ### Extension

    public Extension​(InternalXMLStreamReader reader, ExtensionContentFactory factory) throws XMLStreamException
    Instantiates a new extension.

    Enters positioned ON the `ext` start element and leaves positioned ON its end element, so the caller's loop advances past it.

    Parameters:
      `reader` - the reader
      `factory` - the content factory mapping child elements to typed models, or null to preserve every child as raw XML
    Throws:
      `XMLStreamException` - the XML stream exception

- ## Method Details

  - ### clone

    public Extension clone()
    Overrides:
      `clone` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getUri

    public String getUri()
    Gets the URI identifying the extension.
    Returns:
      the uri

  - ### setUri

    public void setUri​(String uri)
    Sets the URI identifying the extension.
    Parameters:
      `uri` - the new uri

  - ### getContents

    public List<IExtensionContent> getContents()
    Gets the extension contents. An extension typically holds exactly one child element.
    Returns:
      the contents

  - ### getContent

    public IExtensionContent getContent()
    Gets the first extension content, or null when the extension is empty.
    Returns:
      the content