/** * Get the item type of the atomic values that will be produced when an item * of this type is atomized * * @return the item type of the atomic values that will be produced when an item * of this type is atomized */ @Override public PlainType getAtomizedItemType() { return memberType.getPrimaryType().getAtomizedItemType(); }
/** * Get the item type of the atomic values that will be produced when an item * of this type is atomized * * @return the item type of the atomic values that will be produced when an item * of this type is atomized */ @Override public PlainType getAtomizedItemType() { return memberType.getPrimaryType().getAtomizedItemType(); }
private boolean mayInvolveCastToQName(TypeHierarchy th, Expression e1, Expression e2) { SimpleType s1 = (SimpleType) e1.getItemType().getAtomizedItemType(); return (s1 == BuiltInAtomicType.ANY_ATOMIC || s1.isNamespaceSensitive()) && th.relationship(e2.getItemType().getAtomizedItemType(), BuiltInAtomicType.UNTYPED_ATOMIC) != TypeHierarchy.DISJOINT && (e2.getSpecialProperties() & StaticProperty.NOT_UNTYPED_ATOMIC) == 0; }
private boolean mayInvolveCastToQName(TypeHierarchy th, Expression e1, Expression e2) { SimpleType s1 = (SimpleType) e1.getItemType().getAtomizedItemType(); return (s1 == BuiltInAtomicType.ANY_ATOMIC || s1.isNamespaceSensitive()) && th.relationship(e2.getItemType().getAtomizedItemType(), BuiltInAtomicType.UNTYPED_ATOMIC) != TypeHierarchy.DISJOINT && (e2.getSpecialProperties() & StaticProperty.NOT_UNTYPED_ATOMIC) == 0; }
/** * Static analysis: preallocate a comparer if possible */ @Override public void supplyTypeInformation(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType, Expression[] arguments) { ItemType type = arguments[0].getItemType(); argumentType = type.getAtomizedItemType(); if (argumentType instanceof AtomicType) { if (argumentType == BuiltInAtomicType.UNTYPED_ATOMIC) { argumentType = BuiltInAtomicType.DOUBLE; } preAllocateComparer((AtomicType) argumentType, (AtomicType) argumentType, visitor.getStaticContext()); } }
/** * Determine the data type of the expression, if this is known statically */ public ItemType getItemType(TypeHierarchy th) { if (calculator == null) { return BuiltInAtomicType.ANY_ATOMIC; // type is not known statically } else { ItemType t1 = operand0.getItemType(th); if (!(t1 instanceof AtomicType)) { t1 = t1.getAtomizedItemType(); } ItemType t2 = operand1.getItemType(th); if (!(t2 instanceof AtomicType)) { t2 = t2.getAtomizedItemType(); } return calculator.getResultType((AtomicType) t1.getPrimitiveItemType(), (AtomicType) t2.getPrimitiveItemType()); } }
/** * Determine the data type of the expression, if this is known statically */ public ItemType getItemType(TypeHierarchy th) { if (calculator == null) { return BuiltInAtomicType.ANY_ATOMIC; // type is not known statically } else { ItemType t1 = operand0.getItemType(th); if (!(t1 instanceof AtomicType)) { t1 = t1.getAtomizedItemType(); } ItemType t2 = operand1.getItemType(th); if (!(t2 instanceof AtomicType)) { t2 = t2.getAtomizedItemType(); } return calculator.getResultType((AtomicType) t1.getPrimitiveItemType(), (AtomicType) t2.getPrimitiveItemType()); } }
/** * Static analysis: preallocate a comparer if possible */ @Override public void supplyTypeInformation(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType, Expression[] arguments) { ItemType type = arguments[0].getItemType(); argumentType = type.getAtomizedItemType(); if (argumentType instanceof AtomicType) { if (argumentType == BuiltInAtomicType.UNTYPED_ATOMIC) { argumentType = BuiltInAtomicType.DOUBLE; } preAllocateComparer((AtomicType) argumentType, (AtomicType) argumentType, visitor.getStaticContext()); } }
public static String getTypeName(ItemType type) { if (type.isAtomicType()) { return type.getAtomizedItemType().getTypeName().getLocalPart(); } return type.toString(); }
/** * Simplify type so that hierarchy comparison could be accurate. */ private ItemType simplify(ItemType it) { TypeHierarchy th = processor.getUnderlyingConfiguration().getTypeHierarchy(); if (it instanceof CombinedNodeTest) { CombinedNodeTest n = (CombinedNodeTest) it; __log.debug(n.getComponentNodeTests()); return simplify(n.getComponentNodeTests()[1]); } else if (it instanceof NodeTest) { NodeTest n = (NodeTest) it; __log.debug(n); SchemaType t = n.getContentType(); if (t.isSimpleType() || t.equals(AnyType.getInstance())) { AtomicType at = it.getAtomizedItemType(); while (!at.isBuiltInType()) at = at.getSuperType(th).getAtomizedItemType(); return at; } else if (t.isComplexType()) { return n; } else { return AnyItemType.getInstance(); } } else { if (it == null) return null; else return it.getAtomizedItemType(); } }
/** * Determine the data type of the expression, if this is known statically */ /*@NotNull*/ public PlainType getItemType() { if (calculator == null) { return BuiltInAtomicType.ANY_ATOMIC; // type is not known statically } else { ItemType t1 = getLhsExpression().getItemType(); if (!(t1 instanceof AtomicType)) { t1 = t1.getAtomizedItemType(); } ItemType t2 = getRhsExpression().getItemType(); if (!(t2 instanceof AtomicType)) { t2 = t2.getAtomizedItemType(); } return calculator.getResultType((AtomicType) t1.getPrimitiveItemType(), (AtomicType) t2.getPrimitiveItemType()); } }
/** * Determine the data type of the expression, if this is known statically */ /*@NotNull*/ public PlainType getItemType() { if (calculator == null) { return BuiltInAtomicType.ANY_ATOMIC; // type is not known statically } else { ItemType t1 = getLhsExpression().getItemType(); if (!(t1 instanceof AtomicType)) { t1 = t1.getAtomizedItemType(); } ItemType t2 = getRhsExpression().getItemType(); if (!(t2 instanceof AtomicType)) { t2 = t2.getAtomizedItemType(); } return calculator.getResultType((AtomicType) t1.getPrimitiveItemType(), (AtomicType) t2.getPrimitiveItemType()); } }
ItemType t1 = operand0.getItemType(th); if (!(t1 instanceof AtomicType)) { t1 = t1.getAtomizedItemType(); t2 = t2.getAtomizedItemType();
/** * Get the return type, given knowledge of the actual arguments * * @param args the actual arguments supplied * @return the best available item type that the function will return */ @Override public ItemType getResultItemType(Expression[] args) { PlainType ku = args[0].getItemType().getAtomizedItemType(); AtomicType ka; if (ku instanceof AtomicType) { ka = (AtomicType)ku; } else { ka = ku.getPrimitiveItemType(); } return new MapType(ka, SequenceType.makeSequenceType(args[1].getItemType(), args[1].getCardinality())); }
/** * Get the return type, given knowledge of the actual arguments * * @param args the actual arguments supplied * @return the best available item type that the function will return */ @Override public ItemType getResultItemType(Expression[] args) { PlainType ku = args[0].getItemType().getAtomizedItemType(); AtomicType ka; if (ku instanceof AtomicType) { ka = (AtomicType)ku; } else { ka = ku.getPrimitiveItemType(); } return new MapType(ka, SequenceType.makeSequenceType(args[1].getItemType(), args[1].getCardinality())); }
operand.getItemType(th).getAtomizedItemType().getPrimitiveType(), targetType.getPrimitiveType())) { return Literal.makeLiteral(BooleanValue.FALSE);
operand.getItemType(th).getAtomizedItemType().getPrimitiveType(), targetType.getPrimitiveType())) { return Literal.makeLiteral(BooleanValue.FALSE);
argumentType = (BuiltInAtomicType)argument[0].getItemType(th).getAtomizedItemType().getPrimitiveItemType(); Expression e = super.optimize(visitor, contextItemType); if (e != this) {
argumentType = (BuiltInAtomicType)argument[0].getItemType(th).getAtomizedItemType().getPrimitiveItemType(); Expression e = super.optimize(visitor, contextItemType); if (e != this) {
ItemType sourceItemType = operand.getItemType(); AtomicType atomizedType = (AtomicType) sourceItemType.getAtomizedItemType().getPrimitiveItemType(); if (!(atomizedType == BuiltInAtomicType.ANY_ATOMIC)) { converter = visitor.getConfiguration().getConversionRules().getConverter(atomizedType, getTargetType());