public class Parameter extends Object implements IConfigurable, IWithParameters
stored under SessionKey 'TransportInfo':
<transportinfo>
<to>***@zonnet.nl</to>
<to>***@zonnet.nl</to>
<cc>***@zonnet.nl</cc>
</transportinfo>
to obtain all 'to' addressees as a parameter:
sessionKey="TransportInfo"
xpathExpression="transportinfo/to"
type="xml"
Result:
<to>***@zonnet.nl</to>
<to>***@zonnet.nl</to>
N.B. to obtain a fixed value: a non-existing 'dummy' sessionKey
in combination with the fixed value in defaultValue
is used traditionally.
The current version of parameter supports the 'value' attribute, that is sufficient to set a fixed value.Modifier and Type | Class and Description |
---|---|
static class |
Parameter.DefaultValueMethods |
static class |
Parameter.ParameterType |
Modifier and Type | Field and Description |
---|---|
static String |
FIXEDHOSTNAME |
static String |
FIXEDUID |
protected org.apache.logging.log4j.Logger |
log |
protected ParameterList |
paramList |
static String |
TYPE_DATE_PATTERN |
static String |
TYPE_DATETIME_PATTERN |
static String |
TYPE_TIME_PATTERN |
static String |
TYPE_TIMESTAMP_PATTERN |
Constructor and Description |
---|
Parameter() |
Parameter(String name,
String value)
utility constructor, useful for unit testing
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(Parameter p) |
void |
configure() |
boolean |
consumesSessionVariable(String sessionKey) |
String |
getName() |
ParameterList |
getParameterList() |
Object |
getValue(ParameterValueList alreadyResolvedParameters,
Message message,
PipeLineSession session,
boolean namespaceAware)
determines the raw value
|
boolean |
requiresInputValueForResolution()
if this returns true, then the input value must be repeatable, as it might be used multiple times.
|
boolean |
requiresInputValueOrContextForResolution() |
void |
setAuthAlias(String string)
Alias used to obtain username and password, used when a
pattern containing {username} or {password} is specified |
void |
setContextKey(String string)
key of message context variable to use as source, instead of the message found from input message or sessionKey itself
|
void |
setDecimalSeparator(String string)
Used in combination with type
NUMBER |
void |
setDefaultValue(String string)
If the result of sessionKey, xpathExpression and/or stylesheet returns null or an empty string, this value is returned
|
void |
setDefaultValueMethods(String string)
Comma separated list of methods (
defaultValue , sessionKey , pattern , value or input ) to use as default value. |
void |
setFormatString(String string)
Used in combination with types
DATE , TIME , DATETIME and TIMESTAMP to parse the raw parameter string data into an object of the respective type |
void |
setGroupingSeparator(String string)
Used in combination with type
NUMBER |
void |
setHidden(boolean b)
If set to
true , the value of the parameter will not be shown in the log (replaced by asterisks) |
void |
setIgnoreUnresolvablePatternElements(boolean b)
If set
true pattern elements that cannot be resolved to a parameter or sessionKey are silently resolved to an empty string |
void |
setMaxInclusive(String string)
Used in combination with type
number ; if set and the value of the parameter exceeds this maximum value, this maximum value is taken |
void |
setMaxLength(int i)
If set (>=0) and the length of the value of the parameter exceeds this maximum length, the length is trimmed to this maximum length
|
void |
setMinInclusive(String string)
Used in combination with type
number ; if set and the value of the parameter falls short of this minimum value, this minimum value is taken |
void |
setMinLength(int i)
If set (>=0) and the length of the value of the parameter falls short of this minimum length, the value is padded
|
void |
setName(String parameterName)
Name of the parameter
|
void |
setNamespaceDefs(String namespaceDefs)
Namespace defintions for xpathExpression.
|
void |
setPassword(String string)
Default password that is used when a
pattern containing {password} is specified |
void |
setPattern(String string)
Value of parameter is determined using substitution and formatting, following MessageFormat syntax with named parameters.
|
void |
setRemoveNamespaces(boolean b)
When set
true namespaces (and prefixes) in the input message are removed before the stylesheet/xpathExpression is executed |
void |
setSessionKey(String string)
Key of a PipelineSession-variable.
|
void |
setSessionKeyXPath(String string)
Instead of a fixed
sessionKey it's also possible to use a XPath expression applied to the input message to extract the name of the session-variable. |
void |
setStyleSheetName(String stylesheetName)
URL to a stylesheet that wil be applied to the contents of the message or the value of the session-variable.
|
void |
setType(Parameter.ParameterType type)
The target data type of the parameter, related to the database or XSLT stylesheet to which the parameter is applied.
|
void |
setUsername(String string)
Default username that is used when a
pattern containing {username} is specified |
void |
setUserName(String username)
Deprecated.
|
void |
setValue(String value)
The value of the parameter, or the base for transformation using xpathExpression or stylesheet, or formatting.
|
void |
setXpathExpression(String xpathExpression)
the XPath expression to extract the parameter value from the (xml formatted) input or session-variable.
|
void |
setXslt2(boolean b)
Deprecated.
|
void |
setXsltVersion(int xsltVersion)
when set to
2 xslt processor 2.0 (net.sf.saxon) will be used, otherwise xslt processor 1.0 (org.apache.xalan). |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getApplicationContext
getConfigurationClassLoader
protected org.apache.logging.log4j.Logger log
public static final String TYPE_DATE_PATTERN
public static final String TYPE_TIME_PATTERN
public static final String TYPE_DATETIME_PATTERN
public static final String TYPE_TIMESTAMP_PATTERN
public static final String FIXEDUID
public static final String FIXEDHOSTNAME
protected ParameterList paramList
public void addParameter(Parameter p)
addParameter
in interface IWithParameters
public ParameterList getParameterList()
getParameterList
in interface IWithParameters
public void configure() throws ConfigurationException
configure
in interface IConfigurable
ConfigurationException
public boolean requiresInputValueForResolution()
public boolean requiresInputValueOrContextForResolution()
public boolean consumesSessionVariable(String sessionKey)
public Object getValue(ParameterValueList alreadyResolvedParameters, Message message, PipeLineSession session, boolean namespaceAware) throws ParameterException
ParameterException
public void setName(String parameterName)
setName
in interface INamedObject
public String getName()
getName
in interface IConfigurationAware
getName
in interface INamedObject
public void setType(Parameter.ParameterType type)
public void setValue(String value)
public void setSessionKey(String string)
public void setContextKey(String string)
public void setSessionKeyXPath(String string)
sessionKey
it's also possible to use a XPath expression applied to the input message to extract the name of the session-variable.public void setStyleSheetName(String stylesheetName)
public void setXpathExpression(String xpathExpression)
public void setXsltVersion(int xsltVersion)
2
xslt processor 2.0 (net.sf.saxon) will be used, otherwise xslt processor 1.0 (org.apache.xalan). 0
will auto detect@Deprecated @ConfigurationWarning(value="Its value is now auto detected. If necessary, replace with a setting of xsltVersion") public void setXslt2(boolean b)
public void setNamespaceDefs(String namespaceDefs)
prefix=namespaceuri
-definitions. One entry can be without a prefix, that will define the default namespace.public void setRemoveNamespaces(boolean b)
true
namespaces (and prefixes) in the input message are removed before the stylesheet/xpathExpression is executedfalse
public void setDefaultValue(String string)
public void setDefaultValueMethods(String string)
defaultValue
, sessionKey
, pattern
, value
or input
) to use as default value. Used in the order they appear until a non-null value is found.defaultValue
public void setPattern(String string)
fname
is a parameter or session variable that resolves to eric, then the pattern
'hi {fname}, hoe gaat het?' resolves to 'hi eric, hoe gaat het?'.pattern
like {now} or {fixeddate} with a DATE, TIME, DATETIME or TIMESTAMP type
, the effective value of the attribute
formatString
must match the effective value of the formatString in the pattern
.public void setAuthAlias(String string)
pattern
containing {username} or {password} is specifiedpublic void setUsername(String string)
pattern
containing {username} is specified@Deprecated @ConfigurationWarning(value="Please use attribute username instead") public void setUserName(String username)
public void setPassword(String string)
pattern
containing {password} is specifiedpublic void setIgnoreUnresolvablePatternElements(boolean b)
true
pattern elements that cannot be resolved to a parameter or sessionKey are silently resolved to an empty stringpublic void setFormatString(String string)
DATE
, TIME
, DATETIME
and TIMESTAMP
to parse the raw parameter string data into an object of the respective typepublic void setDecimalSeparator(String string)
NUMBER
public void setGroupingSeparator(String string)
NUMBER
public void setMinLength(int i)
public void setMaxLength(int i)
public void setMaxInclusive(String string)
number
; if set and the value of the parameter exceeds this maximum value, this maximum value is takenpublic void setMinInclusive(String string)
number
; if set and the value of the parameter falls short of this minimum value, this minimum value is takenpublic void setHidden(boolean b)
true
, the value of the parameter will not be shown in the log (replaced by asterisks)false
Copyright © 2023 Frank!Framework. All rights reserved.