Search in sources :

Example 1 with InputContext

use of org.apache.axiom.core.InputContext in project webservices-axiom by apache.

the class TreeWalkerImpl method dispose.

@Override
public void dispose() {
    if (!preserve && node != null) {
        CoreParentNode parent = node instanceof CoreParentNode ? (CoreParentNode) node : ((CoreChildNode) node).coreGetParent();
        while (true) {
            InputContext context = parent.coreGetInputContext();
            if (context != null) {
                context.discard();
            }
            if (parent == root) {
                break;
            }
            parent = ((CoreChildNode) parent).coreGetParent();
        }
    }
    if (reader != null) {
        reader.dispose();
    }
}
Also used : CoreParentNode(org.apache.axiom.core.CoreParentNode) InputContext(org.apache.axiom.core.InputContext)

Aggregations

CoreParentNode (org.apache.axiom.core.CoreParentNode)1 InputContext (org.apache.axiom.core.InputContext)1