Constructors Summary |
---|
public RPCParam(String name, Object value)Constructor for building up messages.
Class cls = RPCParam.class;
try {
valueSetMethod = cls.getMethod("set", new Class[] {Object.class});
} catch (NoSuchMethodException e) {
log.error(Messages.getMessage("noValue00", "" + e));
throw new RuntimeException(e.getMessage());
}
this(new QName("", name), value);
|
public RPCParam(QName qname, Object value)
super(qname);
if (value instanceof java.lang.String) {
try {
this.addTextNode((String) value);
} catch (SOAPException e) {
throw new RuntimeException(Messages.getMessage("cannotCreateTextNode00"));
}
} else {
this.value = value;
}
|
public RPCParam(String namespace, String name, Object value)
this(new QName(namespace, name), value);
|
Methods Summary |
---|
public javax.xml.soap.SOAPElement | addTextNode(java.lang.String s)
value = s;
return super.addTextNode(s);
|
public java.lang.Object | getObjectValue()
return value;
|
public org.apache.axis.description.ParameterDesc | getParamDesc()
return paramDesc;
|
public java.lang.String | getValue()
return getValueDOM();
|
public static java.lang.reflect.Method | getValueSetMethod()
return valueSetMethod;
|
public java.lang.Boolean | getXSITypeGeneration()
return this.wantXSIType;
|
protected void | outputImpl(org.apache.axis.encoding.SerializationContext context)
serialize(context);
|
private void | readObject(java.io.ObjectInputStream in)
if (in.readBoolean()) {
setQName(new QName((String)in.readObject(),
(String)in.readObject()));
}
in.defaultReadObject();
|
public void | serialize(org.apache.axis.encoding.SerializationContext context)
// Set the javaType to value's class unless
// parameter description information exists.
// Set the xmlType using the parameter description
// information. (an xmlType=null causes the
// serialize method to search for a compatible xmlType)
Class javaType = value == null ? null: value.getClass();
QName xmlType = null;
// we'll send a null unless our description tells us
// that we may be omitted
Boolean sendNull = Boolean.TRUE;
if (paramDesc != null) {
if (javaType == null) {
javaType = paramDesc.getJavaType() != null ?
paramDesc.getJavaType(): javaType;
} else if (!(javaType.equals(paramDesc.getJavaType()))) {
Class clazz = JavaUtils.getPrimitiveClass(javaType);
if(clazz == null || !clazz.equals(paramDesc.getJavaType())) {
if (!(javaType.equals(
JavaUtils.getHolderValueType(paramDesc.getJavaType())))) {
// This must (assumedly) be a polymorphic type - in ALL
// such cases, we must send an xsi:type attribute.
wantXSIType = Boolean.TRUE;
}
}
}
xmlType = paramDesc.getTypeQName();
QName itemQName = paramDesc.getItemQName();
if (itemQName == null) {
MessageContext mc = context.getMessageContext();
if (mc != null && mc.getOperation() != null && mc.getOperation().getStyle() == Style.DOCUMENT) {
itemQName = Constants.QNAME_LITERAL_ITEM;
}
}
context.setItemQName(itemQName);
QName itemType = paramDesc.getItemType();
context.setItemType(itemType);
// don't send anything if we're able to be omitted,
// although we'll prefer to send xsi:nill if possible
if (paramDesc.isOmittable() && !paramDesc.isNillable())
sendNull = Boolean.FALSE;
}
context.serialize(getQName(), // element qname
null, // no extra attrs
value, // value
xmlType, // java/xml type
sendNull, wantXSIType);
|
public void | set(java.lang.Object newValue)This set method is registered during deserialization
to set the deserialized value.
If the method is called multiple times, the
value is automatically changed into a container to
hold all of the values.
countSetCalls++;
// If this is the first call,
// simply set the value.
if (countSetCalls==1) {
this.value = newValue;
return;
}
// If this is the second call, create an
// ArrayList to hold all the values
else if (countSetCalls==2) {
ArrayList list = new ArrayList();
list.add(this.value);
this.value = list;
}
// Add the new value to the list
((ArrayList) this.value).add(newValue);
|
public void | setObjectValue(java.lang.Object value)
this.value = value;
|
public void | setParamDesc(org.apache.axis.description.ParameterDesc paramDesc)
this.paramDesc = paramDesc;
|
public void | setRPCCall(RPCElement call)
parent = call;
|
public void | setValue(java.lang.String value)
this.value = value;
super.setValue(value);
|
public void | setXSITypeGeneration(java.lang.Boolean value)
this.wantXSIType = value;
|
private void | writeObject(java.io.ObjectOutputStream out)
if (getQName() == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
out.writeObject(getQName().getNamespaceURI());
out.writeObject(getQName().getLocalPart());
}
out.defaultWriteObject();
|