Code example for TransformerFactory

Methods: newTransformer

0
    private final TransformerFactory transformerFactory;
    private final Transformer newTransformer;
 
    public DomSerializerJaxp() throws TransformerConfigurationException { 
        this.transformerFactory = TransformerFactory.newInstance();
        this.newTransformer = transformerFactory.newTransformer();
    } 
 
    @Override 
    public String serialize(final Element domElement) {
        final CharArrayWriter caw = new CharArrayWriter();
        try { 
            serializeTo(domElement, caw);
            return caw.toString();
        } catch (final Exception e) {
            return null; 
        } 
    } 
 
    @Override 
    public void serializeTo(final Element domElement, final OutputStream os) throws Exception {