org.keycloak.saml.common.util

## Class TransformerUtil

- java.lang.Object
- - org.keycloak.saml.common.util.TransformerUtil

-     public class TransformerUtil
      extends Object

  Utility to deal with JAXP Transformer
  Since:
    Oct 22, 2010
  Author:
    Anil.Saldhana@redhat.com

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransformerUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Transformer` | `getStaxSourceToDomResultTransformer()` Get the Custom Stax Source to DOM result transformer that has been written to get over the JDK transformer bugs (JDK6) as well as the issue of Xalan installing its Transformer (which does not support stax).
    `static Transformer` | `getTransformer()` Get the Default Transformer
    `static TransformerFactory` | `getTransformerFactory()` Creates a `TransformerFactory`.
    `static void` | `transform(JAXBContext context, JAXBElement<?> jaxb, Result result)`
    `static void` | `transform(Transformer transformer, Source source, DOMResult result)` Use the transformer to transform
    `static void` | `transform(Transformer transformer, StAXSource stax, DOMResult result)` Use the transformer to transform

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

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

- - ### Constructor Detail

    - #### TransformerUtil

          public TransformerUtil()

  - ### Method Detail

    - #### getTransformer

          public static Transformer getTransformer()
                                            throws ConfigurationException

      Get the Default Transformer
      Returns:
      Throws:
        `ConfigurationException`

    - #### getTransformerFactory

          public static TransformerFactory getTransformerFactory()
                                                          throws TransformerFactoryConfigurationError

      Creates a `TransformerFactory`. The returned instance is cached and shared between different threads.

      Returns:
      Throws:
        `TransformerFactoryConfigurationError`

    - #### getStaxSourceToDomResultTransformer

          public static Transformer getStaxSourceToDomResultTransformer()
                                                                 throws ConfigurationException

      Get the Custom Stax Source to DOM result transformer that has been written to get over the JDK transformer bugs (JDK6) as well as the issue of Xalan installing its Transformer (which does not support stax).
      Returns:
      Throws:
        `ConfigurationException`

    - #### transform

          public static void transform(Transformer transformer,
                                       StAXSource stax,
                                       DOMResult result)
                                throws ParsingException

      Use the transformer to transform
      Parameters:
        `transformer` -
        `stax` -
        `result` -
      Throws:
        `ParsingException`

    - #### transform

          public static void transform(Transformer transformer,
                                       Source source,
                                       DOMResult result)
                                throws ParsingException

      Use the transformer to transform
      Parameters:
        `transformer` -
        `source` -
        `result` -
      Throws:
        `ParsingException`

    - #### transform

          public static void transform(JAXBContext context,
                                       JAXBElement<?> jaxb,
                                       Result result)
                                throws ParsingException

      Throws:
        `ParsingException`

Copyright © 2020 JBoss by Red Hat. All rights reserved.