/** * Get the typed value of a given input string. This method assumes that the input value * is valid according to this SimpleType * @param value the string whose typed value is required * @param resolver namespace resolver for namespace-sensitive content * @param nameChecker name checker for XML-version sensitive content */ public SequenceIterator getTypedValue(CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) throws ValidationException { UnfailingIterator iter = new StringTokenIterator(value.toString()); ListTypeMappingFunction map = new ListTypeMappingFunction(); map.resolver = resolver; map.atomicType = (AtomicType)getItemType(); map.nameChecker = nameChecker; return new MappingIterator(iter, map); }
/** * Get the typed value of a given input string. This method assumes that the input value * is valid according to this SimpleType * * @param value the string whose typed value is required * @param resolver namespace resolver for namespace-sensitive content * @param rules the type conversion rules to be used */ /*@NotNull*/ public AtomicSequence getTypedValue(/*@NotNull*/ CharSequence value, NamespaceResolver resolver, ConversionRules rules) throws ValidationException { Whitespace.Tokenizer iter = new Whitespace.Tokenizer(value); ListTypeMappingFunction map = new ListTypeMappingFunction(); map.resolver = resolver; map.atomicType = (AtomicType) getItemType(); map.rules = rules; try { return new AtomicArray(new MappingIterator<>(iter, map)); } catch (XPathException err) { throw new ValidationException(err); // should not happen } }
/** * Get the typed value of a given input string. This method assumes that the input value * is valid according to this SimpleType * * @param value the string whose typed value is required * @param resolver namespace resolver for namespace-sensitive content * @param rules the type conversion rules to be used */ /*@NotNull*/ public AtomicSequence getTypedValue(/*@NotNull*/ CharSequence value, NamespaceResolver resolver, ConversionRules rules) throws ValidationException { Whitespace.Tokenizer iter = new Whitespace.Tokenizer(value); ListTypeMappingFunction map = new ListTypeMappingFunction(); map.resolver = resolver; map.atomicType = (AtomicType) getItemType(); map.rules = rules; try { return new AtomicArray(new MappingIterator<>(iter, map)); } catch (XPathException err) { throw new ValidationException(err); // should not happen } }
/** * Get the typed value of a given input string. This method assumes that the input value * is valid according to this SimpleType * @param value the string whose typed value is required * @param resolver namespace resolver for namespace-sensitive content * @param nameChecker name checker for XML-version sensitive content */ public SequenceIterator getTypedValue(CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) throws ValidationException { UnfailingIterator iter = new StringTokenIterator(value.toString()); ListTypeMappingFunction map = new ListTypeMappingFunction(); map.resolver = resolver; map.atomicType = (AtomicType)getItemType(); map.nameChecker = nameChecker; return new MappingIterator(iter, map); }