1 19 20 package org.netbeans.modules.xml.wsdl.model.extensions.bpel.impl; 21 22 import org.netbeans.modules.xml.schema.model.GlobalElement; 23 import org.netbeans.modules.xml.schema.model.GlobalType; 24 import org.netbeans.modules.xml.wsdl.model.Definitions; 25 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement; 26 import org.netbeans.modules.xml.wsdl.model.Message; 27 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 28 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.BPELExtensibilityComponent; 29 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.BPELQName; 30 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.CorrelationProperty; 31 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PropertyAlias; 32 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Query; 33 import org.netbeans.modules.xml.wsdl.model.spi.GenericExtensibilityElement; 34 import org.netbeans.modules.xml.xam.Component; 35 import org.netbeans.modules.xml.xam.dom.NamedComponentReference; 36 import org.w3c.dom.Element ; 37 38 45 public class PropertyAliasImpl extends GenericExtensibilityElement implements 46 PropertyAlias, ExtensibilityElement.ParentSelector 47 { 48 49 public PropertyAliasImpl( WSDLModel model, Element e ) { 50 super(model, e); 51 } 52 53 public PropertyAliasImpl( WSDLModel model ) { 54 this(model, createPrefixedElement(BPELQName.PROPERTY_ALIAS.getQName(), 55 model)); 56 } 57 58 protected String getNamespaceURI() { 59 return BPELQName.VARPROP_NS; 60 } 61 62 public NamedComponentReference<CorrelationProperty> getPropertyName() { 63 return resolveGlobalReference(CorrelationProperty.class, 64 BPELAttribute.PROPERTY_NAME); 65 } 66 67 public void setPropertyName( 68 NamedComponentReference<CorrelationProperty> property ) 69 { 70 setAttribute(PROPERTY_NAME_PROPERTY, BPELAttribute.PROPERTY_NAME, 71 property); 72 } 73 74 public NamedComponentReference<Message> getMessageType() { 75 return resolveGlobalReference(Message.class, BPELAttribute.MESSAGE_TYPE); 76 } 77 78 public void setMessageType( NamedComponentReference<Message> type ) { 79 setAttribute(MESSAGE_TYPE_PROPERTY, BPELAttribute.MESSAGE_TYPE, type); 80 } 81 82 public String getPart() { 83 return getAttribute(BPELAttribute.PART); 84 } 85 86 public void setPart( String part ) { 87 setAttribute(PART_PROPERTY, BPELAttribute.PART, part); 88 } 89 90 public Query getQuery() { 91 return getChild( Query.class ); 92 } 93 94 public void setQuery( Query query ) { 95 Query q = getQuery(); 96 if ( q!= null ){ 97 removeChild(QUERY_PROPERTY, q); 98 } 99 appendChild(QUERY_PROPERTY, query ); 100 } 101 102 public void accept( BPELExtensibilityComponent.Visitor v ) { 103 v.visit(this); 104 } 105 106 public void removeQuery() { 107 if ( getQuery()!= null ){ 108 removeChild( QUERY_PROPERTY, getQuery() ); 109 } 110 } 111 112 public void removeQuery( Query query ) { 113 if ( query!= null ){ 114 removeChild( QUERY_PROPERTY, query ); 115 } 116 } 117 118 public NamedComponentReference<GlobalType> getType() { 119 return resolveSchemaReference(GlobalType.class, BPELAttribute.TYPE); 120 } 121 122 public void setType(NamedComponentReference<GlobalType> type) { 123 setAttribute(TYPE_PROPERTY, BPELAttribute.TYPE, type); 124 } 125 126 public NamedComponentReference<GlobalElement> getElement() { 127 return resolveSchemaReference(GlobalElement.class, BPELAttribute.ELEMENT); 128 } 129 130 public void setElement( NamedComponentReference<GlobalElement> value ) { 131 setAttribute(ELEMENT_PROPERTY, BPELAttribute.ELEMENT, value); 132 } 133 134 @Override 135 public boolean canBeAddedTo(Component target) { 136 if (target instanceof Definitions) { 137 return true; 138 } 139 return false; 140 } 141 142 } | Popular Tags |