Examples of TypeDesc


Examples of org.apache.axis.description.TypeDesc

            Element extension = types.createElement("extension");
            complexContent.appendChild(extension);
            extension.setAttribute("base", base);
            e = extension;
            // Get the property descriptors for the super class
            TypeDesc superTypeDesc = TypeDesc.getTypeDescForClass(superClass);
            if (superTypeDesc != null) {
                superPd = superTypeDesc.getPropertyDescriptors();
            } else {
                superPd = BeanUtils.getPd(superClass, null);
            }
        } else {
            e = complexType;
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

            // if no serializer was configured try to find one dynamically using WSDLJava
            // generated metadata
            Class cls = value.getClass();
            Serializer serializer = getSerializerFromClass(cls, elemQName);
            if (serializer != null) {
                TypeDesc typedesc = TypeDesc.getTypeDescForClass(value.getClass());
                if (typedesc != null) {
                    QName qname = typedesc.getXmlType();
                    if (qname != null) {
                        writeXMLType = qname;
                    }
                }
                serializer.serialize(elemQName, attributes, value, this);
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

        }
        Deserializer dser = null;
        try {
            Method method = cls.getMethod(DESERIALIZER_METHOD, DESERIALIZER_CLASSES);
            if (method != null) {
                TypeDesc typedesc = TypeDesc.getTypeDescForClass(cls);
                if (typedesc != null) {
                    dser = (Deserializer) method.invoke(null,
                        new Object[] {msgContext.getEncodingStyle(), cls, typedesc.getXmlType()});
                }
            }
        } catch (Exception e) {
            log.error(Messages.getMessage("noDeser00", cls.getName()));
        }
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

   * @see TypeLookUpServices#getClassQName(java.lang.Class)
   */
  public QName class2qname(Class cls) {
    if (cls.isArray())
      cls = cls.getComponentType();
    TypeDesc td = TypeDesc.getTypeDescForClass(cls); // a class can
    if (null != td) {
      return td.getXmlType();
    } else {
      String namespace = Namespaces.makeNamespace(cls.getName());
      if (namespace == null || namespace.endsWith("DefaultNamespace")) {
        namespace = "http://no.namespace.specified";
      }
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

    protected void registerClassAsWithDefaultSearialization(Class cls, QName q, SOAPBinding.Style style,
      SOAPBinding.Use use) {
        try {
            logger.debug("Assigned Default Serialization to  class: " + cls.getCanonicalName()
                    + " qname:" + q);
            TypeDesc td = TypeDesc.getTypeDescForClass(cls); // a class can
                                                                // provide its
                                                                // own
                                                                // descriptors
            TypeDesc superTd = null;
            BeanPropertyDescriptor[] superPd = null;
      boolean shoudRegisterFields = false;
            if (null == td) {
        shoudRegisterFields = true;
                td = new TypeDesc(cls);
                Class supa = cls.getSuperclass();
                if ((supa != null) && (supa != java.lang.Object.class)
                        && (supa != java.lang.Exception.class)
                        && (supa != java.lang.Throwable.class)
                        && (supa != java.rmi.RemoteException.class)
                        && (supa != org.apache.axis.AxisFault.class)) {
                    registerType(supa, style, use);
                    superTd = TypeDesc.getTypeDescForClass(supa);
                    if (superTd != null) {
                        superPd = superTd.getPropertyDescriptors();
                    }
                }
                td.setXmlType(q);
                TypeDesc.registerTypeDescForClass(cls, td);
            }
            mTypeMapping.register(cls, q, new BeanSerializerFactory(cls, q),
            /*
             * NOTE jcolwell@bea.com 2004-Oct-11 -- should check that the type
             * to deserialize has a default contructor but with this setup there
             * is no way to know if it is used only in serialization.
             */
            new BeanDeserializerFactory(cls, q));
            Map serProps = BeanDeserializerFactory.getProperties(cls, null);
            for (BeanPropertyDescriptor beanProps : (Collection<BeanPropertyDescriptor>) serProps
                    .values()) {
                Class subType = beanProps.getType();
                if (!(subType.isPrimitive()
                        || subType.getName().startsWith("java.") || subType
                        .getName().startsWith("javax."))) {
                    registerType(subType, style, use);
                }
                if (shoudRegisterFields) {
                    String ns = q.getNamespaceURI();
                    if (superTd != null && superPd != null) {
                        for (int j = 0; j < superPd.length; j++) {
                            if (beanProps.getName()
                                    .equals(superPd[j].getName())) {
                                ns = superTd.getXmlType().getNamespaceURI();
                                break;
                            }
                        }
                    }
                    FieldDesc fd = new ElementDesc();
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

                                * That and it causes an infinite
                                * loop as it keeps returning itself from the
                                * getAbsoluteFile and getCanonicalFile calls
                                */
                               && !File.class.isAssignableFrom(cls)) {
                        TypeDesc td = TypeDesc.getTypeDescForClass(cls);
                        TypeDesc superTd = null;
                        BeanPropertyDescriptor[] superPd = null;
                        if (null == td) {
                            td = new TypeDesc(cls);
                            Class supa = cls.getSuperclass();
                            if ((supa != null)
                                && (supa != java.lang.Object.class)
                                && (supa != java.lang.Exception.class)
                                && (supa != java.lang.Throwable.class)
                                && (supa != java.rmi.RemoteException.class)
                                && (supa != org.apache.axis.AxisFault.class)) {
                                registerType(supa);
                            }
                            superTd = TypeDesc
                                .getTypeDescForClass(supa);
                            if (superTd != null) {
                                superPd = superTd.getPropertyDescriptors();
                            }
                            td.setXmlType(q);
                            TypeDesc.registerTypeDescForClass(cls, td);
                        } else {
                            td = null;
                        }
                        mTypeMapping.register(cls, q,
                                    new BeanSerializerFactory(cls, q),
                                    /*
                                     * NOTE jcolwell@bea.com 2004-Oct-11 --
                                     * should check that the type to deserialize
                                     * has a default contructor but with this
                                     * setup there is no way to know if it is
                                     * used only in serialization.
                                     */
                                    new BeanDeserializerFactory(cls, q));
                        Map serProps = BeanDeserializerFactory
                            .getProperties(cls, null);
                        for (BeanPropertyDescriptor beanProps :
                                 (Collection<BeanPropertyDescriptor>) serProps
                                 .values()) {
                            Class subType = beanProps.getType();
                            if (!(subType.isPrimitive()
                                  || subType.getName().startsWith("java.")
                                  || subType.getName().startsWith("javax."))) {
                                registerType(subType);
                            }
                            if (td != null) {
                                String ns = q.getNamespaceURI();
                                if (superTd != null && superPd != null) {
                                    for (int j = 0; j < superPd.length; j++) {
                                        if (beanProps.getName()
                                            .equals(superPd[j]
                                                    .getName())) {
                                            ns = superTd.getXmlType()
                                                .getNamespaceURI();
                                            break;
                                        }
                                    }
                                }
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

            Method method =
                MethodCache.getInstance().getMethod(cls,
                                                    DESERIALIZER_METHOD,
                                                    DESERIALIZER_CLASSES);    
            if (method != null) {
                TypeDesc typedesc = TypeDesc.getTypeDescForClass(cls);
                if (typedesc != null) {
                    dser = (Deserializer) method.invoke(null,
                        new Object[] {getEncodingStyle(), cls, typedesc.getXmlType()});
                }
            }
        } catch (Exception e) {
            log.error(Messages.getMessage("noDeser00", cls.getName()));
        }
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

            // check the class for serializer
            Serializer serializer = getSerializerFromClass(javaType, xmlType);
            if (serializer != null) {
                if (actualXMLType != null) {
                    TypeDesc typedesc = TypeDesc.getTypeDescForClass(javaType);
                    if (typedesc != null) {
                        actualXMLType.value = typedesc.getXmlType();
                    }
                }
                return serializer;
            }
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

            Element extension = types.createElement("extension");
            complexContent.appendChild(extension);
            extension.setAttribute("base", base);
            e = extension;
            // Get the property descriptors for the super class
            TypeDesc superTypeDesc = TypeDesc.getTypeDescForClass(superClass);
            if (superTypeDesc != null) {
                superPd = superTypeDesc.getPropertyDescriptors();
            } else {
                superPd = BeanUtils.getPd(superClass, null);
            }
        } else {
            e = complexType;
View Full Code Here

Examples of org.apache.axis.description.TypeDesc

        if (propDesc == null) {
            Class superClass = javaType;
            while (superClass != null && propDesc == null) {
                superClass = superClass.getSuperclass();
                if (superClass != null) {
                    TypeDesc td = TypeDesc.getTypeDescForClass(superClass);
                    if (td != null) {
                        String fieldName =
                            td.getFieldNameForElement(elemQName,
                                                      false);
                        if (fieldName == null &&
                            (prefix == null || prefix.equals(""))) {
                            fieldName =
                                td.getFieldNameForElement(
                                new QName("", elemQName.getLocalPart()), false);
                        }
                       
                        propDesc =
                            (BeanPropertyDescriptor)propertyMap.get(fieldName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.