private static XMLInputFactory getXMLInputFactory() { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(StaxParserUtil.class.getClassLoader()); } return XMLInputFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } }
private static XMLOutputFactory getXMLOutputFactory() { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(StaxUtil.class.getClassLoader()); } return XMLOutputFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } }
private static XMLOutputFactory getXMLOutputFactory() { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(StaxUtil.class.getClassLoader()); } return XMLOutputFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } }
private static XMLInputFactory getXMLInputFactory() { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(StaxParserUtil.class.getClassLoader()); } return XMLInputFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } }
/** * Get the JAXP {@link XMLInputFactory} * * @return */ protected XMLInputFactory getXMLInputFactory() { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = getTCCL(); try { if (tccl_jaxp) { setTCCL(getClass().getClassLoader()); } return XMLInputFactory.newInstance(); } finally { if (tccl_jaxp) { setTCCL(prevTCCL); } } }
/** * Get the JAXP {@link XMLInputFactory} * * @return */ protected XMLInputFactory getXMLInputFactory() { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = getTCCL(); try { if (tccl_jaxp) { setTCCL(getClass().getClassLoader()); } return XMLInputFactory.newInstance(); } finally { if (tccl_jaxp) { setTCCL(prevTCCL); } } }
/** * Create a new {@link DatatypeFactory} * * @return * * @throws DatatypeConfigurationException */ public static DatatypeFactory newDatatypeFactory() throws DatatypeConfigurationException { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(XMLTimeUtil.class.getClassLoader()); } return DatatypeFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } }
/** * Create a new {@link DatatypeFactory} * * @return * * @throws DatatypeConfigurationException */ public static DatatypeFactory newDatatypeFactory() throws DatatypeConfigurationException { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(XMLTimeUtil.class.getClassLoader()); } return DatatypeFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } }
/** * <p>Creates a {@link TransformerFactory}. The returned instance is cached and shared between different * threads.</p> * * @return * * @throws TransformerFactoryConfigurationError */ public static TransformerFactory getTransformerFactory() throws TransformerFactoryConfigurationError { if (transformerFactory == null) { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(TransformerUtil.class.getClassLoader()); } transformerFactory = TransformerFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } return transformerFactory; }
/** * <p>Creates a {@link TransformerFactory}. The returned instance is cached and shared between different * threads.</p> * * @return * * @throws TransformerFactoryConfigurationError */ public static TransformerFactory getTransformerFactory() throws TransformerFactoryConfigurationError { if (transformerFactory == null) { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(TransformerUtil.class.getClassLoader()); } transformerFactory = TransformerFactory.newInstance(); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } } return transformerFactory; }
/** * Use the transformer to transform * * @param transformer * @param source * @param result * * @throws ParsingException */ public static void transform(Transformer transformer, Source source, DOMResult result) throws ParsingException { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false").equalsIgnoreCase("true"); ClassLoader prevCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(TransformerUtil.class.getClassLoader()); } transformer.transform(source, result); } catch (TransformerException e) { throw logger.parserError(e); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevCL); } } }
boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL();
boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false") .equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL();
/** * Use the transformer to transform * * @param transformer * @param source * @param result * * @throws ParsingException */ public static void transform(Transformer transformer, Source source, DOMResult result) throws ParsingException { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false").equalsIgnoreCase("true"); ClassLoader prevCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(TransformerUtil.class.getClassLoader()); } transformer.transform(source, result); } catch (TransformerException e) { throw logger.parserError(e); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevCL); } } }
private static Schema getSchema() throws IOException { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false").equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(JAXPValidationUtil.class.getClassLoader()); } schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); schemaFactory.setResourceResolver(new IDFedLSInputResolver()); schemaFactory.setErrorHandler(new CustomErrorHandler()); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } Schema schemaGrammar = null; try { schemaGrammar = schemaFactory.newSchema(sources()); } catch (SAXException e) { logger.xmlCouldNotGetSchema(e); } return schemaGrammar; }
private static Schema getSchema() throws IOException { boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false").equalsIgnoreCase("true"); ClassLoader prevTCCL = SecurityActions.getTCCL(); try { if (tccl_jaxp) { SecurityActions.setTCCL(JAXPValidationUtil.class.getClassLoader()); } schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); schemaFactory.setResourceResolver(new IDFedLSInputResolver()); schemaFactory.setErrorHandler(new CustomErrorHandler()); } finally { if (tccl_jaxp) { SecurityActions.setTCCL(prevTCCL); } } Schema schemaGrammar = null; try { schemaGrammar = schemaFactory.newSchema(sources()); } catch (SAXException e) { logger.xmlCouldNotGetSchema(e); } return schemaGrammar; }