Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Uploader
Commits
e4360f47
Commit
e4360f47
authored
Apr 27, 2020
by
Matija Obreza
Browse files
Support split and regexp for all types using toString()
parent
77d32386
Changes
1
Hide whitespace changes
Inline
Side-by-side
anno-gui/src/main/java/org/genesys2/anno/converter/RowConverter.java
View file @
e4360f47
...
...
@@ -131,23 +131,27 @@ public class RowConverter {
private
static
Object
convertCellValue
(
Object
value
,
boolean
splitString
,
String
separator
,
String
pattern
,
String
groupPattern
)
{
if
(
value
!=
null
)
{
if
(
value
instanceof
String
)
{
String
stringValue
=
((
String
)
value
);
if
(
split
String
)
{
String
stringValue
=
value
.
toString
(
);
if
(
StringUtils
.
isBlank
(
stringValue
))
{
return
null
;
}
if
(
splitString
)
{
String
[]
split
=
stringValue
.
split
(
separator
);
for
(
int
i
=
split
.
length
-
1
;
i
>=
0
;
i
--)
{
if
(
pattern
!=
null
)
{
split
[
i
]
=
valueFromPattern
(
split
[
i
].
trim
(),
pattern
,
groupPattern
);
}
else
{
split
[
i
]
=
split
[
i
].
trim
();
}
String
[]
split
=
stringValue
.
split
(
separator
);
for
(
int
i
=
split
.
length
-
1
;
i
>=
0
;
i
--)
{
if
(
pattern
!=
null
)
{
split
[
i
]
=
valueFromPattern
(
split
[
i
].
trim
(),
pattern
,
groupPattern
);
}
else
{
split
[
i
]
=
split
[
i
].
trim
();
}
return
split
;
}
return
split
;
}
if
(
StringUtils
.
isNotBlank
(
pattern
))
{
String
stringValue
=
value
.
toString
();
if
(
StringUtils
.
isBlank
(
stringValue
))
{
return
null
;
}
String
patVal
=
valueFromPattern
(
stringValue
.
trim
(),
pattern
,
groupPattern
);
if
(
StringUtils
.
isBlank
(
patVal
))
{
return
null
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment