FileDocCategorySizeDatePackage
ParameterDesc.javaAPI DocApache Axis 1.411615Sat Apr 22 18:57:28 BST 2006org.apache.axis.description

ParameterDesc

public class ParameterDesc extends Object implements Serializable
A Parameter descriptor, collecting the interesting info about an operation parameter. (mostly taken from org.apache.axis.wsdl.toJava.Parameter right now)
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
public static final byte
IN
public static final byte
OUT
public static final byte
INOUT
private transient QName
name
The Parameter's XML QName
public org.apache.axis.wsdl.symbolTable.TypeEntry
typeEntry
A TypeEntry corresponding to this parameter
private byte
mode
The Parameter mode (in, out, inout)
private QName
typeQName
The XML type of this parameter
private Class
javaType
The Java type of this parameter
private int
order
The order of this parameter (-1 indicates unordered)
private boolean
isReturn
Indicates if this ParameterDesc represents a return or normal parameter
private String
mimeType
MIME type for this parameter, if there is one
private QName
itemQName
If this ParamDesc represents a literal array, this QName will determine if it gets written as a "bare" or a "wrapped" schema.
private QName
itemType
private boolean
inHeader
Indicates whether input/output values are stored in the header
private boolean
outHeader
private String
documentation
The documentation for the parameter
private boolean
omittable
Indicates whether this parameter may be omitted or not (i.e., it has minOccurs="0")
private boolean
nillable
Indicates whether this parameter is nillable
Constructors Summary
public ParameterDesc()


      
    
public ParameterDesc(ParameterDesc copy)
Constructor-copy

param
copy the copy

        name = copy.name;
        typeEntry = copy.typeEntry;
        mode = copy.mode;
        typeQName = copy.typeQName;
        javaType = copy.javaType;
        order = copy.order;
        isReturn = copy.isReturn;
        mimeType = copy.mimeType;
        inHeader = copy.inHeader;
        outHeader = copy.outHeader;
    
public ParameterDesc(QName name, byte mode, QName typeQName)
Constructor

param
name the parameter's fully qualified XML name
param
mode IN, OUT, INOUT
param
typeQName the parameter's XML type QName

        this.name = name;
        this.mode = mode;
        this.typeQName = typeQName;
    
public ParameterDesc(QName name, byte mode, QName typeQName, Class javaType, boolean inHeader, boolean outHeader)
"Complete" constructor, suitable for usage in skeleton code

param
name the parameter's fully qualified XML name
param
mode IN, OUT, INOUT
param
typeQName the parameter's XML type QName
param
javaType the parameter's javaType
param
inHeader does this parameter go into the input message header?
param
outHeader does this parameter go into the output message header?

        this(name,mode,typeQName);
        this.javaType = javaType;
        this.inHeader = inHeader;
        this.outHeader = outHeader;
    
public ParameterDesc(QName name, byte mode, QName typeQName, Class javaType)

deprecated
param
name the parameter's fully qualified XML name
param
mode IN, OUT, INOUT
param
typeQName the parameter's XML type QName
param
javaType the parameter's javaType

      this(name,mode,typeQName,javaType,false,false);
    
Methods Summary
public java.lang.StringgetDocumentation()
get the documentation for the parameter

    	return documentation;
    
public booleangetIsReturn()
Indicates ParameterDesc represents return of OperationDesc

return
true if return parameter of OperationDesc

        return isReturn;
    
public javax.xml.namespace.QNamegetItemQName()

        return itemQName;
    
public javax.xml.namespace.QNamegetItemType()

        return itemType;
    
public java.lang.ClassgetJavaType()
Get the java type (note that this is javaType in the signature.)

return
Class javaType

        return javaType;
    
public bytegetMode()

        return mode;
    
public static java.lang.StringgetModeAsString(byte mode)

        if (mode == INOUT) {
            return "inout";
        } else if (mode == OUT) {
            return "out";
        } else if (mode == IN) {
            return "in";
        }

        throw new IllegalArgumentException(
                Messages.getMessage("badParameterMode", Byte.toString(mode)));
    
public java.lang.StringgetName()

        if (name == null) {
            return null;
        }
        else {
            return name.getLocalPart();
        }
    
public intgetOrder()

        return order;
    
public javax.xml.namespace.QNamegetQName()

        return name;
    
public javax.xml.namespace.QNamegetTypeQName()

        return typeQName;
    
public booleanisInHeader()

        return this.inHeader;
    
public booleanisNillable()
Indicates whether this parameter is nillable or not.

return
whether this parameter is nillable

        return nillable;
    
public booleanisOmittable()
Indicates if this parameter is omittable or not (i.e., if it has a minimum occurrence of 0).

return
true iff the parameter may be omitted in the request

        return omittable;
    
public booleanisOutHeader()

        return this.outHeader;
    
public static bytemodeFromString(java.lang.String modeStr)
Get a mode constant from a string. Defaults to IN, and returns OUT or INOUT if the string matches (ignoring case).

        byte ret = IN;
        if (modeStr == null) {
            return IN;
        } else if (modeStr.equalsIgnoreCase("out")) {
            ret = OUT;
        } else if (modeStr.equalsIgnoreCase("inout")) {
            ret = INOUT;
        }
        return ret;
    
private voidreadObject(java.io.ObjectInputStream in)

        if (in.readBoolean()) {
            name = new QName((String)in.readObject(),
                             (String)in.readObject());
        } else {
            name = null;
        }
        if (in.readBoolean()) {
            typeQName = new QName((String)in.readObject(),
                                  (String)in.readObject());
        } else {
            typeQName = null;
        }
        in.defaultReadObject();
    
public voidsetDocumentation(java.lang.String documentation)
set the documentation for the parameter

    	this.documentation = documentation;
    
public voidsetInHeader(boolean value)

        this.inHeader = value;
    
public voidsetIsReturn(boolean value)
Set to true to indicate return parameter of OperationDesc

param
value boolean that indicates if return parameter of OperationDesc

        isReturn = value;
    
public voidsetItemQName(javax.xml.namespace.QName itemQName)

        this.itemQName = itemQName;
    
public voidsetItemType(javax.xml.namespace.QName itemType)

        this.itemType = itemType;
    
public voidsetJavaType(java.lang.Class javaType)
Set the java type (note that this is javaType in the signature.)

        // The javaType must match the mode.  A Holder is expected for OUT/INOUT
        // parameters that don't represent the return type.
        if (javaType != null) {
            if ((mode == IN || isReturn) &&
                javax.xml.rpc.holders.Holder.class.isAssignableFrom(javaType) ||
                mode != IN && !isReturn &&
                !javax.xml.rpc.holders.Holder.class.isAssignableFrom(javaType)) {
                throw new IllegalArgumentException(
                     Messages.getMessage("setJavaTypeErr00",
                                          javaType.getName(),
                                          getModeAsString(mode)));
            }
        }

        this.javaType = javaType;
    
public voidsetMode(byte mode)

        this.mode = mode;
    
public voidsetName(java.lang.String name)

        this.name = new QName("", name);
    
public voidsetNillable(boolean nillable)
Indicate if this parameter is nillable.

param
nillable true iff this parameter is nillable

        this.nillable = nillable;
    
public voidsetOmittable(boolean omittable)
Indicate if this parameter is omittable or not (i.e., if it has a minimum occurrence of 0).

param
omittable whether the parameter may be omitted or not

        this.omittable = omittable;
    
public voidsetOrder(int order)

        this.order = order;
    
public voidsetOutHeader(boolean value)

        this.outHeader = value;
    
public voidsetQName(javax.xml.namespace.QName name)

        this.name = name;
    
public voidsetTypeQName(javax.xml.namespace.QName typeQName)

        this.typeQName = typeQName;
    
public java.lang.StringtoString()

        return toString("");
    
public java.lang.StringtoString(java.lang.String indent)

        String text="";
        text+=indent + "name:       " + name + "\n";
        text+=indent + "typeEntry:  " + typeEntry + "\n";
        text+=indent + "mode:       " + (mode == IN ?
                                         "IN" : mode == INOUT ?
                                         "INOUT" : "OUT") + "\n";
        text+=indent + "position:   " + order + "\n";
        text+=indent + "isReturn:   " + isReturn + "\n";
        text+=indent + "typeQName:  " + typeQName + "\n";
        text+=indent + "javaType:   " + javaType + "\n";
        text+=indent + "inHeader:   " + inHeader + "\n";
        text+=indent + "outHeader:  " + outHeader+ "\n";
        return text;
    
private voidwriteObject(java.io.ObjectOutputStream out)

        if (name == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            out.writeObject(name.getNamespaceURI());
            out.writeObject(name.getLocalPart());
        }
        if (typeQName == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            out.writeObject(typeQName.getNamespaceURI());
            out.writeObject(typeQName.getLocalPart());
        }
        out.defaultWriteObject();