Package org.exolab.castor.xml.location

Examples of org.exolab.castor.xml.location.XPathLocation


     * @param e The {@link ValidationException} to enrich.
     * @param occurence If greater than 0, denotes the position of the invalid collection value.
     */
    private void addLocationInformation(final XMLFieldDescriptor fieldDescriptor,
            final ValidationException e, final long occurence) {
        XPathLocation loc = (XPathLocation) e.getLocation();
        if (loc == null) {
            loc = new XPathLocation();
            e.setLocation(loc);
            String xmlName = fieldDescriptor.getXMLName();
            if (occurence > 0) {
                xmlName += "[" + occurence + "]";
            }
            if (fieldDescriptor.getNodeType() == NodeType.Attribute) {
                loc.addAttribute(xmlName);
            } else {
                loc.addChild(xmlName);
            }
        }
    }
View Full Code Here


                    }
                }
            }
        } catch (ValidationException vx) {
            //-- add location information
            XPathLocation loc = (XPathLocation) vx.getLocation();
            if (loc == null) {
                loc = new XPathLocation();
                vx.setLocation(loc);
                if (fieldDesc != null) {
                    if (fieldDesc.getNodeType() == NodeType.Attribute) {
                        loc.addAttribute(fieldDesc.getXMLName());
                    } else {
                        loc.addChild(fieldDesc.getXMLName());
                    }
                }
            }
            if (classDesc.getXMLName() != null) {
                 loc.addParent(classDesc.getXMLName());
            }
            throw vx;
        }
       
//        checkUnresolvedIdrefs(context);
View Full Code Here

     * generating the error.
     * @param e The {@link ValidationException} to enrich.
     */
    private void addLocationInformation(final XMLFieldDescriptor localElement,
            final ValidationException e) {
        XPathLocation loc = (XPathLocation) e.getLocation();
        if (loc == null) {
            loc = new XPathLocation();
            e.setLocation(loc);
            if (localElement.getNodeType() == NodeType.Attribute) {
                loc.addAttribute(localElement.getXMLName());
            } else {
                loc.addChild(localElement.getXMLName());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.location.XPathLocation

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.