// Path: lib-spring/src/main/java/com/kdgregory/pathfinder/spring/InvalidContextException.java
// public class InvalidContextException 
// extends RuntimeException
// {
//     private static final long serialVersionUID = 1L;
// 
//     
//     public InvalidContextException(String message)
//     {
//         super(message);
//     }
// 
//     
//     public InvalidContextException(String message, Throwable cause)
//     {
//         super(message, cause);
//     }
// }


import java.io.IOException;
import java.io.StringReader;
import java.util.List;
import java.util.Properties;
import org.w3c.dom.Element;
import net.sf.kdgcommons.lang.StringUtil;
import net.sf.practicalxml.DomUtil;
import net.sf.practicalxml.xpath.XPathWrapperFactory;
import com.kdgregory.pathfinder.spring.InvalidContextException;
    {
        return def.getAttribute("id").trim();
    }


    private static String extractBeanName(Element def)
    {
        return def.getAttribute("name").trim();
    }


    private static String extractBeanClass(Element def)
    {
        return def.getAttribute("class").trim();
    }


    private XmlBeanDefinition resolveParent(boolean failIfNoParent)
    {
        if (parent != null)
            return parent;

        // technically, an XML definition could inherit from a non-XML definition
        // I'm going to assume that's an extreme corner case, as supporting it
        // will make my life more difficult
        BeanDefinition p0 = (parentRef != null) ? context.getBean(parentRef) : null;
        if (p0 instanceof XmlBeanDefinition)
            parent = (XmlBeanDefinition)p0;

        if ((parent == null) && failIfNoParent)
// Path: lib-spring/src/main/java/com/kdgregory/pathfinder/spring/InvalidContextException.java
// public class InvalidContextException 
// extends RuntimeException
// {
//     private static final long serialVersionUID = 1L;
// 
//     
//     public InvalidContextException(String message)
//     {
//         super(message);
//     }
// 
//     
//     public InvalidContextException(String message, Throwable cause)
//     {
//         super(message, cause);
//     }
// }


// Path: lib-spring/src/main/java/com/kdgregory/pathfinder/spring/context/XmlBeanDefinition.java
import java.io.IOException;
import java.io.StringReader;
import java.util.List;
import java.util.Properties;
import org.w3c.dom.Element;
import net.sf.kdgcommons.lang.StringUtil;
import net.sf.practicalxml.DomUtil;
import net.sf.practicalxml.xpath.XPathWrapperFactory;
import com.kdgregory.pathfinder.spring.InvalidContextException;

    {
        return def.getAttribute("id").trim();
    }


    private static String extractBeanName(Element def)
    {
        return def.getAttribute("name").trim();
    }


    private static String extractBeanClass(Element def)
    {
        return def.getAttribute("class").trim();
    }


    private XmlBeanDefinition resolveParent(boolean failIfNoParent)
    {
        if (parent != null)
            return parent;

        // technically, an XML definition could inherit from a non-XML definition
        // I'm going to assume that's an extreme corner case, as supporting it
        // will make my life more difficult
        BeanDefinition p0 = (parentRef != null) ? context.getBean(parentRef) : null;
        if (p0 instanceof XmlBeanDefinition)
            parent = (XmlBeanDefinition)p0;

        if ((parent == null) && failIfNoParent)
            throw new InvalidContextException("invalid bean definition, parent expected: " + super.getBeanId());