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.xsltmap;
020:
021: import org.netbeans.modules.xml.axi.AXIComponent;
022: import org.netbeans.modules.xml.wsdl.model.Message;
023: import org.netbeans.modules.xml.wsdl.model.Operation;
024: import org.netbeans.modules.xml.wsdl.model.OperationParameter;
025: import org.netbeans.modules.xml.xam.dom.NamedComponentReference;
026: import org.netbeans.modules.xslt.tmap.util.Util;
027: import org.openide.filesystems.FileObject;
028:
029: /**
030: *
031: * @author Vitaly Bychkov
032: * @version 1.0
033: */
034: public class OutputTransformationDesc extends
035: AbstractTransformationDesc {
036:
037: public OutputTransformationDesc(XsltMapModel model,
038: TransformationUC parent) {
039: super (model, parent);
040: }
041:
042: public TransformationDescType getType() {
043: return TransformationDescType.OUTPUT;
044: }
045:
046: public AXIComponent getTargetAXIType(FileObject projectRoot) {
047: TransformationUC tUC = getParent();
048: if (tUC == null) {
049: return null;
050: }
051:
052: InputTransformationDesc itDesc = tUC
053: .getInputTransformationDesc();
054: return itDesc == null ? null : itDesc
055: .getPltTargetAXIType(projectRoot);
056: }
057:
058: public AXIComponent getSourceAXIType(FileObject projectRoot) {
059: return getPltTargetAXIType(projectRoot);
060: }
061:
062: public void setMessageType(String messageType) {
063: if (isFilterRequestReply()) {
064: super .setMessageType(messageType);
065: }
066: }
067:
068: public void setFile(String file) {
069: if (isFilterRequestReply()) {
070: super .setFile(file);
071: }
072: }
073:
074: public void setTransformJBI(boolean transformJBI) {
075: if (isFilterRequestReply()) {
076: super .setTransformJBI(transformJBI);
077: }
078: }
079:
080: public void setTransformJBI(String transformJBI) {
081: if (isFilterRequestReply()) {
082: super .setTransformJBI(transformJBI);
083: }
084: }
085:
086: public void setMessageType(Operation inputOperation,
087: Operation outputOperation) {
088: TransformationUC tUC = getParent();
089: if (tUC == null
090: || (inputOperation == null && outputOperation == null)) {
091: return;
092: }
093:
094: String messageType = Util.getMessageType(inputOperation, false);
095:
096: setMessageType(messageType);
097: }
098:
099: private boolean isFilterRequestReply() {
100: TransformationUC tUC = getParent();
101: return tUC != null
102: && TransformationType.FILTER_REQUEST_REPLY.equals(tUC
103: .getTransformationType());
104: }
105: }
|