1 19 20 package org.netbeans.modules.websvc.wsitmodelext.addressing; 21 22 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.*; 23 import org.netbeans.modules.xml.wsdl.model.WSDLComponent; 24 import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory; 25 import org.w3c.dom.Element ; 26 27 import javax.xml.namespace.QName ; 28 import java.util.Collections ; 29 import java.util.Set ; 30 31 32 public class AddressingFactories { 33 34 public static class EndpointReferenceFactory extends ElementFactory { 35 @Override 36 public Set <QName > getElementQNames() { 37 return Collections.singleton(AddressingQName.ENDPOINTREFERENCE.getQName()); 38 } 39 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 40 return type.cast(new EndpointReferenceImpl(context.getModel())); 41 } 42 43 @Override 44 public WSDLComponent create(WSDLComponent context, Element element) { 45 return new EndpointReferenceImpl(context.getModel(), element); 46 } 47 } 48 49 public static class AddressFactory extends ElementFactory { 50 @Override 51 public Set <QName > getElementQNames() { 52 return Collections.singleton(AddressingQName.ADDRESS.getQName()); 53 } 54 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 55 return type.cast(new AddressImpl(context.getModel())); 56 } 57 58 @Override 59 public WSDLComponent create(WSDLComponent context, Element element) { 60 return new AddressImpl(context.getModel(), element); 61 } 62 } 63 64 public static class AddressingServiceNameFactory extends ElementFactory { 65 @Override 66 public Set <QName > getElementQNames() { 67 return Collections.singleton(AddressingQName.SERVICENAME.getQName()); 68 } 69 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 70 return type.cast(new AddressingServiceNameImpl(context.getModel())); 71 } 72 73 @Override 74 public WSDLComponent create(WSDLComponent context, Element element) { 75 return new AddressingServiceNameImpl(context.getModel(), element); 76 } 77 } 78 79 public static class AddressingPortTypeFactory extends ElementFactory { 80 @Override 81 public Set <QName > getElementQNames() { 82 return Collections.singleton(AddressingQName.PORTTYPE.getQName()); 83 } 84 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 85 return type.cast(new AddressingPortTypeImpl(context.getModel())); 86 } 87 88 @Override 89 public WSDLComponent create(WSDLComponent context, Element element) { 90 return new AddressingPortTypeImpl(context.getModel(), element); 91 } 92 } 93 94 public static class ReferenceParametersFactory extends ElementFactory { 95 @Override 96 public Set <QName > getElementQNames() { 97 return Collections.singleton(AddressingQName.REFERENCEPARAMETERS.getQName()); 98 } 99 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 100 return type.cast(new ReferenceParametersImpl(context.getModel())); 101 } 102 103 @Override 104 public WSDLComponent create(WSDLComponent context, Element element) { 105 return new ReferenceParametersImpl(context.getModel(), element); 106 } 107 } 108 109 public static class ReferencePropertiesFactory extends ElementFactory { 110 @Override 111 public Set <QName > getElementQNames() { 112 return Collections.singleton(AddressingQName.REFERENCEPROPERTIES.getQName()); 113 } 114 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 115 return type.cast(new ReferencePropertiesImpl(context.getModel())); 116 } 117 118 @Override 119 public WSDLComponent create(WSDLComponent context, Element element) { 120 return new ReferencePropertiesImpl(context.getModel(), element); 121 } 122 } 123 124 } 125 | Popular Tags |