| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.expr; |
| 9 |
|
| 10 |
import net.sf.saxon.om.Item; |
| 11 |
import net.sf.saxon.om.SequenceIterator; |
| 12 |
import net.sf.saxon.trans.XPathException; |
| 13 |
import net.sf.saxon.type.AnyItemType; |
| 14 |
import net.sf.saxon.type.ItemType; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
public abstract class PseudoExpression extends Expression { |
| 26 |
|
| 27 |
private void cannotEvaluate() throws XPathException { |
| 28 |
throw new XPathException("Cannot evaluate " + getClass().getName()); |
| 29 |
} |
| 30 |
|
| 31 |
@Override |
| 32 |
public int getImplementationMethod() { |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
@Override |
| 37 |
protected final int computeCardinality() { |
| 38 |
return StaticProperty.ALLOWS_ZERO_OR_MORE; |
| 39 |
} |
| 40 |
|
| 41 |
@Override |
| 42 |
public ItemType getItemType() { |
| 43 |
return AnyItemType.getInstance(); |
| 44 |
} |
| 45 |
|
| 46 |
@Override |
| 47 |
public final Item evaluateItem(XPathContext context) throws XPathException { |
| 48 |
cannotEvaluate(); |
| 49 |
return null; |
| 50 |
} |
| 51 |
|
| 52 |
@Override |
| 53 |
public boolean effectiveBooleanValue(XPathContext context) throws XPathException { |
| 54 |
cannotEvaluate(); |
| 55 |
return false; |
| 56 |
} |
| 57 |
|
| 58 |
@Override |
| 59 |
public final CharSequence evaluateAsString(XPathContext context) throws XPathException { |
| 60 |
cannotEvaluate(); |
| 61 |
return ""; |
| 62 |
} |
| 63 |
|
| 64 |
@Override |
| 65 |
public final SequenceIterator<?> iterate(XPathContext context) throws XPathException { |
| 66 |
cannotEvaluate(); |
| 67 |
return null; |
| 68 |
} |
| 69 |
|
| 70 |
@Override |
| 71 |
public void process(XPathContext context) throws XPathException { |
| 72 |
cannotEvaluate(); |
| 73 |
} |
| 74 |
} |
| 75 |
|