}
//public NodeSet ns;
public JPConverter getJPConverter(Class sourceClass) {
if (Node.class.isAssignableFrom(sourceClass) && !(NodeOverNodeInfo.class.isAssignableFrom(sourceClass))) {
return new JPConverter() {
public ValueRepresentation convert(Object obj, XPathContext context) throws XPathException {
return wrapOrUnwrapNode((Node)obj, context.getConfiguration());
}
public ItemType getItemType() {
return AnyNodeTest.getInstance();
}
};
} else if (NodeList.class.isAssignableFrom(sourceClass)) {
return new JPConverter() {
public ValueRepresentation convert(Object obj, XPathContext context) throws XPathException {
Configuration config = context.getConfiguration();
NodeList list = ((NodeList)obj);
final int len = list.getLength();
NodeInfo[] nodes = new NodeInfo[len];
for (int i = 0; i < len; i++) {
nodes[i] = wrapOrUnwrapNode(list.item(i), config);
}
return new SequenceExtent(nodes);
}
public ItemType getItemType() {
return AnyNodeTest.getInstance();
}
public int getCardinality() {
return StaticProperty.ALLOWS_ZERO_OR_MORE;
}
};
} else if (DOMSource.class == sourceClass) {
return new JPConverter() {
public ValueRepresentation convert(Object obj, XPathContext context) throws XPathException {
return unravel((DOMSource)obj, context.getConfiguration());
}
public ItemType getItemType() {