public ConversionResult convertString( CharSequence input) { try { input = phaseTwo.getTargetType().preprocess(input); } catch (ValidationException err) { return err.getValidationFailure(); } ConversionResult temp = phaseOne.convertString(input); if (temp instanceof ValidationFailure) { return temp; } return phaseTwo.convert((AtomicValue) temp, input); }
@Override public StringToNonStringDerivedType setNamespaceResolver(NamespaceResolver resolver) { return new StringToNonStringDerivedType( (StringConverter) phaseOne.setNamespaceResolver(resolver), (DownCastingConverter) phaseTwo.setNamespaceResolver(resolver)); }
public AtomicValue mapItem(AtomicValue item) throws XPathException { ConversionResult result = converter.convert(item); if (errorCode != null && result instanceof ValidationFailure) { ((ValidationFailure)result).setErrorCode(errorCode); } return result.asAtomic(); } }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(/*@NotNull*/ SchemaType other) { return other.getFingerprint() == getFingerprint(); }
public static OperandUsage typeDeterminedUsage(net.sf.saxon.type.ItemType type) { if (type.isPlainType()) { return OperandUsage.ABSORPTION; } else if (type instanceof NodeTest || type == AnyItemType.getInstance()) { return OperandUsage.NAVIGATION; } else { return OperandUsage.INSPECTION; } }
/** * Get the static type of the expression as a UType, following precisely the type * inference rules defined in the XSLT 3.0 specification. * * @return the static item type of the expression according to the XSLT 3.0 defined rules * @param contextItemType the type of the context item */ @Override public UType getStaticUType(UType contextItemType) { return UType.fromTypeCode(requiredItemType.getPrimitiveType()); }
/** * Ask whether values of this type are atomizable * * @return true unless it is known that these items will be elements with element-only * content, in which case return false * @param th The type hierarchy cache */ public boolean isAtomizable(TypeHierarchy th) { return !(schemaType.isComplexType() && ((ComplexType) schemaType).getVariety() == ComplexType.VARIETY_ELEMENT_ONLY); }
/** * Test whether a given item conforms to this type * * @param item The item to be tested * @param th the type hierarchy cache * @return true if the item is an instance of this type; false otherwise */ @Override public boolean matches(Item item, TypeHierarchy th) throws XPathException { return item instanceof Function && checkAnnotationAssertions(assertions, (Function) item, th.getConfiguration()); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { SequenceType resultType = targetType.getResultTypeOfCast(); SequenceType argType = allowEmpty ? SequenceType.OPTIONAL_ATOMIC : SequenceType.SINGLE_ATOMIC; return new SpecificFunctionType( new SequenceType[]{argType}, resultType); }
/** * Ask whether a built-in type is a numeric type (integer, float, double) * @return true if the type is numeric */ public boolean isNumericType() { ItemType p = getPrimitiveItemType(); return p == NumericType.getInstance() || p == DECIMAL || p == DOUBLE || p == FLOAT || p == INTEGER; }
public AtomicValue mapItem(AtomicValue item) throws XPathException { ConversionResult result = converter.convert(item); if (errorCode != null && result instanceof ValidationFailure) { ((ValidationFailure)result).setErrorCode(errorCode); } return result.asAtomic(); } }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
public static OperandUsage typeDeterminedUsage(net.sf.saxon.type.ItemType type) { if (type.isPlainType()) { return OperandUsage.ABSORPTION; } else if (type instanceof NodeTest || type == AnyItemType.getInstance()) { return OperandUsage.NAVIGATION; } else { return OperandUsage.INSPECTION; } }
public ConversionResult convertString( CharSequence input) { try { input = phaseTwo.getTargetType().preprocess(input); } catch (ValidationException err) { return err.getValidationFailure(); } ConversionResult temp = phaseOne.convertString(input); if (temp instanceof ValidationFailure) { return temp; } return phaseTwo.convert((AtomicValue) temp, input); }
/** * Get the static type of the expression as a UType, following precisely the type * inference rules defined in the XSLT 3.0 specification. * * @return the static item type of the expression according to the XSLT 3.0 defined rules * @param contextItemType the type of the context item */ @Override public UType getStaticUType(UType contextItemType) { return UType.fromTypeCode(requiredItemType.getPrimitiveType()); }
@Override public StringToNonStringDerivedType setNamespaceResolver(NamespaceResolver resolver) { return new StringToNonStringDerivedType( (StringConverter) phaseOne.setNamespaceResolver(resolver), (DownCastingConverter) phaseTwo.setNamespaceResolver(resolver)); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(/*@NotNull*/ SchemaType other) { return other.getFingerprint() == getFingerprint(); }