Class GenericJaxbIO<T>

  • All Implemented Interfaces:
    JaxbIO<T>

    public final class GenericJaxbIO<T>
    extends Object
    implements JaxbIO<T>
    • Constructor Detail

      • GenericJaxbIO

        public GenericJaxbIO​(Class<T> rootClass)
      • GenericJaxbIO

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

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