Package play.modules.gtengineplugin.gt_integration

Source Code of play.modules.gtengineplugin.gt_integration.GTTagContextBridge$GTTagContextInfoBridge

package play.modules.gtengineplugin.gt_integration;

import play.template2.GTTagContext;
import play.templates.TagContext;

import java.util.Map;

// Briding so that it is the TagContext-impl in play 1 that is the master one..
public class GTTagContextBridge extends GTTagContext {

    public static class GTTagContextInfoBridge implements GTTagContextInfo {
        private final TagContext real;

        public GTTagContextInfoBridge(TagContext real) {
            this.real = real;
        }

        @Override
        public String getTagName() {
            return real.tagName;
        }

        @Override
        public Map<String, Object> getData() {
            return real.data;
        }
    }

    @Override
    public void init() {
        TagContext.init();
    }

    @Override
    public void enterTag(String name) {
        TagContext.enterTag(name);
    }

    @Override
    public void exitTag() {
        TagContext.exitTag();
    }

    @Override
    public GTTagContextInfo current() {
        TagContext org = TagContext.current();
        return new GTTagContextInfoBridge(org);
    }

    @Override
    public GTTagContextInfo parent() {
        TagContext org = TagContext.parent();
        return new GTTagContextInfoBridge(org);
    }

    @Override
    public boolean hasParentTag(String name) {
        return TagContext.hasParentTag(name);
    }

    @Override
    public GTTagContextInfo parent(String name) {
        TagContext org = TagContext.parent(name);
        return new GTTagContextInfoBridge(org);
    }
}
TOP

Related Classes of play.modules.gtengineplugin.gt_integration.GTTagContextBridge$GTTagContextInfoBridge

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.