/** * Utility method to return the Element's text without importing DOMUtils * from jaxb - allowing us to also use our own DOMUtils class * * @param element Element * @return String content of Element */ protected static String getElementText( final Element element ) { return DOMUtils.getElementText( element ); } }
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here 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.implClass.direct(codeFragment); } return true; } }
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { for( ClassOutline co : model.getClasses() ) { CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); if(c==null) continue; // no customization --- nothing to inject here 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.implClass.direct(codeFragment); } return true; } }
private static void checkAndInject(Collection<? extends CustomizableOutline> outlines) { for (CustomizableOutline co : outlines) { CPluginCustomization c = co.getTarget().getCustomizations().find(Const.NS, "code"); if(c==null) continue; // no customization --- nothing to inject here 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); } } }
private static void checkAndInject(Collection<? extends CustomizableOutline> outlines) { for (CustomizableOutline co : outlines) { CPluginCustomization c = co.getTarget().getCustomizations().find(Const.NS, "code"); if(c==null) continue; // no customization --- nothing to inject here 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); } } }
private static void checkAndInject(Collection<? extends CustomizableOutline> outlines) { for (CustomizableOutline co : outlines) { CPluginCustomization c = co.getTarget().getCustomizations().find(Const.NS, "code"); if(c==null) continue; // no customization --- nothing to inject here 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); } } }