localp.set(localName, 0, localName.length);
}
final IPointable temp = VoidPointable.FACTORY.createPointable();
final AttributeNodePointable anp = (AttributeNodePointable) AttributeNodePointable.FACTORY
.createPointable();
final CodedQNamePointable cqp = (CodedQNamePointable) CodedQNamePointable.FACTORY.createPointable();
filter = new INodeFilter() {
@Override
public boolean accept(NodeTreePointable ntp, TaggedValuePointable tvp) {
if (tvp.getTag() != ValueTag.ATTRIBUTE_NODE_TAG) {
return false;
}
tvp.getValue(anp);
anp.getName(cqp);
if (urip != null) {
ntp.getString(cqp.getNamespaceCode(), temp);
if (urip.compareTo(temp) != 0) {
return false;
}
}
if (localp != null) {
ntp.getString(cqp.getLocalCode(), temp);
if (localp.compareTo(temp) != 0) {
return false;
}
}
return true;
}
};
break;
}
case COMMENT:
filter = new INodeFilter() {
@Override
public boolean accept(NodeTreePointable ntp, TaggedValuePointable tvp) {
return tvp.getTag() == ValueTag.COMMENT_NODE_TAG;
}
};
break;
case DOCUMENT:
filter = new INodeFilter() {
@Override
public boolean accept(NodeTreePointable ntp, TaggedValuePointable tvp) {
return tvp.getTag() == ValueTag.DOCUMENT_NODE_TAG;
}
};
break;
case ELEMENT: {
ElementType eType = (ElementType) nodeType;
NameTest nameTest = eType.getNameTest();
byte[] uri = nameTest.getUri();
byte[] localName = nameTest.getLocalName();
final UTF8StringPointable urip = (UTF8StringPointable) (uri == null ? null
: UTF8StringPointable.FACTORY.createPointable());
final UTF8StringPointable localp = (UTF8StringPointable) (localName == null ? null
: UTF8StringPointable.FACTORY.createPointable());
if (uri != null) {
urip.set(uri, 0, uri.length);
}
if (localName != null) {
localp.set(localName, 0, localName.length);
}
final IPointable temp = VoidPointable.FACTORY.createPointable();
final ElementNodePointable enp = (ElementNodePointable) ElementNodePointable.FACTORY.createPointable();
final CodedQNamePointable cqp = (CodedQNamePointable) CodedQNamePointable.FACTORY.createPointable();
filter = new INodeFilter() {
@Override
public boolean accept(NodeTreePointable ntp, TaggedValuePointable tvp) {
if (tvp.getTag() != ValueTag.ELEMENT_NODE_TAG) {
return false;
}
tvp.getValue(enp);
enp.getName(cqp);
if (urip != null) {
ntp.getString(cqp.getNamespaceCode(), temp);
if (urip.compareTo(temp) != 0) {
return false;
}
}
if (localp != null) {
ntp.getString(cqp.getLocalCode(), temp);
if (localp.compareTo(temp) != 0) {
return false;
}
}
return true;