public Object run() { return new TransletClassLoader(ObjectFactory.findClassLoader()); } });
/** * Access to final protected superclass member from outer class. */ Class defineClass(final byte[] b) { return defineClass(null, b, 0, b.length); } }
/** * Returns the translet bytecodes stored in this template */ public synchronized Class[] getTransletClasses() { try { if (_class == null) defineTransletClasses(); } catch (TransformerConfigurationException e) { // Falls through } return _class; }
/** * Implements JAXP's Templates.newTransformer() * * @throws TransformerConfigurationException */ public synchronized Transformer newTransformer() throws TransformerConfigurationException { TransformerImpl transformer; transformer = new TransformerImpl(getTransletInstance(), _outputProperties, _indentNumber, _tfactory); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } if (_tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) { transformer.setSecureProcessing(true); } return transformer; }
public void setContentHandler (ContentHandler handler) { _transformerHandler.setResult(new SAXResult(handler)); if (getParent() == null) { try { createParent(); } catch (SAXException e) { return; } } getParent().setContentHandler(_transformerHandler); }
/** * javax.xml.transform.sax.SAXTransformerFactory implementation. * Get a TransformerHandler object that can process SAX ContentHandler * events into a Result. This method will return a pure copy transformer. * * @return A TransformerHandler object that can handle SAX events * @throws TransformerConfigurationException */ public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { final Transformer transformer = newTransformer(); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return new TransformerHandlerImpl((TransformerImpl) transformer); }
/** * javax.xml.transform.sax.SAXTransformerFactory implementation. * Create an XMLFilter that uses the given source as the * transformation instructions. * * @param src The source of the transformation instructions. * @return An XMLFilter object, or null if this feature is not supported. * @throws TransformerConfigurationException */ public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if (templates == null) return null; return newXMLFilter(templates); }
/** * javax.xml.transform.sax.SAXTransformerFactory implementation. * Get a TemplatesHandler object that can process SAX ContentHandler * events into a Templates object. * * @return A TemplatesHandler object that can handle SAX events * @throws TransformerConfigurationException */ public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { final TemplatesHandlerImpl handler = new TemplatesHandlerImpl(_indentNumber, this); if (_uriResolver != null) { handler.setURIResolver(_uriResolver); } return handler; }
public Node getNode() { return (_handler instanceof SAX2DOM) ? ((SAX2DOM)_handler).getDOM() : null; }
private void createXSLTCTransformerFactory() { _xsltcFactory = new TransformerFactoryImpl(); _currFactory = _xsltcFactory; }
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
/** * This method resets the Transformer to its original configuration * Transformer code is reset to the same state it was when it was * created * @since 1.5 */ public void reset() { _method = null; _encoding = null; _sourceSystemId = null; _errorListener = this; _uriResolver = null; _dom = null; _parameters = null; _indentNumber = 0; setOutputProperties (null); } }
/** * Finds the implementation Class object in the specified order. The * specified order is the following: * <ol> * <li>query the system property using <code>System.getProperty</code> * <li>read <code>META-INF/services/<i>factoryId</i></code> file * <li>use fallback classname * </ol> * * @return instance of factory, never null * * @param factoryId Name of the factory to find, same as * a property name * @param fallbackClassName Implementation class name, if nothing else * is found. Use null to mean no fallback. * * @exception ObjectFactory.ConfigurationError */ static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); } // createObject(String,String):Object
public TrAXFilter(Templates templates) throws TransformerConfigurationException { _templates = templates; _transformer = (TransformerImpl) templates.newTransformer(); _transformerHandler = new TransformerHandlerImpl(_transformer); }
public void parse (String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); }
protected TransformerImpl(Translet translet, Properties outputProperties, int indentNumber, TransformerFactoryImpl tfactory) { _translet = (AbstractTranslet) translet; _properties = createOutputProperties(outputProperties); _propertiesClone = (Properties) _properties.clone(); _indentNumber = indentNumber; _tfactory = tfactory; //_isIncremental = tfactory._incremental; }
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { if (_currFactory == null) { createXSLTCTransformerFactory(); } return _currFactory.getAssociatedStylesheet(source, media, title, charset); }
/** * javax.xml.transform.sax.SAXTransformerFactory implementation. * Get a TransformerHandler object that can process SAX ContentHandler * events into a Result, based on the transformation instructions * specified by the argument. * * @param src The source of the transformation instructions. * @return A TransformerHandler object that can handle SAX events * @throws TransformerConfigurationException */ public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { final Transformer transformer = newTransformer(src); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return new TransformerHandlerImpl((TransformerImpl) transformer); }
/** * Returns the index of the main class in array of bytecodes */ public synchronized int getTransletIndex() { try { if (_class == null) defineTransletClasses(); } catch (TransformerConfigurationException e) { // Falls through } return _transletIndex; }