All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.glassfish.admingui.connector.TOCInjector Maven / Gradle / Ivy

There is a newer version: 4.1.2.181
Show newest version

package org.glassfish.admingui.connector;

import java.util.ArrayList;
import java.util.List;
import org.jvnet.hk2.annotations.Service;
import org.jvnet.hk2.config.ConfigInjector;
import org.jvnet.hk2.config.Dom;
import org.jvnet.hk2.config.InjectionTarget;

@Service(name = "toc", metadata = "target=org.glassfish.admingui.connector.TOC,=collection:org.glassfish.admingui.connector.TOCItem,@version=required,@version=datatype:java.lang.String,@version=leaf")
@InjectionTarget(TOC.class)
public class TOCInjector
    extends ConfigInjector
{


    public void inject(Dom dom, TOC target) {
        element_setTOCItems(dom, target);
        attribute_setVersion(dom, target);
    }

    public void injectAttribute(Dom dom, String name, TOC target) {
        if ("version".equals(name)) {
            attribute_setVersion(dom, target);
        }
    }

    public void injectElement(Dom dom, String name, TOC target) {
        if ("tocitem".equals(name)) {
            element_setTOCItems(dom, target);
        }
    }

    public void element_setTOCItems(Dom dom, TOC target) {
        List v1 = dom.nodeElements("tocitem");
        if (v1 == null) {
            return ;
        }
        List v2 = new ArrayList(v1 .size());
        for (Dom v3 : v1) {
            v2 .add(((org.glassfish.admingui.connector.TOCItem) v3 .get()));
        }
        target.setTOCItems(v2);
    }

    public void attribute_setVersion(Dom dom, TOC target) {
        String v1 = dom.attribute("version");
        target.setVersion(v1);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy