@Override public NodePointer getValuePointer() { return new NullPointer(this, getName()); }
@Override public NodePointer createPath(JXPathContext context) { if (getImmediateNode() == null) { super.createPath(context); baseValue = UNINITIALIZED; value = UNINITIALIZED; } return this; }
@Override public NodePointer getNodePointer() { return includeXmlLang && position == 1 ? new LangAttributePointer(parent) : super.getNodePointer(); }
@Override public void setIndex(int index) { if (this.index == index) { return; } // When dealing with a scalar, index == 0 is equivalent to // WHOLE_COLLECTION, so do not change it. if (this.index != WHOLE_COLLECTION || index != 0 || isCollection()) { super.setIndex(index); value = UNINITIALIZED; } }
@Override public NodeIterator attributeIterator(QName name) { return index == WHOLE_COLLECTION ? new CollectionAttributeNodeIterator(this, name) : getValuePointer().attributeIterator(name); }
/** * Create a NodeIterator. * @param property property name * @param reverse whether to iterate in reverse * @param startWith first pointer to return * @return NodeIterator */ public NodeIterator createNodeIterator(String property, boolean reverse, NodePointer startWith) { return new EStructuralFeatureIterator(this, property, reverse, startWith); }
@Override public String asPath() { if (id != null) { return "id(" + id + ")"; } return parent == null ? "null()" : super.asPath(); }
/** * Set the property index. * @param index property index */ public void setPropertyIndex(int index) { if (propertyIndex != index) { propertyIndex = index; setIndex(WHOLE_COLLECTION); } }
@Override public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof NullElementPointer)) { return false; } NullElementPointer other = (NullElementPointer) object; return getImmediateParentPointer() == other.getImmediateParentPointer() && index == other.index; }
@Override public boolean setPosition(int position) { this.position = position; if (includeXmlLang) { return position == 1 || super.setPosition(position - 1); } return super.setPosition(position); } }
/** * Select a property by name. * @param propertyName String name */ @Override public void setPropertyName(String propertyName) { setPropertyIndex(UNSPECIFIED_PROPERTY); this.propertyName = propertyName; }
/** * Get the property pointer for this. * @return PropertyPointer */ public EStructuralFeaturePointer getPropertyPointer() { return new NullEStructuralFeaturePointer(this); }
/** * Create a new factory * * @return the factory */ public static XPathContextFactory<EObject> newInstance() { return new JXPathContextFactoryImpl<>(); }
@Override public NodePointer getValuePointer() { return new NullPointer(this, getName()); }
@Override public NodePointer createPath(JXPathContext context) { if (getImmediateNode() == null) { super.createPath(context); baseValue = UNINITIALIZED; value = UNINITIALIZED; } return this; }
@Override public NodePointer getNodePointer() { return includeXmlLang && position == 1 ? new LangAttributePointer(parent) : super.getNodePointer(); }
@Override public void setIndex(int index) { if (this.index == index) { return; } // When dealing with a scalar, index == 0 is equivalent to // WHOLE_COLLECTION, so do not change it. if (this.index != WHOLE_COLLECTION || index != 0 || isCollection()) { super.setIndex(index); value = UNINITIALIZED; } }
/** * Create a NodeIterator. * @param property property name * @param reverse whether to iterate in reverse * @param startWith first pointer to return * @return NodeIterator */ public NodeIterator createNodeIterator(String property, boolean reverse, NodePointer startWith) { return new EStructuralFeatureIterator(this, property, reverse, startWith); }
@Override public String asPath() { if (id != null) { return "id(" + id + ")"; } return parent == null ? "null()" : super.asPath(); }
/** * Set the property index. * @param index property index */ public void setPropertyIndex(int index) { if (propertyIndex != index) { propertyIndex = index; setIndex(WHOLE_COLLECTION); } }