Package org.apache.cxf.aegis

Examples of org.apache.cxf.aegis.DatabindingException


                writer.writeNamespace(pfx, ns);
            }

            return pfx;
        } catch (XMLStreamException e) {
            throw new DatabindingException("Error writing document.", e);
        }
    }
View Full Code Here


            }
           
            private void throwDatabindingException(String message) {
                //DatabindingException is quirky. This dance is required to get the full message
                //to where it belongs.
                DatabindingException e = new DatabindingException(message);
                e.setMessage(message);
                throw e;
            }

            public void error(SAXParseException exception) throws SAXException {
                String message = errorMessage(exception);
View Full Code Here

        }

        info.setDescription("method " + m.getName() + " parameter " + index);
        if (index >= 0) {
            if (index >= m.getParameterTypes().length) {
                throw new DatabindingException("Method "
                                               + m
                                               + " does not have a parameter at index "
                                               + index);
            }
            // we don't want nodes for which the specified index is not
View Full Code Here

    private Object loadGeneric(TypeClassInfo info, Element mapping, String componentType) {
        if (componentType.startsWith("#")) {
            String name = componentType.substring(1);
            Element propertyEl = getMatch(mapping, "./component[@name='" + name + "']");
            if (propertyEl == null) {
                throw new DatabindingException("Could not find <component> element in mapping named '" + name
                                               + "'");
            }

            TypeClassInfo componentInfo = new TypeClassInfo();
            componentInfo.setDescription("generic component " + componentInfo.getDescription());
            readMetadata(componentInfo, mapping, propertyEl);
            String className = propertyEl.getAttributeValue("class");
            if (className == null) {
                throw new DatabindingException("A 'class' attribute must be specified for <component> "
                                               + name);
            }

            componentInfo.setTypeClass(loadComponentClass(className));
View Full Code Here

    private Class loadComponentClass(String componentType) {
        try {
            return ClassLoaderUtils.loadClass(componentType, getClass());
        } catch (ClassNotFoundException e) {
            throw new DatabindingException("Unable to load component type class " + componentType, e);
        }
    }
View Full Code Here

        String type = parameter.getAttributeValue("type");
        if (type != null) {
            try {
                info.setType(ClassLoaderUtils.loadClass(type, getClass()));
            } catch (ClassNotFoundException e) {
                throw new DatabindingException("Unable to load type class " + type, e);
            }
        }
    }
View Full Code Here

    private Element getMatch(Object doc, String xpath) {
        try {
            XPath path = XPath.newInstance(xpath);
            return (Element)path.selectSingleNode(doc);
        } catch (JDOMException e) {
            throw new DatabindingException("Error evaluating xpath " + xpath, e);
        }
    }
View Full Code Here

    private List<Element> getMatches(Object doc, String xpath) {
        try {
            XPath path = XPath.newInstance(xpath);
            return path.selectNodes(doc);
        } catch (JDOMException e) {
            throw new DatabindingException("Error evaluating xpath " + xpath, e);
        }
    }
View Full Code Here

        String prefix = value.substring(0, index);
        String localName = value.substring(index + 1);
        Namespace ns = e.getNamespace(prefix);

        if (ns == null || localName == null) {
            throw new DatabindingException("Invalid QName in mapping: " + value);
        }

        return new QName(ns.getURI(), localName, prefix);
    }
View Full Code Here

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

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

TOP

Related Classes of org.apache.cxf.aegis.DatabindingException

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.