private static BuiltInListType makeListType(String namespace, String lname) { BuiltInListType t = new BuiltInListType(StandardNames.getFingerprint(namespace, lname)); BuiltInType.register(t.getFingerprint(), t); return t; }
public String getDescription() { return getDisplayName(); }
/** * Get the name of the type as a StructuredQName * * @return a StructuredQName identifying the type. In the case of an anonymous type, an internally-generated * name is returned */ public StructuredQName getStructuredQName() { return new StructuredQName("xs", NamespaceConstant.SCHEMA, getLocalName()); }
/** * 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 node that is annotated with this schema type. The result of this method will always be consistent with the method * {@link #getTypedValue}. However, this method is often more convenient and may be * more efficient, especially in the common case where the value is expected to be a singleton. * * @param node the node whose typed value is required * @return the typed value. * @since 8.5 */ public Value atomize(NodeInfo node) throws XPathException { return new SequenceExtent(getTypedValue(node)).simplify(); }
/** * 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(); }
/** * Get the name of this type as an EQName, that is, a string in the format Q{uri}local. * * @return an EQName identifying the type. */ public String getEQName() { return "Q{" + NamespaceConstant.SCHEMA + "}" + getName(); }
/** * 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 node that is annotated with this schema type. The result of this method will always be consistent with the method * {@link #getTypedValue}. However, this method is often more convenient and may be * more efficient, especially in the common case where the value is expected to be a singleton. * * @param node the node whose typed value is required * @return the typed value. * @since 8.5 */ public Value atomize(NodeInfo node) throws XPathException { return new SequenceExtent(getTypedValue(node)).simplify(); }
/** * 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(); }
/** * Get the name of this type as an EQName, that is, a string in the format Q{uri}local. * * @return an EQName identifying the type. */ public String getEQName() { return "Q{" + NamespaceConstant.SCHEMA + "}" + getName(); }
private static BuiltInListType makeListType(String namespace, String lname) { BuiltInListType t = new BuiltInListType(StandardNames.getFingerprint(namespace, lname)); BuiltInType.register(t.getFingerprint(), t); return t; }
SimpleType base = getItemType(); StringTokenIterator iter = new StringTokenIterator(value.toString()); ValidationFailure result = null;
/** * Get the typed value of a node that is annotated with this schema type. The result of this method will always be consistent with the method * * @param node the node whose typed value is required * @return the typed value. * @since 8.5 */ public AtomicSequence atomize(/*@NotNull*/ NodeInfo node) throws XPathException { try { return getTypedValue(node.getStringValue(), new InscopeNamespaceResolver(node), node.getConfiguration().getConversionRules()); } catch (ValidationException err) { throw new XPathException("Internal error: value doesn't match its type annotation. " + err.getMessage()); } }
public String getDescription() { return getDisplayName(); }
/** * 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(); }
/** * Get the name of the type as a StructuredQName * * @return a StructuredQName identifying the type. In the case of an anonymous type, an internally-generated * name is returned */ public StructuredQName getStructuredQName() { return new StructuredQName("xs", NamespaceConstant.SCHEMA, getLocalName()); }
private static BuiltInListType makeListType(String namespace, String lname) { BuiltInListType t = new BuiltInListType(StandardNames.getFingerprint(namespace, lname)); BuiltInType.register(t.getFingerprint(), t); return t; }
SimpleType base = getItemType(); StringTokenIterator iter = new StringTokenIterator(value.toString()); ValidationFailure result = null;
/** * Get the typed value of a node that is annotated with this schema type. The result of this method will always be consistent with the method * * @param node the node whose typed value is required * @return the typed value. * @since 8.5 */ public AtomicSequence atomize(/*@NotNull*/ NodeInfo node) throws XPathException { try { return getTypedValue(node.getStringValue(), new InscopeNamespaceResolver(node), node.getConfiguration().getConversionRules()); } catch (ValidationException err) { throw new XPathException("Internal error: value doesn't match its type annotation. " + err.getMessage()); } }