FileDocCategorySizeDatePackage
WSDDTypeMapping.javaAPI DocApache Axis 1.47170Sat Apr 22 18:57:28 BST 2006org.apache.axis.deployment.wsdd

WSDDTypeMapping

public class WSDDTypeMapping extends WSDDElement

Fields Summary
protected QName
qname
protected String
serializer
protected String
deserializer
protected QName
typeQName
protected String
ref
protected String
encodingStyle
Constructors Summary
public WSDDTypeMapping()
Default constructor

    
             
     
    
    
public WSDDTypeMapping(Element e)

param
e (Element) XXX
throws
WSDDException XXX

        serializer = e.getAttribute(ATTR_SERIALIZER);
        deserializer = e.getAttribute(ATTR_DESERIALIZER);
        Attr attrNode = e.getAttributeNode(ATTR_ENCSTYLE);

        if (attrNode == null) {
            encodingStyle = Constants.URI_DEFAULT_SOAP_ENC;
        } else {
            encodingStyle = attrNode.getValue();
        }

        String qnameStr = e.getAttribute(ATTR_QNAME);
        qname = XMLUtils.getQNameFromString(qnameStr, e);

        // JSR 109 v0.093 indicates that this attribute is named "type"

        String typeStr = e.getAttribute(ATTR_TYPE);
        typeQName = XMLUtils.getQNameFromString(typeStr, e);
        if (typeStr == null || typeStr.equals("")) {
            typeStr = e.getAttribute(ATTR_LANG_SPEC_TYPE);
            typeQName = XMLUtils.getQNameFromString(typeStr, e);
        }
    
Methods Summary
public java.lang.ClassgetDeserializer()

return
XXX
throws
ClassNotFoundException XXX

        return ClassUtils.forName(deserializer);
    
public java.lang.StringgetDeserializerName()

return
deserializer factory name

        return deserializer;
    
protected javax.xml.namespace.QNamegetElementName()

        return QNAME_TYPEMAPPING;
    
public java.lang.StringgetEncodingStyle()

return
XXX

        return encodingStyle;
    
public java.lang.ClassgetLanguageSpecificType()

return
XXX
throws
ClassNotFoundException XXX

        if (typeQName != null) {
            if (!URI_WSDD_JAVA.equals(typeQName.getNamespaceURI())) {
                throw new ClassNotFoundException(Messages.getMessage("badTypeNamespace00",
                                        typeQName.getNamespaceURI(),
                                        URI_WSDD_JAVA));
            }
            String loadName = JavaUtils.getLoadableClassName(typeQName.getLocalPart());
            if (JavaUtils.getWrapper(loadName) != null) {
                Class cls = JavaUtils.getPrimitiveClassFromName(loadName);
                return cls;
            }
            return ClassUtils.forName(loadName);
        }
        
        throw new ClassNotFoundException(Messages.getMessage("noTypeQName00"));
    
public javax.xml.namespace.QNamegetQName()

return
XXX

        return qname;
    
public java.lang.StringgetRef()

return
XXX

        return ref;
    
public java.lang.ClassgetSerializer()

return
XXX
throws
ClassNotFoundException XXX

        return ClassUtils.forName(serializer);
    
public java.lang.StringgetSerializerName()

return
serializer factory name

        return serializer;
    
public voidsetDeserializer(java.lang.Class deser)

param
deser XXX

        deserializer = deser.getName();
    
public voidsetDeserializer(java.lang.String deser)
Set the deserializer factory name

param
deser name of the deserializer factory class

        deserializer = deser;
    
public voidsetEncodingStyle(java.lang.String es)

param
es XXX

        encodingStyle = es;
    
public voidsetLanguageSpecificType(java.lang.Class javaType)
Set javaType (type= attribute or languageSpecificType= attribute)

param
javaType the class of the javaType

        String type = javaType.getName();
        typeQName = new QName(URI_WSDD_JAVA, type);
    
public voidsetLanguageSpecificType(java.lang.String javaType)
Set javaType (type= attribute or languageSpecificType= attribute)

param
javaType is the name of the class. (For arrays this could be the form my.Foo[] or could be in the form [Lmy.Foo;

        typeQName = new QName(URI_WSDD_JAVA, javaType);
    
public voidsetQName(javax.xml.namespace.QName name)

param
name XXX

        qname = name;
    
public voidsetRef(java.lang.String ref)

param
ref XXX

        this.ref = ref;
    
public voidsetSerializer(java.lang.Class ser)

param
ser XXX

        serializer = ser.getName();
    
public voidsetSerializer(java.lang.String ser)
Set the serializer factory name

param
ser name of the serializer factory class

        serializer = ser;
    
public voidwriteToContext(org.apache.axis.encoding.SerializationContext context)
Write this element out to a SerializationContext

        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute("", ATTR_ENCSTYLE, ATTR_ENCSTYLE, "CDATA", encodingStyle);
        attrs.addAttribute("", ATTR_SERIALIZER, ATTR_SERIALIZER, "CDATA", serializer);
        attrs.addAttribute("", ATTR_DESERIALIZER, ATTR_DESERIALIZER, "CDATA", deserializer);

        String typeStr = context.qName2String(typeQName);
        // JSR 109 indicates that the name of this field is type
        attrs.addAttribute("", ATTR_TYPE, ATTR_TYPE,
                           "CDATA", typeStr);
        
        String qnameStr = context.attributeQName2String(qname);
        attrs.addAttribute("", ATTR_QNAME, ATTR_QNAME, "CDATA", qnameStr);
        
        context.startElement(QNAME_TYPEMAPPING, attrs);
        context.endElement();