@Override public Element refineWSDLTarget(Element target){ // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); if(JAXWSBindings==null) // none exists. need to make one JAXWSBindings = insertJAXWSBindingsElement(target, "bindings" ); return JAXWSBindings; }
/** * 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 ); } }
/** * Moves JAXWS customizations under their respective target nodes. */ private void insertBinding(@NotNull Element bindings, @NotNull Node target) { if ("bindings".equals(bindings.getLocalName())) { Element[] children = DOMUtils.getChildElements(bindings); for (Element item : children) { if ("bindings".equals(item.getLocalName())) { //done } else { moveUnder(item, (Element) target); } } } else { moveUnder(bindings, (Element) target); } }
if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) { Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types"); if (type != null) { for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) { if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) { schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS);
/** * Moves JAXWS customizations under their respective target nodes. */ private void insertBinding(@NotNull Element bindings, @NotNull Node target) { if ("bindings".equals(bindings.getLocalName())) { Element[] children = DOMUtils.getChildElements(bindings); for (Element item : children) { if ("bindings".equals(item.getLocalName())) { //done } else { moveUnder(item, (Element) target); } } } else { moveUnder(bindings, (Element) target); } }
if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) { Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types"); if (type != null) { for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) { if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) { schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS);
/** * Moves JAXWS customizations under their respective target nodes. */ private void insertBinding(@NotNull Element bindings, @NotNull Node target) { if ("bindings".equals(bindings.getLocalName())) { Element[] children = DOMUtils.getChildElements(bindings); for (Element item : children) { if ("bindings".equals(item.getLocalName())) { //done } else { moveUnder(item, (Element) target); } } } else { moveUnder(bindings, (Element) target); } }
@Override public Element refineWSDLTarget(Element target){ // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); if(JAXWSBindings==null) // none exists. need to make one JAXWSBindings = insertJAXWSBindingsElement(target, "bindings" ); return JAXWSBindings; }
if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) { Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types"); if (type != null) { for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) { if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) { schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS);
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; } }
/** * Moves JAXWS customizations under their respective target nodes. */ private void insertBinding(@NotNull Element bindings, @NotNull Node target) { if ("bindings".equals(bindings.getLocalName())) { Element[] children = DOMUtils.getChildElements(bindings); for (Element item : children) { if ("bindings".equals(item.getLocalName())) { //done } else { moveUnder(item, (Element) target); } } } else { moveUnder(bindings, (Element) target); } }
public Element refineWSDLTarget(Element target) { // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); if (JAXWSBindings == null) { // none exists. need to make one JAXWSBindings = insertJAXWSBindingsElement(target, "bindings"); } return JAXWSBindings; }
if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) { Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types"); if (type != null) { for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) { if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) { schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS);
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; } }
/** * Copies location information attached to the "src" node to the "dst" node. */ private void copyLocators( Element src, Element dst ) { forest.locatorTable.storeStartLocation( dst, forest.locatorTable.getStartLocation(src) ); forest.locatorTable.storeEndLocation( dst, forest.locatorTable.getEndLocation(src) ); // recursively process child elements Element[] srcChilds = DOMUtils.getChildElements(src); Element[] dstChilds = DOMUtils.getChildElements(dst); for( int i=0; i<srcChilds.length; i++ ) copyLocators( srcChilds[i], dstChilds[i] ); }
public Element refineWSDLTarget(Element target) { // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); if (JAXWSBindings == null) { // none exists. need to make one JAXWSBindings = insertJAXWSBindingsElement(target, "bindings"); } return JAXWSBindings; }
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); } } }
/** * Copies location information attached to the "src" node to the "dst" node. */ private void copyLocators( Element src, Element dst ) { forest.locatorTable.storeStartLocation( dst, forest.locatorTable.getStartLocation(src) ); forest.locatorTable.storeEndLocation( dst, forest.locatorTable.getEndLocation(src) ); // recursively process child elements Element[] srcChilds = DOMUtils.getChildElements(src); Element[] dstChilds = DOMUtils.getChildElements(dst); for( int i=0; i<srcChilds.length; i++ ) copyLocators( srcChilds[i], dstChilds[i] ); }
public Element refineWSDLTarget(Element target) { // look for existing xs:annotation Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings"); if (JAXWSBindings == null) { // none exists. need to make one JAXWSBindings = insertJAXWSBindingsElement(target, "bindings"); } return JAXWSBindings; }
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); } } }