1 19 20 package org.netbeans.modules.websvc.wsitmodelext.trust; 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.trust.impl.KeySizeImpl; 30 import org.netbeans.modules.websvc.wsitmodelext.trust.impl.KeyTypeImpl; 31 import org.netbeans.modules.websvc.wsitmodelext.trust.impl.TokenTypeImpl; 32 33 public class TrustFactories { 34 35 public static class TokenTypeFactory extends ElementFactory { 36 @Override 37 public Set <QName > getElementQNames() { 38 return Collections.singleton(TrustQName.TOKENTYPE.getQName()); 39 } 40 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 41 return type.cast(new TokenTypeImpl(context.getModel())); 42 } 43 @Override 44 public WSDLComponent create(WSDLComponent context, Element element) { 45 return new TokenTypeImpl(context.getModel(), element); 46 } 47 } 48 49 public static class KeyTypeFactory extends ElementFactory { 50 @Override 51 public Set <QName > getElementQNames() { 52 return Collections.singleton(TrustQName.KEYTYPE.getQName()); 53 } 54 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 55 return type.cast(new KeyTypeImpl(context.getModel())); 56 } 57 @Override 58 public WSDLComponent create(WSDLComponent context, Element element) { 59 return new KeyTypeImpl(context.getModel(), element); 60 } 61 } 62 63 public static class KeySizeFactory extends ElementFactory { 64 @Override 65 public Set <QName > getElementQNames() { 66 return Collections.singleton(TrustQName.KEYSIZE.getQName()); 67 } 68 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 69 return type.cast(new KeySizeImpl(context.getModel())); 70 } 71 @Override 72 public WSDLComponent create(WSDLComponent context, Element element) { 73 return new KeySizeImpl(context.getModel(), element); 74 } 75 } 76 } 77 | Popular Tags |