1 19 20 package org.netbeans.modules.websvc.wsitmodelext.tx; 21 22 import org.netbeans.modules.xml.wsdl.model.WSDLComponent; 23 import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory; 24 import org.w3c.dom.Element ; 25 26 import javax.xml.namespace.QName ; 27 import java.util.Collections ; 28 import java.util.Set ; 29 import org.netbeans.modules.websvc.wsitmodelext.tx.impl.ATAlwaysCapabilityImpl; 30 import org.netbeans.modules.websvc.wsitmodelext.tx.impl.ATAssertionImpl; 31 32 public class TxFactories { 33 34 public static class ATAssertionFactory extends ElementFactory { 35 @Override 36 public Set <QName > getElementQNames() { 37 return Collections.singleton(TxQName.ATASSERTION.getQName()); 38 } 39 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 40 return type.cast(new ATAssertionImpl(context.getModel())); 41 } 42 @Override 43 public WSDLComponent create(WSDLComponent context, Element element) { 44 return new ATAssertionImpl(context.getModel(), element); 45 } 46 } 47 48 public static class ATAlwaysCapabilityFactory extends ElementFactory { 49 @Override 50 public Set <QName > getElementQNames() { 51 return Collections.singleton(TxQName.ATALWAYSCAPABILITY.getQName()); 52 } 53 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 54 return type.cast(new ATAlwaysCapabilityImpl(context.getModel())); 55 } 56 @Override 57 public WSDLComponent create(WSDLComponent context, Element element) { 58 return new ATAlwaysCapabilityImpl(context.getModel(), element); 59 } 60 } 61 62 } 63 | Popular Tags |