public class ServiceMapping
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME
The name of this class
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
ServiceMapping(java.lang.String source,
java.lang.String target,
VerbAction action,
java.lang.Class nounType)
Constructs a mapping
|
Modifier and Type | Method and Description |
---|---|
VerbAction |
getAction() |
java.lang.Class |
getNounType()
Gets the type of the noun on which the mapping is based.
|
java.lang.String |
getSource() |
java.lang.String |
getTarget() |
java.util.List |
getVariableNames() |
static java.util.List |
getVariables(java.lang.String source)
Gets a list of variable strings in the given source string.
|
static java.util.List |
getVariableValues(java.lang.String source)
Get potential variable values of a source.
|
boolean |
hasVariables()
Determines if this mapping contains variables
|
boolean |
matchesVariables(java.lang.String source)
Determines if the given source has values matching the variables in this mapping
|
java.lang.String |
resolveTarget(java.lang.String param)
Replaces the variables in a target string with the value in the given parameter
|
void |
setAction(VerbAction action)
Sets the action of the mapping
|
void |
setNounType(java.lang.Class nounType)
Sets the type of the noun on which the mapping is based.
|
void |
setSource(java.lang.String source)
Sets the source of the mapping
|
void |
setTarget(java.lang.String target)
Sets the mapping target
|
static java.lang.String |
stripVariable(java.lang.String source)
Strips variables from a source used for service mapping
|
static java.lang.String |
stripVariableValue(java.lang.String source)
Strips the possible variable value from a given source.
|
java.lang.String |
toString() |
public static final java.lang.String CLASS_NAME
public static final java.lang.String COPYRIGHT
public ServiceMapping(java.lang.String source, java.lang.String target, VerbAction action, java.lang.Class nounType)
source
- the source to be mapped fromtarget
- the target to be mapped to from the sourceaction
- the action for the mapped targetnounType
- the type of the noun that this mapping is based onpublic java.util.List getVariableNames()
List
of String
s. Each string is a variable name.public java.lang.String getSource()
public java.lang.String getTarget()
public void setSource(java.lang.String source)
source
- the source of the mapping to be setpublic void setTarget(java.lang.String target)
target
- the target of the mapping to setpublic VerbAction getAction()
public void setAction(VerbAction action)
action
- action of the mapping to be setpublic void setNounType(java.lang.Class nounType)
nounType
- the type of the nounpublic java.lang.Class getNounType()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String stripVariable(java.lang.String source)
source
- the source string for processpublic static java.lang.String stripVariableValue(java.lang.String source)
source
- the source to be strippedpublic static java.util.List getVariables(java.lang.String source)
source
- the source string from which the list of variables is retrievedpublic static java.util.List getVariableValues(java.lang.String source)
source
- the source to be examinedpublic boolean matchesVariables(java.lang.String source)
source,
- the source to be examinedpublic boolean hasVariables()
public java.lang.String resolveTarget(java.lang.String param)
param
- the param that the target is corresponding to