Package org.optaplanner.core.impl.io.jaxb

## Class GenericJaxbIO<T>

- java.lang.Object
- - org.optaplanner.core.impl.io.jaxb.GenericJaxbIO<T>

- All Implemented Interfaces:
    `JaxbIO<T>`

      public final class GenericJaxbIO<T>
      extends Object
      implements JaxbIO<T>

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GenericJaxbIO​(Class<T> rootClass)` |
    `GenericJaxbIO​(Class<T> rootClass, int indentation)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Document` | `parseXml​(Reader reader)` |
    `T` | `read​(Reader reader)` |
    `T` | `readAndValidate​(Reader reader, String schemaResource)` |
    `T` | `readAndValidate​(Reader reader, Schema schema)` |
    `T` | `readAndValidate​(Document document, String schemaResource)` |
    `T` | `readAndValidate​(Document document, Schema schema)` |
    `T` | `readOverridingNamespace​(Reader reader, ElementNamespaceOverride... elementNamespaceOverrides)` | Reads the input XML using the `Reader` overriding elements namespaces.
    `T` | `readOverridingNamespace​(Document document, ElementNamespaceOverride... elementNamespaceOverrides)` | Reads the input XML `Document` overriding namespaces.
    `void` | `validate​(Document document, String schemaResource)` |
    `void` | `validate​(Document document, Schema schema)` |
    `void` | `write​(T root, Writer writer)` |
    `void` | `writeWithoutNamespaces​(T root, Writer writer)` |

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

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

- - ### Constructor Detail

    - #### GenericJaxbIO

          public GenericJaxbIO​(Class<T> rootClass)

    - #### GenericJaxbIO

          public GenericJaxbIO​(Class<T> rootClass,
                               int indentation)

  - ### Method Detail

    - #### read

          public T read​(Reader reader)

      Specified by:
        `read` in interface `JaxbIO<T>`

    - #### readAndValidate

          public T readAndValidate​(Reader reader,
                                   String schemaResource)

    - #### readAndValidate

          public T readAndValidate​(Document document,
                                   String schemaResource)

    - #### readAndValidate

          public T readAndValidate​(Reader reader,
                                   Schema schema)

    - #### readAndValidate

          public T readAndValidate​(Document document,
                                   Schema schema)

    - #### readOverridingNamespace

          public T readOverridingNamespace​(Reader reader,
                                           ElementNamespaceOverride... elementNamespaceOverrides)

      Reads the input XML using the `Reader` overriding elements namespaces. If an element already has a namespace and a `ElementNamespaceOverride` is defined for this element, its namespace is overridden. In case the element has no namespace, new namespace defined in the `ElementNamespaceOverride` is added.
      Parameters:
        `reader` - input XML `Reader`; never null
        `elementNamespaceOverrides` - never null
      Returns:
        deserialized object representation of the XML.

    - #### readOverridingNamespace

          public T readOverridingNamespace​(Document document,
                                           ElementNamespaceOverride... elementNamespaceOverrides)

      Reads the input XML `Document` overriding namespaces. If an element already has a namespace and a `ElementNamespaceOverride` is defined for this element, its namespace is overridden. In case the element has no namespace a new namespace defined in the `ElementNamespaceOverride` is added.
      Parameters:
        `document` - input XML `Document`; never null
        `elementNamespaceOverrides` - never null
      Returns:
        deserialized object representation of the XML.

    - #### parseXml

          public Document parseXml​(Reader reader)

    - #### validate

          public void validate​(Document document,
                               String schemaResource)

    - #### validate

          public void validate​(Document document,
                               Schema schema)

    - #### write

          public void write​(T root,
                            Writer writer)

      Specified by:
        `write` in interface `JaxbIO<T>`

    - #### writeWithoutNamespaces

          public void writeWithoutNamespaces​(T root,
                                             Writer writer)