Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Refactored DebugRecursivelyLmlAttribute to use anonymous class. Close #…
Browse files Browse the repository at this point in the history
  • Loading branch information
czyzby committed Dec 5, 2016
1 parent ba8ac44 commit 2563d51
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,20 @@
*
* @author MJ */
public class DebugRecursivelyLmlAttribute implements LmlAttribute<Group> {
private static class DebugAction implements ActorConsumer<Object, Object> {
private boolean value;

private DebugAction(boolean value) {
this.value = value;
}

@Override
public Object consume(Object actor) {
((Group) actor).setDebug(value, true);
return null;
}
}

@Override
public Class<Group> getHandledType() {
return Group.class;
}

@Override
public void process(final LmlParser parser, final LmlTag tag, final Group actor, final String rawAttributeData) {
LmlUtilities.getLmlUserObject(actor).addOnCloseAction(new DebugAction(parser.parseBoolean(rawAttributeData)));
final boolean debugRecursively = parser.parseBoolean(rawAttributeData, actor);
LmlUtilities.getLmlUserObject(actor).addOnCloseAction(new ActorConsumer<Void, Object>() {
@Override
public Void consume(Object widget) {
actor.setDebug(debugRecursively, true);
return null;
}
});
}
}

0 comments on commit 2563d51

Please sign in to comment.