public class RegexpMetadataQuery
extends java.lang.Object
Performs a Regular Expression based Query on a supplied String.
In the adapter configuration file this class is aliased as regexp-metadata-query which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
RegexpMetadataQuery() |
RegexpMetadataQuery(java.lang.String key,
java.lang.String query) |
Modifier and Type | Method and Description |
---|---|
MetadataElement |
doQuery(java.lang.String message)
Performs the query against the payload of the supplied String and
constructs a MetdataElement with the configured Key and the result as the
Value.
|
java.lang.Boolean |
getAllowNulls()
Returns whether the class allows null results.
|
java.lang.String |
getMetadataKey()
Returns the key to store the result of the regexp query against.
|
java.lang.String |
getQueryExpression()
Returns the regexp query expression.
|
void |
setAllowNulls(java.lang.Boolean b)
Tells the class whether to allow processing to continue after
performing an regexp which returns no elements.
|
void |
setMetadataKey(java.lang.String s)
Sets the key to store the result of the regexp query against.
|
void |
setQueryExpression(java.lang.String s)
Sets the regexp query expression to use.
|
public RegexpMetadataQuery()
public RegexpMetadataQuery(java.lang.String key, java.lang.String query)
public MetadataElement doQuery(java.lang.String message) throws CoreException
Performs the query against the payload of the supplied String and constructs a MetdataElement with the configured Key and the result as the Value.
message
- the String to run the Query onCoreException
- wrapping any underlying Exceptionpublic void setMetadataKey(java.lang.String s)
Sets the key to store the result of the regexp query against.
s
- the key to store the result of the regexp query againstpublic java.lang.String getMetadataKey()
Returns the key to store the result of the regexp query against.
public void setQueryExpression(java.lang.String s)
Sets the regexp query expression to use.
s
- the regexp query expression to usepublic java.lang.String getQueryExpression()
Returns the regexp query expression.
public void setAllowNulls(java.lang.Boolean b)
Tells the class whether to allow processing to continue after performing an regexp which returns no elements. Default is false WARNING! if using this method, the returned MetadataElements will return null from their getValue() clause. Ensure the receiving service is able to cater for this eventuality
b
- set whether or not to processpublic java.lang.Boolean getAllowNulls()
Returns whether the class allows null results.