001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019: package org.netbeans.modules.xslt.tmap.model.impl;
020:
021: import org.netbeans.modules.xml.wsdl.model.Operation;
022: import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PartnerLinkType;
023: import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Role;
024: import org.netbeans.modules.xml.xam.Reference;
025: import org.netbeans.modules.xslt.tmap.model.api.BooleanType;
026: import org.netbeans.modules.xslt.tmap.model.api.Invoke;
027: import org.netbeans.modules.xslt.tmap.model.api.TMapAttributes;
028: import org.netbeans.modules.xslt.tmap.model.api.TMapVisitor;
029: import org.netbeans.modules.xslt.tmap.model.api.TransformerDescriptor;
030: import org.netbeans.modules.xslt.tmap.model.api.Variable;
031: import org.netbeans.modules.xslt.tmap.model.api.WSDLReference;
032: import org.w3c.dom.Element;
033:
034: /**
035: *
036: * @author Vitaly Bychkov
037: * @version 1.0
038: */
039: public class InvokeImpl extends TMapComponentAbstract implements Invoke {
040:
041: public InvokeImpl(TMapModelImpl model) {
042: this (model, createNewElement(TMapComponents.INVOKE, model));
043: }
044:
045: public InvokeImpl(TMapModelImpl model, Element element) {
046: super (model, element);
047: }
048:
049: public void accept(TMapVisitor visitor) {
050: visitor.visit(this );
051: }
052:
053: public WSDLReference<PartnerLinkType> getPartnerLinkType() {
054: return getWSDLReference(TMapAttributes.PARTNER_LINK_TYPE,
055: PartnerLinkType.class);
056: }
057:
058: public void setPartnerLinkType(WSDLReference<PartnerLinkType> pltRef) {
059: setWSDLReference(TMapAttributes.PARTNER_LINK_TYPE, pltRef);
060: }
061:
062: public WSDLReference<Role> getRole() {
063: return getWSDLReference(TMapAttributes.ROLE_NAME, Role.class);
064: }
065:
066: public void setRole(WSDLReference<Role> roleRef) {
067: setWSDLReference(TMapAttributes.ROLE_NAME, roleRef);
068: }
069:
070: public Reference[] getReferences() {
071: return new Reference[] { getPartnerLinkType(), getRole(),
072: getOperation() };
073: }
074:
075: public Reference<Operation> getOperation() {
076: return getWSDLReference(TMapAttributes.OPERATION_NAME,
077: Operation.class);
078: }
079:
080: public void setOperation(WSDLReference<Operation> opRef) {
081: setWSDLReference(TMapAttributes.OPERATION_NAME, opRef);
082: }
083:
084: public String getFile() {
085: return getAttribute(TMapAttributes.FILE);
086: }
087:
088: public void setFile(String locationURI) {
089: setAttribute(TransformerDescriptor.FILE, TMapAttributes.FILE,
090: locationURI);
091: }
092:
093: public BooleanType isTransformJbi() {
094: return BooleanType
095: .parseBooleanType(getAttribute(TMapAttributes.TRANSFORM_JBI));
096: }
097:
098: public void setTransformJbi(BooleanType boolVal) {
099: setAttribute(TransformerDescriptor.TRANSFORM_JBI,
100: TMapAttributes.TRANSFORM_JBI, boolVal);
101: }
102:
103: public Class<Invoke> getComponentType() {
104: return Invoke.class;
105: }
106:
107: public Variable getInputVariable() {
108: String varName = getAttribute(TMapAttributes.INPUT_VARIABLE);
109:
110: Variable var = varName == null ? null : new InputVariableImpl(
111: getModel(), varName, this );
112: return var;
113: }
114:
115: public void setInputVariableName(String inputVariable) {
116: setAttribute(INPUT_VARIABLE, TMapAttributes.INPUT_VARIABLE,
117: inputVariable);
118: }
119:
120: public Variable getOutputVariable() {
121: String varName = getAttribute(TMapAttributes.OUTPUT_VARIABLE);
122:
123: Variable var = varName == null ? null : new OutputVariableImpl(
124: getModel(), varName, this );
125: return var;
126: }
127:
128: public void setOutputVariableName(String outputVariable) {
129: setAttribute(OUTPUT_VARIABLE, TMapAttributes.OUTPUT_VARIABLE,
130: outputVariable);
131: }
132: }
|