src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/Parameter.java

Thu, 31 Aug 2017 15:18:52 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:18:52 +0800
changeset 637
9c07ef4934dd
parent 368
0989ad8c0860
parent 0
373ffda63c9a
permissions
-rw-r--r--

merge

     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.internal.ws.processor.model;
    28 import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
    29 import com.sun.tools.internal.ws.wsdl.framework.Entity;
    30 import com.sun.tools.internal.ws.wsdl.document.MessagePart;
    32 import javax.jws.WebParam.Mode;
    33 import java.util.ArrayList;
    34 import java.util.List;
    36 /**
    37  *
    38  * @author WS Development Team
    39  */
    40 public class Parameter extends ModelObject {
    41     private final String entityName;
    43     public Parameter(String name, Entity entity) {
    44         super(entity);
    45         this.name = name;
    46         if(entity instanceof com.sun.tools.internal.ws.wsdl.document.Message){
    47             this.entityName = ((com.sun.tools.internal.ws.wsdl.document.Message)entity).getName();
    48         }else if(entity instanceof MessagePart){
    49             this.entityName = ((MessagePart)entity).getName();
    50         }else{
    51             this.entityName = name;
    52         }
    54     }
    57     public String getEntityName() {
    58         return entityName;
    59     }
    61     public String getName() {
    62         return name;
    63     }
    65     public void setName(String s) {
    66         name = s;
    67     }
    69     public JavaParameter getJavaParameter() {
    70         return javaParameter;
    71     }
    73     public void setJavaParameter(JavaParameter p) {
    74         javaParameter = p;
    75     }
    77     public AbstractType getType() {
    78         return type;
    79     }
    81     public void setType(AbstractType t) {
    82         type = t;
    83     }
    85     public String getTypeName() {
    86         return typeName;
    87     }
    89     public void setTypeName(String t) {
    90         typeName = t;
    91     }
    93     public Block getBlock() {
    94         return block;
    95     }
    97     public void setBlock(Block d) {
    98         block = d;
    99     }
   101     public Parameter getLinkedParameter() {
   102         return link;
   103     }
   105     public void setLinkedParameter(Parameter p) {
   106         link = p;
   107     }
   109     public boolean isEmbedded() {
   110         return embedded;
   111     }
   113     public void setEmbedded(boolean b) {
   114         embedded = b;
   115     }
   117     public void accept(ModelVisitor visitor) throws Exception {
   118         visitor.visit(this);
   119     }
   121     private String name;
   122     private JavaParameter javaParameter;
   123     private AbstractType type;
   124     private Block block;
   125     private Parameter link;
   126     private boolean embedded;
   127     private String typeName;
   128     private String customName;
   129     private Mode mode;
   131     public int getParameterIndex() {
   132         return parameterOrderPosition;
   133     }
   135     public void setParameterIndex(int parameterOrderPosition) {
   136         this.parameterOrderPosition = parameterOrderPosition;
   137     }
   139     public boolean isReturn(){
   140         return (parameterOrderPosition == -1);
   141     }
   143     // 0 is the first parameter, -1 is the return type
   144     private int parameterOrderPosition;
   145     /**
   146      * @return Returns the customName.
   147      */
   148     public String getCustomName() {
   149         return customName;
   150     }
   151     /**
   152      * @param customName The customName to set.
   153      */
   154     public void setCustomName(String customName) {
   155         this.customName = customName;
   156     }
   158     private List<String> annotations = new ArrayList<String>();
   160     /**
   161      * @return Returns the annotations.
   162      */
   163     public List<String> getAnnotations() {
   164         return annotations;
   165     }
   168     /**
   169      * @param annotations The annotations to set.
   170      */
   171     public void setAnnotations(List<String> annotations) {
   172         this.annotations = annotations;
   173     }
   175     public void setMode(Mode mode){
   176         this.mode = mode;
   177     }
   179     public boolean isIN(){
   180         return (mode == Mode.IN);
   181     }
   183     public boolean isOUT(){
   184         return (mode == Mode.OUT);
   185     }
   187     public boolean isINOUT(){
   188         return (mode == Mode.INOUT);
   189     }
   193 }

mercurial