org.milyn.delivery.dom.DOMContentDeliveryConfig Maven / Gradle / Ivy
The 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.cdr.SmooksConfigurationException;
import org.milyn.container.ExecutionContext;
import org.milyn.delivery.*;
import org.milyn.delivery.dom.serialize.SerializationUnit;
import org.milyn.delivery.ordering.Sorter;
/**
* DOM specific {@link org.milyn.delivery.ContentDeliveryConfig} implementation.
*
* @author [email protected]
*/
@SuppressWarnings("unchecked")
public class DOMContentDeliveryConfig extends AbstractContentDeliveryConfig {
private ContentHandlerConfigMapTable assemblyVisitBefores;
private ContentHandlerConfigMapTable assemblyVisitAfters;
private ContentHandlerConfigMapTable processingVisitBefores;
private ContentHandlerConfigMapTable processingVisitAfters;
private ContentHandlerConfigMapTable serializationVisitors;
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 getSerializationVisitors() {
return serializationVisitors;
}
public void setSerializationVisitors(ContentHandlerConfigMapTable serializationVisitors) {
this.serializationVisitors = serializationVisitors;
}
@SuppressWarnings("WeakerAccess")
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, serializationVisitors);
}
}