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 Details

    • GenericJaxbIO

      public GenericJaxbIO(Class<T> rootClass)
    • GenericJaxbIO

      public GenericJaxbIO(Class<T> rootClass, int indentation)
  • Method Details

    • 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)