Package org.smooks.io.payload
Class JavaResult
- java.lang.Object
-
- org.smooks.io.payload.FilterResult
-
- org.smooks.io.payload.JavaResult
-
- All Implemented Interfaces:
Result
,ResultExtractor<JavaResult>
public class JavaResult extends FilterResult implements ResultExtractor<JavaResult>
Java filtration/transformation result. Used to extract a Java "result
" Map from the transformation. Simply set an instance of this class as theResult
arg in the call toSmooks.filterSource(ExecutionContext, javax.xml.transform.Source, javax.xml.transform.Result...)
.- Author:
- tom.fennelly@gmail.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaResult.ResultMap<K,V>
-
Field Summary
-
Fields inherited from class org.smooks.io.payload.FilterResult
RESULTS_TYPED_KEY
-
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
-
Constructor Summary
Constructors Constructor Description JavaResult()
Public default constructor.JavaResult(boolean preserveOrder)
Public default constructor.JavaResult(Map<String,Object> resultMap)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
extractFromResult(JavaResult result, Export export)
<T> T
getBean(Class<T> beanType)
Get the first instance of the specified bean type from this JavaResult instance.Object
getBean(String name)
Get the named bean from the Java Result Map.Map<String,Object>
getResultMap()
Get the Java result map.void
setResultMap(Map<String,Object> resultMap)
Set the Java result map.String
toString()
XML Serialized form of the bean Map associate with the result instance.-
Methods inherited from class org.smooks.io.payload.FilterResult
getResult, getResults, getSystemId, setResults, setSystemId
-
-
-
-
Constructor Detail
-
JavaResult
public JavaResult()
Public default constructor.
-
JavaResult
public JavaResult(boolean preserveOrder)
Public default constructor.
-
JavaResult
public JavaResult(Map<String,Object> resultMap)
Public constructor. SeesetResultMap(java.util.Map)
.- Parameters:
resultMap
- Result Map. This is the map onto which Java "result" objects will be set.
-
-
Method Detail
-
getBean
public Object getBean(String name)
Get the named bean from the Java Result Map.- Parameters:
name
- the name of the bean.- Returns:
- The bean Object, or null if the bean is not in the bean Result Map.
- See Also:
getResultMap()
-
getBean
public <T> T getBean(Class<T> beanType)
Get the first instance of the specified bean type from this JavaResult instance.- Parameters:
beanType
- The bean runtime class type.- Returns:
- The bean instance, otherwise null.
-
getResultMap
public Map<String,Object> getResultMap()
Get the Java result map.- Returns:
- The Java result map.
- See Also:
getBean(String)
-
setResultMap
public void setResultMap(Map<String,Object> resultMap)
Set the Java result map.- Parameters:
resultMap
- The Java result map.
-
toString
public String toString()
XML Serialized form of the bean Map associate with the result instance.
-
extractFromResult
public Object extractFromResult(JavaResult result, Export export)
- Specified by:
extractFromResult
in interfaceResultExtractor<JavaResult>
-
-