Here you can find the source of newTransformerFactory()
Parameter | Description |
---|---|
Exception | an exception |
public static TransformerFactory newTransformerFactory() throws Exception
//package com.java2s; /******************************************************************************* * Copyright (c) 2008 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from ww w.ja v a 2s . c o m*/ * Actuate Corporation - initial API and implementation *******************************************************************************/ import java.security.AccessController; import java.security.PrivilegedExceptionAction; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; public class Main { /** * Instantiate a new TransformerFactory. * * @return * @throws Exception */ public static TransformerFactory newTransformerFactory() throws Exception { return AccessController.doPrivileged(new PrivilegedExceptionAction<TransformerFactory>() { public TransformerFactory run() throws Exception { try { return TransformerFactory.newInstance(); } catch (TransformerFactoryConfigurationError error) { throw error.getException(); } } }); } }