Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synergy-api-util
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raimbek Egemberdiev
synergy-api-util
Commits
9debbcab
Commit
9debbcab
authored
Nov 16, 2016
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
компонент DateCmp исправлена ошибка NullPointerException
parent
4878c009
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
src/main/java/kz/arta/synergy/api/asforms/converter/components/DateConverter.java
...nergy/api/asforms/converter/components/DateConverter.java
+4
-0
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormData.java
...ain/java/kz/arta/synergy/api/asforms/pojo/AsFormData.java
+7
-0
src/test/java/kz/arta/synergy/api/asforms/AsFormServiceTest.java
...t/java/kz/arta/synergy/api/asforms/AsFormServiceTest.java
+1
-0
src/test/java/kz/arta/synergy/pojo/TestForm.java
src/test/java/kz/arta/synergy/pojo/TestForm.java
+23
-0
No files found.
src/main/java/kz/arta/synergy/api/asforms/converter/components/DateConverter.java
View file @
9debbcab
...
@@ -47,6 +47,10 @@ public class DateConverter extends AbstractComponentConverter {
...
@@ -47,6 +47,10 @@ public class DateConverter extends AbstractComponentConverter {
String
cmpId
=
getCmpId
(
field
,
annotation
,
index
);
String
cmpId
=
getCmpId
(
field
,
annotation
,
index
);
AsFormData
data
=
asfData
.
getData
(
cmpId
);
AsFormData
data
=
asfData
.
getData
(
cmpId
);
if
(
data
==
null
)
{
return
;
}
String
dateString
;
String
dateString
;
if
(
ComponentTypes
.
DATE
.
equals
(
data
.
getType
())
||
hasKeyValueAnnotation
(
field
))
{
if
(
ComponentTypes
.
DATE
.
equals
(
data
.
getType
())
||
hasKeyValueAnnotation
(
field
))
{
dateString
=
data
.
getKey
();
dateString
=
data
.
getKey
();
...
...
src/main/java/kz/arta/synergy/api/asforms/pojo/AsFormData.java
View file @
9debbcab
...
@@ -130,6 +130,13 @@ public class AsFormData extends AsFormDataContainer {
...
@@ -130,6 +130,13 @@ public class AsFormData extends AsFormDataContainer {
return
asFormData
;
return
asFormData
;
}
}
public
static
AsFormData
createDate
(
String
cmpId
,
String
value
,
String
key
)
{
AsFormData
asFormData
=
create
(
cmpId
,
ComponentTypes
.
DATE
);
asFormData
.
setValue
(
value
);
asFormData
.
setKey
(
key
);
return
asFormData
;
}
public
static
AsFormData
create
(
String
id
,
String
type
)
{
public
static
AsFormData
create
(
String
id
,
String
type
)
{
AsFormData
asFormData
=
new
AsFormData
();
AsFormData
asFormData
=
new
AsFormData
();
asFormData
.
setId
(
id
);
asFormData
.
setId
(
id
);
...
...
src/test/java/kz/arta/synergy/api/asforms/AsFormServiceTest.java
View file @
9debbcab
...
@@ -48,6 +48,7 @@ public class AsFormServiceTest {
...
@@ -48,6 +48,7 @@ public class AsFormServiceTest {
asFormWrapper
.
addData
(
AsFormData
.
numericinput
(
"numeric_input_key"
,
expectedNumericInputValue
,
expectedNumericInputKey
));
asFormWrapper
.
addData
(
AsFormData
.
numericinput
(
"numeric_input_key"
,
expectedNumericInputValue
,
expectedNumericInputKey
));
asFormWrapper
.
addData
(
AsFormData
.
numericinput
(
"numeric_input_value"
,
expectedNumericInputValue
,
expectedNumericInputKey
));
asFormWrapper
.
addData
(
AsFormData
.
numericinput
(
"numeric_input_value"
,
expectedNumericInputValue
,
expectedNumericInputKey
));
asFormWrapper
.
addData
(
AsFormData
.
numericinput
(
"file"
,
expectedFileValue
,
expectedFileKey
));
asFormWrapper
.
addData
(
AsFormData
.
numericinput
(
"file"
,
expectedFileValue
,
expectedFileKey
));
asFormWrapper
.
addData
(
AsFormData
.
createDate
(
"date"
,
"2016-05-17 00:00:00"
,
"2016-05-17 00:00:00"
));
AsFormData
tableData
=
new
AsFormData
();
AsFormData
tableData
=
new
AsFormData
();
tableData
.
setType
(
ComponentTypes
.
TABLE
);
tableData
.
setType
(
ComponentTypes
.
TABLE
);
...
...
src/test/java/kz/arta/synergy/pojo/TestForm.java
View file @
9debbcab
...
@@ -5,6 +5,7 @@ import kz.arta.synergy.api.asforms.pojo.AsForm;
...
@@ -5,6 +5,7 @@ import kz.arta.synergy.api.asforms.pojo.AsForm;
import
kz.arta.synergy.api.asforms.pojo.AsFormData
;
import
kz.arta.synergy.api.asforms.pojo.AsFormData
;
import
kz.arta.synergy.api.asforms.pojo.ComponentTypes
;
import
kz.arta.synergy.api.asforms.pojo.ComponentTypes
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -32,6 +33,12 @@ public class TestForm extends AsForm {
...
@@ -32,6 +33,12 @@ public class TestForm extends AsForm {
@TextBox
(
"integer_input"
)
@TextBox
(
"integer_input"
)
private
Integer
integerValue
;
private
Integer
integerValue
;
@DateCmp
private
Date
date
;
@DateCmp
private
Date
nullDate
;
public
String
getTextInput
()
{
public
String
getTextInput
()
{
return
textInput
;
return
textInput
;
}
}
...
@@ -90,4 +97,20 @@ public class TestForm extends AsForm {
...
@@ -90,4 +97,20 @@ public class TestForm extends AsForm {
public
void
setTableData
(
List
<
TableCmp
>
tableData
)
{
public
void
setTableData
(
List
<
TableCmp
>
tableData
)
{
this
.
tableData
=
tableData
;
this
.
tableData
=
tableData
;
}
}
public
Date
getDate
()
{
return
date
;
}
public
void
setDate
(
Date
date
)
{
this
.
date
=
date
;
}
public
Date
getNullDate
()
{
return
nullDate
;
}
public
void
setNullDate
(
Date
nullDate
)
{
this
.
nullDate
=
nullDate
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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