Example usage for org.apache.commons.jxpath.ri.model NodePointer createChild

List of usage examples for org.apache.commons.jxpath.ri.model NodePointer createChild

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri.model NodePointer createChild.

Prototype

public NodePointer createChild(JXPathContext context, QName name, int index, Object value) 

Source Link

Document

Called by a child pointer if that child needs to assign the value supplied in the createPath(context, value) call to a non-existent node.

Usage

From source file:org.eclipse.e4.emf.internal.xpath.NullEStructuralFeaturePointer.java

@Override
public NodePointer createPath(JXPathContext context, Object value) {
    NodePointer newParent = parent.createPath(context);
    if (isAttribute()) {
        NodePointer pointer = newParent.createAttribute(context, getName());
        pointer.setValue(value);/*from  w  w w .j ava  2s  .c o  m*/
        return pointer;
    }
    if (parent instanceof NullPointer && parent.equals(newParent)) {
        throw createBadFactoryException(context.getFactory());
    }
    if (newParent instanceof EStructuralFeatureOwnerPointer) {
        EStructuralFeatureOwnerPointer pop = (EStructuralFeatureOwnerPointer) newParent;
        newParent = pop.getPropertyPointer();
    }
    return newParent.createChild(context, getName(), index, value);
}