/** * Get the data type of the items returned * * @param th the type hierarchy cache * @return an integer representing the data type */ public ItemType getItemType(TypeHierarchy th) { // special case the filter [. instance of x] if (filter instanceof InstanceOfExpression && ((InstanceOfExpression)filter).getBaseExpression() instanceof ContextItemExpression) { return ((InstanceOfExpression)filter).getRequiredItemType(); } return start.getItemType(th); }
/** * Get the data type of the items returned * * @param th the type hierarchy cache * @return an integer representing the data type */ public ItemType getItemType(TypeHierarchy th) { // special case the filter [. instance of x] if (filter instanceof InstanceOfExpression && ((InstanceOfExpression)filter).getBaseExpression() instanceof ContextItemExpression) { return ((InstanceOfExpression)filter).getRequiredItemType(); } return start.getItemType(th); }
/** * Get the data type of the items returned * * @param th the type hierarchy cache * @return an integer representing the data type */ public ItemType getItemType(TypeHierarchy th) { // special case the filter [. instance of x] if (filter instanceof InstanceOfExpression && ((InstanceOfExpression)filter).getBaseExpression() instanceof ContextItemExpression) { return ((InstanceOfExpression)filter).getRequiredItemType(); } return start.getItemType(th); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { if (getPredicate() instanceof InstanceOfExpression) { return ((InstanceOfExpression) getPredicate()).getRequiredItemType().getUType(); } else { return UType.ANY; } }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { if (getPredicate() instanceof InstanceOfExpression) { return ((InstanceOfExpression) getPredicate()).getRequiredItemType().getUType(); } else { return UType.ANY; } }
/** * Get an Itemtype that all the items matching this pattern must satisfy */ public ItemType getItemType() { if (getPredicate() instanceof InstanceOfExpression) { InstanceOfExpression ioe = (InstanceOfExpression)getPredicate(); if (ioe.getBaseExpression() instanceof ContextItemExpression) { return ioe.getRequiredItemType(); } } return AnyItemType.getInstance(); }
/** * Get an Itemtype that all the items matching this pattern must satisfy */ public ItemType getItemType() { if (getPredicate() instanceof InstanceOfExpression) { InstanceOfExpression ioe = (InstanceOfExpression)getPredicate(); if (ioe.getBaseExpression() instanceof ContextItemExpression) { return ioe.getRequiredItemType(); } } return AnyItemType.getInstance(); }
private AbstractExpression exprFor (InstanceOfExpression expr) { ItemType type = expr.getRequiredItemType(); String typeExpr; if (type.isPlainType()) { typeExpr = type.toString(); } else if (type instanceof NodeTest) { lux.xpath.NodeTest nodeTest = nodeTestFor((NodeTest)type); typeExpr = nodeTest.toString(); } else { throw new LuxException ("Unsupported node test in instance-of expression: " + expr.toString()); } return new InstanceOf(typeExpr, exprFor (expr.getBaseExpression())); }
/** * Get the data type of the items returned * * @return an integer representing the data type */ /*@NotNull*/ public ItemType getItemType() { // special case the expression B[. instance of x] if (getFilter() instanceof InstanceOfExpression && ((InstanceOfExpression) getFilter()).getBaseExpression() instanceof ContextItemExpression) { return ((InstanceOfExpression) getFilter()).getRequiredItemType(); } return getBase().getItemType(); }
/** * Get the data type of the items returned * * @return an integer representing the data type */ /*@NotNull*/ public ItemType getItemType() { // special case the expression B[. instance of x] if (getFilter() instanceof InstanceOfExpression && ((InstanceOfExpression) getFilter()).getBaseExpression() instanceof ContextItemExpression) { return ((InstanceOfExpression) getFilter()).getRequiredItemType(); } return getBase().getItemType(); }