Package org.milyn.delivery

Examples of org.milyn.delivery.SmooksContentHandler


        // 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 ..
View Full Code Here


    public static DynamicSAXElementVisitorList getList(ExecutionContext executionContext) {
        return (DynamicSAXElementVisitorList) executionContext.getAttribute(DynamicSAXElementVisitorList.class);
    }

    public static void addDynamicVisitor(SAXVisitor visitor, ExecutionContext executionContext) {
        SmooksContentHandler contentHandler = SmooksContentHandler.getHandler(executionContext);
        SmooksContentHandler nestedContentHandler = contentHandler.getNestedContentHandler();

        if(nestedContentHandler == null) {
            DynamicSAXElementVisitorList list = getList(executionContext);

            if(visitor instanceof SAXVisitBefore) {
                list.visitBefores.add((SAXVisitBefore) visitor);
            }
            if(visitor instanceof SAXVisitChildren) {
                list.childVisitors.add((SAXVisitChildren) visitor);
            }
            if(visitor instanceof SAXVisitAfter) {
                list.visitAfters.add((SAXVisitAfter) visitor);
            }
        } else {
            addDynamicVisitor(visitor, nestedContentHandler.getExecutionContext());
        }
    }
View Full Code Here

TOP

Related Classes of org.milyn.delivery.SmooksContentHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.