Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
riseclipse-validator-scl2003
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RiseClipseGroup
riseclipse-validator-scl2003
Commits
b18bf0f8
Commit
b18bf0f8
authored
5 years ago
by
Dominique Marcadet
Browse files
Options
Downloads
Patches
Plain Diff
simplify initializeValidationData()
parent
d6cf4c78
No related branches found
No related tags found
1 merge request
!11
Resolve "complete validation by NSD"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/NsdEObjectValidator.java
+8
-33
8 additions, 33 deletions
...lipse/iec61850/scl/validator/nsd/NsdEObjectValidator.java
with
8 additions
and
33 deletions
fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/NsdEObjectValidator.java
+
8
−
33
View file @
b18bf0f8
...
...
@@ -29,7 +29,6 @@ import org.eclipse.emf.ecore.EClass;
import
org.eclipse.emf.ecore.EDataType
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.EValidator
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClass
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl
;
import
fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN
;
import
fr.centralesupelec.edf.riseclipse.iec61850.scl.DA
;
...
...
@@ -43,45 +42,21 @@ import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
public
class
NsdEObjectValidator
implements
EValidator
{
private
NsdResourceSetImpl
nsdResourceSet
;
private
HashMap
<
String
,
AnyLNValidator
>
anyLNValidatorMap
;
private
HashMap
<
String
,
LNodeTypeValidator
>
lNodeTypeValidatorMap
;
private
HashMap
<
String
,
AnyLNValidator
>
anyLNValidatorMap
=
new
HashMap
<>()
;
private
HashMap
<
String
,
LNodeTypeValidator
>
lNodeTypeValidatorMap
=
new
HashMap
<>()
;
public
NsdEObjectValidator
(
NsdResourceSetImpl
nsdResourceSet
)
{
this
.
nsdResourceSet
=
nsdResourceSet
;
}
public
void
initializeValidationData
()
{
this
.
anyLNValidatorMap
=
nsdResourceSet
.
getLNClassStream
()
.
map
(
lnClass
->
generateAnyLNValidators
(
lnClass
)
)
.
reduce
(
(
a
,
b
)
->
{
a
.
putAll
(
b
);
return
a
;
}
)
.
orElse
(
new
HashMap
<>()
);
this
.
lNodeTypeValidatorMap
=
nsdResourceSet
.
getLNClassStream
()
.
map
(
lnClass
->
generateLNodeTypeValidators
(
lnClass
)
)
.
reduce
(
(
a
,
b
)
->
{
a
.
putAll
(
b
);
return
a
;
}
)
.
orElse
(
new
HashMap
<>()
);
}
private
HashMap
<
String
,
AnyLNValidator
>
generateAnyLNValidators
(
LNClass
lnClass
)
{
HashMap
<
String
,
AnyLNValidator
>
lnMap
=
new
HashMap
<>();
lnMap
.
put
(
lnClass
.
getName
(),
new
AnyLNValidator
(
lnClass
));
return
lnMap
;
}
nsdResourceSet
.
getLNClassStream
()
.
forEach
(
lnClass
->
anyLNValidatorMap
.
put
(
lnClass
.
getName
(),
new
AnyLNValidator
(
lnClass
)));
private
HashMap
<
String
,
LNodeTypeValidator
>
generateLNodeTypeValidators
(
LNClass
lnClass
)
{
HashMap
<
String
,
LNodeTypeValidator
>
lntMap
=
new
HashMap
<>();
lntMap
.
put
(
lnClass
.
getName
(),
new
LNodeTypeValidator
(
lnClass
));
return
lntMap
;
nsdResourceSet
.
getLNClassStream
()
.
forEach
(
lnClass
->
lNodeTypeValidatorMap
.
put
(
lnClass
.
getName
(),
new
LNodeTypeValidator
(
lnClass
)));
}
@Override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment