Examples of DatabindingException


Examples of org.apache.cxf.aegis.DatabindingException

                hasChildren = false;
                if (root.hasNext()) {
                    root.next();
                }
            } catch (XMLStreamException e) {
                throw new DatabindingException("Could not read XML stream.", e);
            }
           
            if (value == null) {
                value = "";
            }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

            hasCheckedChildren = true;
            hasChildren = false;
            return false;
        } catch (XMLStreamException e) {
            throw new DatabindingException("Error parsing document.", e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

            type.setTypeClass(info.getType());
            type.setTypeMapping(getTypeMapping());

            return type;
        } catch (InstantiationException e) {
            throw new DatabindingException("Couldn't instantiate type classs "
                                           + info.getAegisTypeClass().getName(), e);
        } catch (IllegalAccessException e) {
            throw new DatabindingException("Couldn't access type classs "
                                           + info.getAegisTypeClass().getName(), e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

        }

        MessageReader typeReader = reader.getAttributeReader(XSI_TYPE);

        if (null == typeReader && !readToDocument) {
            throw new DatabindingException("Missing 'xsi:type' attribute");
        }

        String typeName = null;
        if (typeReader != null) {
            typeName = typeReader.getValue();
        }

        if (null == typeName && !readToDocument) {
            throw new DatabindingException("Missing 'xsi:type' attribute value");
        }

        AegisType type = null;
        QName typeQName = null;

        if (typeName != null) {
            typeName = typeName.trim();
            typeQName = extractQName(reader, typeName);
        } else {
            typeQName = reader.getName();
        }

        TypeMapping tm = context.getTypeMapping();
        if (tm == null) {
            tm = getTypeMapping();
        }

        type = tm.getType(typeQName);

        if (type == null) {
            type = tm.getType(getSchemaType());
        }

        if (type == this) {
            throw new DatabindingException("Could not determine how to read type: " + typeQName);
        }

        if (type == null && readToDocument) {
            type = getTypeMapping().getType(Document.class);
        }

        if (null == type) {
            // TODO should check namespace as well..
            if (serializedWhenUnknown && "serializedJavaObject".equals(typeName)) {
                return reconstituteJavaObject(reader);
            }

            throw new DatabindingException("No mapped type for '" + typeName + "' (" + typeQName + ")");
        }

        return type.readObject(reader, context);
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

        try {
            ByteArrayInputStream in = new ByteArrayInputStream(Base64Utility
                                                                   .decode(reader.getValue().trim()));
            return new ObjectInputStream(in).readObject();
        } catch (Exception e) {
            throw new DatabindingException("Unable to reconstitute serialized object", e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

            if (asArray) {
                return makeArray(getComponentType().getTypeClass(), values);
            }
            return values;
        } catch (IllegalArgumentException e) {
            throw new DatabindingException("Illegal argument.", e);
        }
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

            }
        }

        // check min occurs
        if (values.size() < minOccurs) {
            throw new DatabindingException("The number of elements in " + getSchemaType()
                                           + " does not meet the minimum of " + minOccurs);
        }
        return values;
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

        }

        // check max occurs
        int size = values.size();
        if (size > maxOccurs) {
            throw new DatabindingException("The number of elements in " + getSchemaType()
                                           + " exceeds the maximum of " + maxOccurs);
        }
    }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

            values = c.toArray();
        }

        AegisType type = getComponentType();
        if (type == null) {
            throw new DatabindingException("Couldn't find type for array.");
        }
        if (XmlSchemaConstants.ANY_TYPE_QNAME.equals(type.getSchemaType())) {
            forceXsiWrite = true;
        }
View Full Code Here

Examples of org.apache.cxf.aegis.DatabindingException

            reader.nextTag();
            Object tree = StaxUtils.read(null, new FragmentStreamReader(reader), true);
            reader.nextTag(); // eat the end tag.
            return tree;
        } catch (XMLStreamException e) {
            throw new DatabindingException("Could not parse xml.", e);
        }
    }
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.