All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.milyn.delivery.dom.DOMContentDeliveryConfig Maven / Gradle / Ivy

There is a newer version: 1.7.1
Show newest version
/*
	Milyn - Copyright (C) 2006 - 2010

	This library is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License (version 2.1) as published by the Free Software
	Foundation.

	This library is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

	See the GNU Lesser General Public License for more details:
	http://www.gnu.org/licenses/lgpl.txt
*/
package org.milyn.delivery.dom;

import org.milyn.delivery.*;
import org.milyn.delivery.ordering.Sorter;
import org.milyn.delivery.dom.serialize.SerializationUnit;
import org.milyn.container.ExecutionContext;
import org.milyn.cdr.SmooksConfigurationException;

/**
 * DOM specific {@link org.milyn.delivery.ContentDeliveryConfig} implementation.
 * 
 * @author [email protected]
 */
public class DOMContentDeliveryConfig extends AbstractContentDeliveryConfig {

    private ContentHandlerConfigMapTable assemblyVisitBefores;
    private ContentHandlerConfigMapTable assemblyVisitAfters;
    private ContentHandlerConfigMapTable processingVisitBefores;
    private ContentHandlerConfigMapTable processingVisitAfters;
    private ContentHandlerConfigMapTable serailizationVisitors;
    private ContentHandlerConfigMapTable visitCleanables;
    private FilterBypass filterBypass;

    public ContentHandlerConfigMapTable getAssemblyVisitBefores() {
        return assemblyVisitBefores;
    }

    public void setAssemblyVisitBefores(ContentHandlerConfigMapTable assemblyVisitBefores) {
        this.assemblyVisitBefores = assemblyVisitBefores;
    }

    public ContentHandlerConfigMapTable getAssemblyVisitAfters() {
        return assemblyVisitAfters;
    }

    public void setAssemblyVisitAfters(ContentHandlerConfigMapTable assemblyVisitAfters) {
        this.assemblyVisitAfters = assemblyVisitAfters;
    }

    public ContentHandlerConfigMapTable getProcessingVisitBefores() {
        return processingVisitBefores;
    }

    public void setProcessingVisitBefores(ContentHandlerConfigMapTable processingVisitBefores) {
        this.processingVisitBefores = processingVisitBefores;
    }

    public ContentHandlerConfigMapTable getProcessingVisitAfters() {
        return processingVisitAfters;
    }

    public void setProcessingVisitAfters(ContentHandlerConfigMapTable processingVisitAfters) {
        this.processingVisitAfters = processingVisitAfters;
    }

    public ContentHandlerConfigMapTable getSerailizationVisitors() {
        return serailizationVisitors;
    }

    public void setSerailizationVisitors(ContentHandlerConfigMapTable serailizationVisitors) {
        this.serailizationVisitors = serailizationVisitors;
    }

    public ContentHandlerConfigMapTable getVisitCleanables() {
        return visitCleanables;
    }

    public void setVisitCleanables(ContentHandlerConfigMapTable visitCleanables) {
        this.visitCleanables = visitCleanables;
    }

    public Filter newFilter(ExecutionContext executionContext) {
        return new SmooksDOMFilter(executionContext);
    }

    public FilterBypass getFilterBypass() {
    	return filterBypass;
    }

    public void sort() throws SmooksConfigurationException {
        assemblyVisitBefores.sort(Sorter.SortOrder.PRODUCERS_FIRST);
        assemblyVisitAfters.sort(Sorter.SortOrder.CONSUMERS_FIRST);
        processingVisitBefores.sort(Sorter.SortOrder.PRODUCERS_FIRST);
        processingVisitAfters.sort(Sorter.SortOrder.CONSUMERS_FIRST);
    }

    public void addToExecutionLifecycleSets() throws SmooksConfigurationException {
        addToExecutionLifecycleSets(assemblyVisitBefores);
        addToExecutionLifecycleSets(assemblyVisitAfters);
        addToExecutionLifecycleSets(processingVisitBefores);
        addToExecutionLifecycleSets(processingVisitAfters);
    }

    public void configureFilterBypass() {
		filterBypass = getFilterBypass(assemblyVisitBefores, assemblyVisitAfters, processingVisitBefores, processingVisitAfters, serailizationVisitors);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy