public class FlatteningDocumentProcessor extends Object implements DocumentProcessor
DocumentProcessor that parses the document for >include< elements and replaces them for the
actual referenced XML components.| Modifier and Type | Field and Description |
|---|---|
protected String |
charEncoding |
static String |
DEFAULT_CHAR_ENCODING |
static String |
DEFAULT_DISABLE_FLATTENING_ELEMENT |
static String |
DEFAULT_INCLUDE_ELEMENT_XPATH_QUERY |
protected String |
disableFlatteningElement |
protected boolean |
disableNestedPageFlattening |
protected String |
includeElementXPathQuery |
static String |
PAGE_ROOT_ELEMENT_NAME |
protected String |
pageRootElementName |
| Constructor and Description |
|---|
FlatteningDocumentProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInclude(org.dom4j.Element includeElement,
org.dom4j.Document includeSrc) |
protected org.dom4j.Document |
flattenXml(org.dom4j.Document document,
File file,
String rootFolder,
List<File> flattenedFiles) |
protected boolean |
isPage(org.dom4j.Document document) |
org.dom4j.Document |
process(org.dom4j.Document document,
File file,
String rootFolder)
Processes the specified XML DOM.
|
void |
setCharEncoding(String charEncoding) |
void |
setDisableFlatteningElement(String disableFlatteningElement) |
void |
setDisableNestedPageFlattening(boolean disableNestedPageFlattening) |
void |
setIncludeElementXPathQuery(String includeElementXPathQuery) |
void |
setPageRootElementName(String pageRootElementName) |
public static final String DEFAULT_CHAR_ENCODING
public static final String DEFAULT_INCLUDE_ELEMENT_XPATH_QUERY
public static final String DEFAULT_DISABLE_FLATTENING_ELEMENT
public static final String PAGE_ROOT_ELEMENT_NAME
protected String charEncoding
protected String includeElementXPathQuery
protected String disableFlatteningElement
protected String pageRootElementName
protected boolean disableNestedPageFlattening
public void setIncludeElementXPathQuery(String includeElementXPathQuery)
public void setDisableFlatteningElement(String disableFlatteningElement)
public void setPageRootElementName(String pageRootElementName)
public void setDisableNestedPageFlattening(boolean disableNestedPageFlattening)
public void setCharEncoding(String charEncoding)
public org.dom4j.Document process(org.dom4j.Document document,
File file,
String rootFolder)
throws org.dom4j.DocumentException
DocumentProcessorprocess in interface DocumentProcessordocument - the DOMfile - the XML filerootFolder - the root folder where this file is locatedorg.dom4j.DocumentExceptionprotected org.dom4j.Document flattenXml(org.dom4j.Document document,
File file,
String rootFolder,
List<File> flattenedFiles)
throws org.dom4j.DocumentException
org.dom4j.DocumentExceptionprotected void doInclude(org.dom4j.Element includeElement,
org.dom4j.Document includeSrc)
protected boolean isPage(org.dom4j.Document document)
Copyright © 2016 CrafterCMS. All Rights Reserved.