/** * Returns a binding matching the name * * @param name the binding name * @param bindable the bindable containing the binding * @return the matching binding or null if no matching one was found */ private LogicalBinding<?> getBinding(String name, Bindable bindable) { LogicalBinding<?> selectedBinding = null; for (LogicalBinding<?> binding : bindable.getBindings()) { if (name.equals(binding.getDefinition().getName())) { selectedBinding = binding; break; } } return selectedBinding; }
/** * Selects a binding from the given bindable by matching it against another binding * * @param bindable the bindable to select the binding from * @param binding the binding to match against * @return the selected binding or null if no matching ones were found */ private LogicalBinding<?> selectBinding(Bindable bindable, LogicalBinding binding) { for (LogicalBinding<?> candidate : bindable.getBindings()) { if (candidate.getDefinition().getType().equals(binding.getDefinition().getType())) { return candidate; } } return null; }
if (localName.startsWith("binding.")) { List<LogicalBinding<?>> bindings = new ArrayList<>(); for (LogicalBinding<?> binding : bindable.getBindings()) {
Bindable bindable = (Bindable) contextNode; List<LogicalBinding<?>> bindings = new ArrayList<>(); for (LogicalBinding<?> binding : bindable.getBindings()) {
private ServiceEndpointDefinition synthesizeEndpointFromClass(LogicalBinding<WsBindingDefinition> binding, JavaServiceContract contract, Class<?> serviceClass) throws GenerationException { URI targetUri; Bindable service = binding.getParent(); for (LogicalBinding<?> otherBinding : service.getBindings()) { if (binding == otherBinding) { continue; } if (WsBindingDefinition.BINDING_QNAME.equals(otherBinding.getDefinition().getType())) { // check to see if other WS bindings also use a default WsBindingDefinition wsDefinition = (WsBindingDefinition) otherBinding.getDefinition(); if (wsDefinition.getTargetUri() == null && wsDefinition.getWsdlElement() == null) { throw new GenerationException("If there is more than one web service binding, one must provide a URI or WSDLElement:" + service.getUri()); } } } targetUri = URI.create(service.getUri().getFragment()); return synthesizer.synthesizeServiceEndpoint(contract, serviceClass, targetUri); }