/** * Return a string representation of this ItemType suitable for use in stylesheet * export files. This differs from the result of toString() in that it will not contain * any references to anonymous types. Note that it may also use the Saxon extended syntax * for union types and tuple types. The default implementation returns the result of * calling {@code toString()}. * * @return the string representation as an instance of the XPath SequenceType construct */ default String toExportString() { return toString(); }
/** * Construct a full error message */ public String composeErrorMessage(ItemType requiredItemType, ItemType suppliedItemType, NamePool pool) { return "Required item type of " + getMessage() + " is " + requiredItemType.toString(pool) + "; supplied value has item type " + suppliedItemType.toString(pool); }
/** * Construct the part of the message giving the required item type * @param requiredItemType the item type required by the context of a particular expression * @param pool the name pool * @return a message of the form "Required item type of X is Y" */ public String composeRequiredMessage(ItemType requiredItemType, NamePool pool) { return "Required item type of " + getMessage() + " is " + requiredItemType.toString(pool); }
/** * The toString() method for an expression attempts to give a representation of the expression * in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath. * In the case of XSLT instructions, the toString() method gives an abstracted view of the syntax */ public String toString() { String typeDesc = requiredItemType.toString(); return "(" + getBaseExpression() + ") treat as " + typeDesc; }
/** * The toString() method for an expression attempts to give a representation of the expression * in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath. * In the case of XSLT instructions, the toString() method gives an abstracted view of the syntax */ public String toString() { String typeDesc = requiredItemType.toString(); return "(" + getBaseExpression() + ") treat as " + typeDesc; }
/** * Construct a full error message * * @param requiredItemType the item type required by the context of a particular expression * @param suppliedItemType the item type inferred by static analysis of an expression * @return a message of the form "Required item type of A is R; supplied value has item type S" */ public String composeErrorMessage(ItemType requiredItemType, ItemType suppliedItemType) { return composeRequiredMessage(requiredItemType) + "; supplied value has item type " + suppliedItemType.toString(); }
/** * Construct the part of the message giving the required item type */ public String composeRequiredMessage(ItemType requiredItemType, NamePool pool) { return "Required item type of " + getMessage() + " is " + requiredItemType.toString(pool); }
private void format(LinkedList<PrimitiveUType> list, FastStringBuffer fsb, Function<ItemType, String> show) { if (list.size() == 1) { fsb.append(list.get(0).toItemType().toString()); } else { fsb.append('('); fsb.append(list.removeFirst().toItemType().toString()); fsb.append('|'); format(list, fsb, show); fsb.append(')'); } }
/** * The toString() method for an expression attempts to give a representation of the expression * in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath. * In the case of XSLT instructions, the toString() method gives an abstracted view of the syntax */ @Override public String toString() { String occ = Cardinality.getOccurrenceIndicator(targetCardinality); return "(" + getBaseExpression().toString() + " instance of " + targetType.toString() + occ + ")"; }
/** * Produce a short string identifying the expression for use in error messages * * @return a short string, sufficient to identify the expression */ @Override public String toShortString() { String occ = Cardinality.getOccurrenceIndicator(targetCardinality); return getBaseExpression().toShortString() + " instance of " + targetType.toString() + occ; }
/** * Produce a short string identifying the expression for use in error messages * * @return a short string, sufficient to identify the expression */ @Override public String toShortString() { String occ = Cardinality.getOccurrenceIndicator(targetCardinality); return getBaseExpression().toShortString() + " instance of " + targetType.toString() + occ; }
public static String getTypeName(ItemType type) { if (type.isAtomicType()) { return type.getAtomizedItemType().getTypeName().getLocalPart(); } return type.toString(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter destination) { destination.startElement("convertItems"); destination.emitAttribute("to", requiredItemType.toString(destination.getNamePool())); operand.explain(destination); destination.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("treat"); out.emitAttribute("as", requiredItemType.toString(out.getConfiguration().getNamePool())); operand.explain(out); out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("treat"); out.emitAttribute("as", requiredItemType.toString(out.getConfiguration().getNamePool())); operand.explain(out); out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter destination) { destination.startElement("instance"); destination.emitAttribute("of", targetType.toString(destination.getNamePool())); destination.emitAttribute("occurs", Cardinality.getOccurrenceIndicator(targetCardinality)); operand.explain(destination); destination.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("convertUntypedAtomic"); out.emitAttribute("to", requiredItemType.toString(out.getConfiguration().getNamePool())); out.emitAttribute("all", allConverted ? "true" : "false"); operand.explain(out); out.endElement(); } protected String displayOperator(Configuration config) {
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("convertUntypedAtomic"); out.emitAttribute("to", requiredItemType.toString(out.getConfiguration().getNamePool())); out.emitAttribute("all", allConverted ? "true" : "false"); operand.explain(out); out.endElement(); } protected String displayOperator(Configuration config) {
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("promoteNumeric"); out.emitAttribute("to", getItemType(out.getTypeHierarchy()).toString(out.getConfiguration().getNamePool())); operand.explain(out); out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("promoteNumeric"); out.emitAttribute("to", getItemType(out.getTypeHierarchy()).toString(out.getConfiguration().getNamePool())); operand.explain(out); out.endElement(); }