Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
758f5298
Commit
758f5298
authored
Jun 06, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加ModuleList中缺少的方法
parent
1cc8da9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
4 deletions
+97
-4
IModule.java
...src/main/java/com/brilliance/mda/runtime/mda/IModule.java
+12
-2
AbstractModule.java
...a/com/brilliance/mda/runtime/mda/impl/AbstractModule.java
+36
-2
ModuleList.java
.../java/com/brilliance/mda/runtime/mda/impl/ModuleList.java
+49
-0
No files found.
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/IModule.java
View file @
758f5298
package
com
.
brilliance
.
mda
.
runtime
.
mda
;
import
com.brilliance.mda.runtime.annotation.Module
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -50,4 +48,16 @@ public interface IModule extends IBaseObject {
Map
<
String
,
Object
>
getAttrMaps
();
void
setPageSize
(
int
paramInt
);
void
setPaging
(
boolean
paramBoolean
);
void
setPage
(
int
paramInt
);
int
getPageSize
();
int
getPage
();
int
getRealIndex
(
int
paramInt
);
}
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/impl/AbstractModule.java
View file @
758f5298
...
...
@@ -33,6 +33,8 @@ public abstract class AbstractModule implements IModule, IModuleRoot {
private
String
serialNum
;
protected
transient
boolean
paging
=
false
;
private
Map
<
String
,
Object
>
attrMaps
=
new
HashMap
<>();
public
AbstractModule
()
{
...
...
@@ -212,13 +214,45 @@ public abstract class AbstractModule implements IModule, IModuleRoot {
}
}
public
void
setAttrMaps
(
Map
<
String
,
Object
>
attrMaps
)
{
this
.
attrMaps
=
attrMaps
;
}
@Override
public
Map
<
String
,
Object
>
getAttrMaps
()
{
return
attrMaps
;
}
public
void
setAttrMaps
(
Map
<
String
,
Object
>
attrMaps
)
{
this
.
attrMaps
=
attrMaps
;
@Override
public
void
setPaging
(
boolean
paging
)
{
this
.
paging
=
paging
;
}
@Override
public
void
setPageSize
(
int
paramInt
)
{
}
@Override
public
void
setPage
(
int
paramInt
)
{
}
@Override
public
int
getPageSize
()
{
return
0
;
}
@Override
public
int
getPage
()
{
return
0
;
}
@Override
public
int
getRealIndex
(
int
paramInt
)
{
return
0
;
}
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/impl/ModuleList.java
View file @
758f5298
...
...
@@ -29,6 +29,10 @@ public class ModuleList<T extends IModule> extends ArrayList<T> implements IModu
private
Class
<
T
>
dataClass
;
private
static
Field
parentField
;
private
String
moduleType
;
protected
transient
boolean
paging
=
false
;
protected
transient
int
pageSize
=
0
;
protected
transient
int
page
=
1
;
protected
transient
int
fullSize
=
-
1
;
static
{
try
{
...
...
@@ -294,7 +298,52 @@ public class ModuleList<T extends IModule> extends ArrayList<T> implements IModu
return
attrMaps
;
}
public
void
setAttrMaps
(
Map
<
String
,
Object
>
attrMaps
)
{
this
.
attrMaps
=
attrMaps
;
}
@Override
public
void
setPageSize
(
int
paramInt
)
{
this
.
pageSize
=
paramInt
;
}
@Override
public
void
setPaging
(
boolean
paging
)
{
this
.
paging
=
paging
;
}
@Override
public
void
setPage
(
int
paramInt
)
{
if
(!
this
.
paging
)
{
this
.
page
=
(
page
>=
1
)
?
((
page
<=
getPages
())
?
page
:
getPages
())
:
1
;
}
else
{
this
.
page
=
(
page
>=
1
)
?
page
:
1
;
}
}
@Override
public
int
getPageSize
()
{
return
this
.
pageSize
;
}
@Override
public
int
getPage
()
{
return
this
.
page
;
}
@Override
public
int
getRealIndex
(
int
index
)
{
if
(
this
.
pageSize
==
0
||
!
this
.
paging
)
return
index
;
return
(
this
.
page
-
1
)
*
this
.
pageSize
+
index
;
}
public
int
getPages
()
{
if
(
this
.
pageSize
<=
0
)
return
0
;
int
size
=
(
this
.
fullSize
>
0
)
?
this
.
fullSize
:
size
();
return
(
size
%
this
.
pageSize
==
0
)
?
(
size
/
this
.
pageSize
)
:
(
size
/
this
.
pageSize
+
1
);
}
}
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