Search in sources :

Example 1 with CustomizableOutline

use of com.sun.tools.xjc.outline.CustomizableOutline in project jaxb-ri by eclipse-ee4j.

the class PluginImpl method checkAndInject.

private static void checkAndInject(Collection<? extends CustomizableOutline> outlines) {
    for (CustomizableOutline co : outlines) {
        CPluginCustomization c = co.getTarget().getCustomizations().find(Const.NS, "code");
        if (c == null)
            // no customization --- nothing to inject here
            continue;
        c.markAsAcknowledged();
        // TODO: ideally you should validate this DOM element to make sure
        // that there's no typo/etc. JAXP 1.3 can do this very easily.
        String codeFragment = DOMUtils.getElementText(c.element);
        // inject the specified code fragment into the implementation class.
        co.getImplClass().direct(codeFragment);
    }
}
Also used : CustomizableOutline(com.sun.tools.xjc.outline.CustomizableOutline) CPluginCustomization(com.sun.tools.xjc.model.CPluginCustomization)

Aggregations

CPluginCustomization (com.sun.tools.xjc.model.CPluginCustomization)1 CustomizableOutline (com.sun.tools.xjc.outline.CustomizableOutline)1