|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beandoc.output.SimpleDecorator
public abstract class SimpleDecorator
Abstract implementation of the Decorator
interface which
simply iterates each Element
in each Document
and calls the protected decorateElement
method that
subclasses will implement.
The Element
s selected for iteration can be modified from
the default (all Elements in the DOM) by specifying a Filter
based on Element
names.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
SimpleDecorator()
|
Method Summary | |
---|---|
void |
decorate(org.jdom.Document[] contextDocuments)
Permits decoration of the document by iterating all the filtered child elements in the Documents supplied and calls a decorateElement() for each one. |
protected abstract void |
decorateElement(org.jdom.Element element)
Each Element in each input Document is iteratively
passed to this method allowing subclasses to add or amend any attributes they
desire. |
void |
setFilter(org.jdom.filter.ElementFilter elementFilter)
Directly specify a Filter to limit the Elements from the DOM that this instance will iterate over when permitting decoration. |
void |
setFilterNames(String[] tagNames)
Specify an array of tag names that define Elements this instance will iterate over. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public SimpleDecorator()
Method Detail |
---|
public void decorate(org.jdom.Document[] contextDocuments)
By default, all Elements in the DOM are iterated. To filter the list to specific named Elements, use setFilterNames() or setFilter()
decorate
in interface Decorator
contextDocuments
- an array of Document objects representing the in-memory
tree of the input files supplied to the beandoc ContextProcessor
.Decorator.decorate(org.jdom.Document[])
,
setFilterNames(java.lang.String[])
,
setFilter(org.jdom.filter.ElementFilter)
protected abstract void decorateElement(org.jdom.Element element)
Element
in each input Document
is iteratively
passed to this method allowing subclasses to add or amend any attributes they
desire. It's possible to filter the view of the DOM, and thereby the list of
Element
s that will be passed to this method by setting a
Filter
on this instance.
element
- setFilterNames(java.lang.String[])
,
setFilter(org.jdom.filter.ElementFilter)
public void setFilter(org.jdom.filter.ElementFilter elementFilter)
elementFilter
- public void setFilterNames(String[] tagNames)
<bean>
and <property>
tags for example, you can set those two names
as elements of the array of names and only these Element
types will
be passed into the decorateElement
method.
tagNames
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |