public class JavaSource extends FilterSource
Source
.
setEventStreamRequired(boolean)
method, or by configuring the 'http://www.smooks.org/sax/features/generate-java-event-stream'
feature on the reader in the Smoooks configuration as follows:
<reader> <features> <setOff feature="http://www.smooks.org/sax/features/generate-java-event-stream" /> </features> </reader>Turning off event stream generation can make sense in many situations. In some use cases event stream generation may add no value and may just reduces performance e.g. where you simply wish to apply a template to the supplied Java Object(s). Smooks must generate at least 1 event to which configured resources can be targeted (e.g. a templating resource). When event stream generation is turned off, Smooks simply generates what we call a "Null Source" document event. In XML, it could be represented as "<nullsource-document/>". So when event stream generation is turned off, simply target resources at "nullsource-document" or "#document".
Modifier and Type | Field and Description |
---|---|
static String |
FEATURE_GENERATE_EVENT_STREAM |
CONTEXT_KEY
Constructor and Description |
---|
JavaSource()
Deprecated.
Use any of the other constructors.
|
JavaSource(List<Object> sourceObjects)
Construct a JavaSource from the supplied source object.
|
JavaSource(Object sourceObject)
Construct a JavaSource from the supplied source object.
|
JavaSource(String objectName,
Object sourceObject)
Construct a JavaSource from the supplied source object.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getBeans()
Get the input bean map for the transform.
|
List<Object> |
getSourceObjects()
Get the source object list.
|
boolean |
isEventStreamRequired()
Is SAX event stream generation required for the processing of this JavaSource.
|
void |
setBeans(Map<String,Object> beans)
Set the input bean map for the transform.
|
void |
setEventStreamRequired(boolean eventStreamRequired)
Turn on/off SAX event stream generation for the processing of this JavaSource.
|
getSource, getSystemId, setSource, setSystemId
public static final String FEATURE_GENERATE_EVENT_STREAM
public JavaSource()
public JavaSource(Object sourceObject)
sourceObject
- The source object.public JavaSource(String objectName, Object sourceObject)
objectName
- The object name the sourceObject is known undersourceObject
- The source object.public boolean isEventStreamRequired()
true
.public void setEventStreamRequired(boolean eventStreamRequired)
eventStreamRequired
- True if SAX event stream generation is required, otherwise false.public List<Object> getSourceObjects()
public Map<String,Object> getBeans()
Copyright © 2020. All rights reserved.