/** * Create the constructor function. * * @param targetType the type to which the function will convert its input * @param resolver namespace resolver for use if the target type is namespace-sensitive */ public ListConstructorFunction(ListType targetType, NamespaceResolver resolver, boolean allowEmpty) throws MissingComponentException { this.targetType = targetType; this.nsResolver = resolver; this.allowEmpty = allowEmpty; this.memberType = targetType.getItemType(); }
/** * Create the constructor function. * * @param targetType the type to which the function will convert its input * @param resolver namespace resolver for use if the target type is namespace-sensitive */ public ListConstructorFunction(ListType targetType, NamespaceResolver resolver, boolean allowEmpty) throws MissingComponentException { this.targetType = targetType; this.nsResolver = resolver; this.allowEmpty = allowEmpty; this.memberType = targetType.getItemType(); }
/** * Get the static type of the expression */ /*@NotNull*/ public ItemType getItemType() { try { if (targetType.getItemType() instanceof ItemType) { return (ItemType) targetType.getItemType(); } } catch (MissingComponentException e) { // } return BuiltInAtomicType.ANY_ATOMIC; }
return (AtomicType) type; } else if (type instanceof ListType) { SimpleType mem = ((ListType) type).getItemType(); if (mem.isAtomicType()) { return (AtomicType) mem; return (AtomicType) ctype; } else if (ctype instanceof ListType) { SimpleType mem = ((ListType) ctype).getItemType(); if (mem.isAtomicType()) { return (AtomicType) mem;
return (AtomicType) type; } else if (type instanceof ListType) { SimpleType mem = ((ListType) type).getItemType(); if (mem.isAtomicType()) { return (AtomicType) mem; return (AtomicType) ctype; } else if (ctype instanceof ListType) { SimpleType mem = ((ListType) ctype).getItemType(); if (mem.isAtomicType()) { return (AtomicType) mem;
/** * Get the item type of the atomic values that will be produced when an item * of this type is atomized (assuming that atomization succeeds) */ public AtomicType getAtomizedItemType() { SchemaType type = config.getSchemaType(requiredType); if (type.isAtomicType()) { return (AtomicType)type; } else if (type instanceof ListType) { SimpleType mem = ((ListType)type).getItemType(); if (mem.isAtomicType()) { return (AtomicType)mem; } } else if (type instanceof ComplexType && ((ComplexType)type).isSimpleContent()) { SimpleType ctype = ((ComplexType)type).getSimpleContentType(); if (ctype.isAtomicType()) { return (AtomicType)ctype; } else if (ctype instanceof ListType) { SimpleType mem = ((ListType)ctype).getItemType(); if (mem.isAtomicType()) { return (AtomicType)mem; } } } return BuiltInAtomicType.ANY_ATOMIC; }
/** * Get the item type of the atomic values that will be produced when an item * of this type is atomized (assuming that atomization succeeds) */ public AtomicType getAtomizedItemType() { SchemaType type = config.getSchemaType(requiredType); if (type.isAtomicType()) { return (AtomicType)type; } else if (type instanceof ListType) { SimpleType mem = ((ListType)type).getItemType(); if (mem.isAtomicType()) { return (AtomicType)mem; } } else if (type instanceof ComplexType && ((ComplexType)type).isSimpleContent()) { SimpleType ctype = ((ComplexType)type).getSimpleContentType(); if (ctype.isAtomicType()) { return (AtomicType)ctype; } else if (ctype instanceof ListType) { SimpleType mem = ((ListType)ctype).getItemType(); if (mem.isAtomicType()) { return (AtomicType)mem; } } } return BuiltInAtomicType.ANY_ATOMIC; }
return th.isSubType((AtomicType)type, BuiltInAtomicType.IDREF); } else if (type instanceof ListType) { SimpleType itemType = ((ListType)type).getItemType(); return itemType.isAtomicType() && th.isSubType((AtomicType)itemType, BuiltInAtomicType.IDREF);
} else if (type instanceof ListType) { SimpleType itemType = ((ListType)type).getItemType(); return itemType.isAtomicType() && th.isSubType((AtomicType)itemType, BuiltInAtomicType.ID);
return th.isSubType((AtomicType)type, BuiltInAtomicType.IDREF); } else if (type instanceof ListType) { SimpleType itemType = ((ListType)type).getItemType(); return itemType.isAtomicType() && th.isSubType((AtomicType)itemType, BuiltInAtomicType.IDREF);