Package org.apache.axis.description

Examples of org.apache.axis.description.FieldDesc


            }

            // isNillable default value depends on the field type
            boolean isNillable = Types.isNullable(fieldType);
            if (typeDesc != null) {
                FieldDesc field = typeDesc.getFieldByName(fieldName);
                if (field != null && field.isElement()) {
                    isNillable = ((ElementDesc)field).isNillable();
                }
            }

            elem = types.createElement(fieldName,
View Full Code Here


            for (int i=0; i<propertyDescriptor.length; i++) {
                String propName = propertyDescriptor[i].getName();
                if (propName.equals("class"))
                    continue;

                FieldDesc field = typeDesc.getFieldByName(propName);
                // skip it if its not an attribute
                if (field == null || field.isElement())
                    continue;

                QName qname = field.getXmlName();
                if (qname == null) {
                    qname = new QName("", propName);
                }

                if (propertyDescriptor[i].isReadable() &&
                    !propertyDescriptor[i].isIndexed()) {
                    // add to our attributes
                    Object propValue = propertyDescriptor[i].get(value);
                    // Convert true/false to 1/0 in case of soapenv:mustUnderstand
                    if (qname.equals(MUST_UNDERSTAND_QNAME)) {
                      if (propValue.equals(Boolean.TRUE)) {
                                propValue = "1";
                      } else if (propValue.equals(Boolean.FALSE)) {
                        propValue = "0";
                      }
                    }
                    // If the property value does not exist, don't serialize
                    // the attribute.  In the future, the decision to serializer
                    // the attribute may be more sophisticated.  For example, don't
                    // serialize if the attribute matches the default value.
                    if (propValue != null) {
                        setAttributeProperty(propValue,
                                             qname,
                                             field.getXmlType(),
                                             attrs,
                                             context);
                    }
                }
            }
View Full Code Here

            }
        } else {
            FieldDesc [] fields = typeDesc.getFields();
            if (fields != null) {
                for (int i = 0; i < fields.length; i++) {
                    FieldDesc field = fields[i];
                    if (!field.isElement()) {
                        ret.add(field.getFieldName());
                    }
                }
            }
        }
View Full Code Here

                typeDesc.getFields() != null) {
                ArrayList ordered = new ArrayList();
                // Add the TypeDesc elements first
                FieldDesc[] fds = typeDesc.getFields();
                for (int i=0; i<fds.length; i++) {
                    FieldDesc field = fds[i];
                    if (field.isElement()) {
                        boolean found = false;
                        for (int j=0;
                             j<pd.size() && !found;
                             j++) {
                            if (field.getFieldName().equals(
                               ((BeanPropertyDescriptor)pd.get(j)).getName())) {
                                ordered.add(pd.remove(j));
                                found = true;
                            }
                        }
View Full Code Here

            for (int i=0; i<propertyDescriptor.length; i++) {
                String propName = propertyDescriptor[i].getName();
                if (propName.equals("class"))
                    continue;

                FieldDesc field = typeDesc.getFieldByName(propName);
                // skip it if its not an attribute
                if (field == null || field.isElement())
                    continue;

                QName qname = field.getXmlName();
                if (qname == null) {
                    qname = new QName("", propName);
                }

                if (propertyDescriptor[i].isReadable() &&
View Full Code Here

        String base = "string";
        for (int i=0; i<propertyDescriptor.length; i++) {
            String propName = propertyDescriptor[i].getName();
            if (!propName.equals("value")) {
                if (typeDesc != null) {
                    FieldDesc field = typeDesc.getFieldByName(propName);
                    if (field != null) {
                        if (field.isElement()) {
                            // throw?
                        }
                        QName qname = field.getXmlName();
                        if (qname == null) {
                            // Use the default...
                            propName = propName;
                            qname = new QName("", propName);
                        }
View Full Code Here

                // with this field.  If it's an attribute, skip it.  If it's
                // an element, use whatever qname is in there.  If we can't
                // find any of this info, use the default.

                if (typeDesc != null) {
                    FieldDesc field = typeDesc.getFieldByName(propName);
                    if (field != null) {
                        if (!field.isElement())
                            continue;

                        qname = field.getXmlName();
                        isOmittable = field.isMinOccursIs0();
                    }
                }

                if (qname == null) {
                    // Use the default...
View Full Code Here

            // with this field.  If it's an attribute, skip it.  If it's
            // an element, use whatever qname is in there.  If we can't
            // find any of this info, use the default.

            if (typeDesc != null) {
                FieldDesc field = typeDesc.getFieldByName(propName);
                if (field != null) {
                    QName qname = field.getXmlName();
                    if (qname != null) {
                        // FIXME!
                        // Check to see if this is in the right namespace -
                        // if it's not, we need to use an <element ref="">
                        // to represent it!!!

                        // Use the default...
                        propName = qname.getLocalPart();
                    }
                    if (!field.isElement()) {
                        writeAttribute(types,
                                       propName,
                                       propertyDescriptor[i].getType(),
                                       complexType);
                    } else {
                        writeField(types,
                                   propName,
                                   propertyDescriptor[i].getType(),
                                   propertyDescriptor[i].isIndexed(),
                                   field.isMinOccursIs0(),
                                   all);
                    }
                } else {
                    writeField(types,
                               propName,
View Full Code Here

            for (int i=0; i<propertyDescriptor.length; i++) {
                String propName = propertyDescriptor[i].getName();
                if (propName.equals("class"))
                    continue;

                FieldDesc field = typeDesc.getFieldByName(propName);
                // skip it if its not an attribute
                if (field == null || field.isElement())
                    continue;

                QName qname = field.getXmlName();
                if (qname == null) {
                    qname = new QName("", propName);
                }

                if (propertyDescriptor[i].isReadable() &&
View Full Code Here

            for (int i=0; i<propertyDescriptor.length; i++) {
                String propName = propertyDescriptor[i].getName();
                if (propName.equals("class"))
                    continue;

                FieldDesc field = typeDesc.getFieldByName(propName);
                // skip it if its not an attribute
                if (field == null || field.isElement())
                    continue;

                QName qname = field.getXmlName();
                if (qname == null) {
                    qname = new QName("", propName);
                }

                if (propertyDescriptor[i].isReadable() &&
View Full Code Here

TOP

Related Classes of org.apache.axis.description.FieldDesc

Copyright © 2018 www.massapicom. 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.