Domanda

Is it possible to somehow match and parse the string within transformation template (CDT) ?

I have a string: Dictionary and I would need: 1) detect tha string starts with Dictionary keyword 2)extract second parameter -> Shift

È stato utile?

Soluzione

Sorted with following snippet - it is not most elegant way but works given the constraints

$dic=%FIND(opReturnType,"Dictionary")%

%If $dic!="-1"%
$note="TODO://Replace: with java.util.Map "
$note+=%opReturnType%
$t=%opReturnType%
$pos=%FIND($t,",")%
$dict=%LEFT($t,$pos)%
$ty=%REPLACE($t,$dict,"")%
$typ=%TRIM_LEFT($ty,",")%
$typp=%TRIM_RIGHT($typ,">")%
$type=%TRIM($typp)%
$lowerBound="0"
$upperBound="*"
%endIf%
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top