public static XMLReader getXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { return xmlReaderStack.peek(); } else { return null; } }
public static XMLReader getXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { return xmlReaderStack.peek(); } else { return null; } }
public static XMLReader getXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { return xmlReaderStack.peek(); } else { return null; } }
public static XMLReader getXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { return xmlReaderStack.peek(); } else { return null; } }
public static void detachXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { xmlReaderStack.pop(); NamespaceMappings.getNamespaceDeclarationStack(execContext).popReader(); } }
public static void detachXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { xmlReaderStack.pop(); NamespaceMappings.getNamespaceDeclarationStack(execContext).popReader(); } }
public static void attachXMLReader(XMLReader xmlReader, ExecutionContext execContext) { getReaders(execContext).push(xmlReader); NamespaceDeclarationStack namespaceDeclarationStack = NamespaceMappings.getNamespaceDeclarationStack(execContext); if(namespaceDeclarationStack == null) { throw new IllegalStateException("No NamespaceDeclarationStack attached to the ExecutionContext."); } namespaceDeclarationStack.pushReader(xmlReader); }
public static void attachXMLReader(XMLReader xmlReader, ExecutionContext execContext) { getReaders(execContext).push(xmlReader); NamespaceDeclarationStack namespaceDeclarationStack = NamespaceMappings.getNamespaceDeclarationStack(execContext); if(namespaceDeclarationStack == null) { throw new IllegalStateException("No NamespaceDeclarationStack attached to the ExecutionContext."); } namespaceDeclarationStack.pushReader(xmlReader); }
public static void detachXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { xmlReaderStack.pop(); NamespaceMappings.getNamespaceDeclarationStack(execContext).popReader(); } }
public static void attachXMLReader(XMLReader xmlReader, ExecutionContext execContext) { getReaders(execContext).push(xmlReader); NamespaceDeclarationStack namespaceDeclarationStack = NamespaceMappings.getNamespaceDeclarationStack(execContext); if(namespaceDeclarationStack == null) { throw new IllegalStateException("No NamespaceDeclarationStack attached to the ExecutionContext."); } namespaceDeclarationStack.pushReader(xmlReader); }
public static void attachXMLReader(XMLReader xmlReader, ExecutionContext execContext) { getReaders(execContext).push(xmlReader); NamespaceDeclarationStack namespaceDeclarationStack = NamespaceMappings.getNamespaceDeclarationStack(execContext); if(namespaceDeclarationStack == null) { throw new IllegalStateException("No NamespaceDeclarationStack attached to the ExecutionContext."); } namespaceDeclarationStack.pushReader(xmlReader); }
public static void detachXMLReader(ExecutionContext execContext) { Stack<XMLReader> xmlReaderStack = getReaders(execContext); if(!xmlReaderStack.isEmpty()) { xmlReaderStack.pop(); NamespaceMappings.getNamespaceDeclarationStack(execContext).popReader(); } }
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException { Smooks smooks = getSmooksInstance(); ExecutionContext nestedExecutionContext = smooks.createExecutionContext(); // In case there's an attached event listener... nestedExecutionContext.setEventListener(executionContext.getEventListener()); // Copy over the XMLReader stack... AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext); // Attach the NamespaceDeclarationStack to the nested execution context... NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext); NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext); SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext); if(parentContentHandler.getNestedContentHandler() != null) { throw new SmooksException("Illegal use of more than one nested content handler fired on the same element."); } SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler); DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext); // Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on // the XMLReader to be the nested handler created here. All events wll be forwarded to the .. XMLReader xmlReader = AbstractParser.getXMLReader(executionContext); AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext); xmlReader.setContentHandler(nestedContentHandler); executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext); // Note we do not execute the Smooks filterSource methods for a nested instance... we just install // the content handler and redirect the reader events to it... }
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException { Smooks smooks = getSmooksInstance(); ExecutionContext nestedExecutionContext = smooks.createExecutionContext(); // In case there's an attached event listener... nestedExecutionContext.setEventListener(executionContext.getEventListener()); // Copy over the XMLReader stack... AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext); // Attach the NamespaceDeclarationStack to the nested execution context... NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext); NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext); SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext); if(parentContentHandler.getNestedContentHandler() != null) { throw new SmooksException("Illegal use of more than one nested content handler fired on the same element."); } SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler); DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext); // Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on // the XMLReader to be the nested handler created here. All events wll be forwarded to the .. XMLReader xmlReader = AbstractParser.getXMLReader(executionContext); AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext); xmlReader.setContentHandler(nestedContentHandler); executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext); // Note we do not execute the Smooks filterSource methods for a nested instance... we just install // the content handler and redirect the reader events to it... }
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException { Smooks smooks = getSmooksInstance(); ExecutionContext nestedExecutionContext = smooks.createExecutionContext(); // In case there's an attached event listener... nestedExecutionContext.setEventListener(executionContext.getEventListener()); // Copy over the XMLReader stack... AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext); // Attach the NamespaceDeclarationStack to the nested execution context... NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext); NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext); SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext); if(parentContentHandler.getNestedContentHandler() != null) { throw new SmooksException("Illegal use of more than one nested content handler fired on the same element."); } SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler); DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext); // Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on // the XMLReader to be the nested handler created here. All events wll be forwarded to the .. XMLReader xmlReader = AbstractParser.getXMLReader(executionContext); AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext); xmlReader.setContentHandler(nestedContentHandler); executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext); // Note we do not execute the Smooks filterSource methods for a nested instance... we just install // the content handler and redirect the reader events to it... }
public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException { Smooks smooks = getSmooksInstance(); ExecutionContext nestedExecutionContext = smooks.createExecutionContext(); // In case there's an attached event listener... nestedExecutionContext.setEventListener(executionContext.getEventListener()); // Copy over the XMLReader stack... AbstractParser.setReaders(AbstractParser.getReaders(executionContext), nestedExecutionContext); // Attach the NamespaceDeclarationStack to the nested execution context... NamespaceDeclarationStack nsStack = NamespaceMappings.getNamespaceDeclarationStack(executionContext); NamespaceMappings.setNamespaceDeclarationStack(nsStack, nestedExecutionContext); SmooksContentHandler parentContentHandler = SmooksContentHandler.getHandler(executionContext); if(parentContentHandler.getNestedContentHandler() != null) { throw new SmooksException("Illegal use of more than one nested content handler fired on the same element."); } SmooksContentHandler nestedContentHandler = new SAXHandler(nestedExecutionContext, element.getWriter(this), parentContentHandler); DynamicSAXElementVisitorList.propogateDynamicVisitors(executionContext, nestedExecutionContext); // Attach the XMLReader instance to the nested ExecutionContext and then swap the content handler on // the XMLReader to be the nested handler created here. All events wll be forwarded to the .. XMLReader xmlReader = AbstractParser.getXMLReader(executionContext); AbstractParser.attachXMLReader(xmlReader, nestedExecutionContext); xmlReader.setContentHandler(nestedContentHandler); executionContext.setAttribute(NestedExecutionVisitor.class, nestedExecutionContext); // Note we do not execute the Smooks filterSource methods for a nested instance... we just install // the content handler and redirect the reader events to it... }