Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
5964bc4f
Commit
5964bc4f
authored
May 07, 2015
by
Björn Richerzhagen
Browse files
Allowed IfEqualStr-Tags as first-level elements
parent
f9c0399c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/scenario/DefaultConfigurator.java
View file @
5964bc4f
...
...
@@ -296,10 +296,31 @@ public class DefaultConfigurator implements Configurator {
* @return configured component
*/
public
Object
configureComponent
(
Element
elem
)
{
String
name
=
elem
.
getName
();
if
(
Configurator
.
SPECIAL_IF_EQUAL_STR
.
equalsIgnoreCase
(
name
))
{
processIfEqualStr
(
elem
,
new
ToConfigureCallback
()
{
@Override
public
void
run
(
Element
elemToConfigure
)
{
configureComponent
(
elemToConfigure
);
}
});
return
null
;
}
if
(
Configurator
.
SPECIAL_IF_NOT_EQUAL_STR
.
equalsIgnoreCase
(
name
))
{
processIfNotEqualStr
(
elem
,
new
ToConfigureCallback
()
{
@Override
public
void
run
(
Element
elemToConfigure
)
{
configureComponent
(
elemToConfigure
);
}
});
return
null
;
}
Monitor
.
log
(
DefaultConfigurator
.
class
,
Level
.
DEBUG
,
"Configure component "
+
elem
.
getN
ame
()
);
Object
component
=
configurables
.
get
(
elem
.
getN
ame
()
);
"Configure component "
+
n
ame
);
Object
component
=
configurables
.
get
(
n
ame
);
// register new component (if not done yet)
Set
<
String
>
consAttrs
=
new
HashSet
<
String
>();
// attributes that were
// part of the
...
...
@@ -313,7 +334,7 @@ public class DefaultConfigurator implements Configurator {
Monitor
.
log
(
DefaultConfigurator
.
class
,
Level
.
INFO
,
"Configure component "
+
component
.
getClass
().
getSimpleName
()
+
" with element "
+
elem
.
getN
ame
()
);
+
n
ame
);
configureAttributes
(
component
,
elem
,
consAttrs
);
// configure subcomponents
if
(
component
instanceof
Builder
)
{
...
...
@@ -332,7 +353,7 @@ public class DefaultConfigurator implements Configurator {
}
else
{
// component cannot be created and has not been registered
Monitor
.
log
(
DefaultConfigurator
.
class
,
Level
.
WARN
,
"Skip element "
+
elem
.
getN
ame
()
);
+
n
ame
);
}
return
component
;
}
...
...
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