public StringToDerivedStringSubtype( ConversionRules rules, AtomicType targetType) { super(rules); this.targetType = targetType; this.whitespaceAction = targetType.getWhitespaceAction(); builtInValidator = ((AtomicType) targetType.getBuiltInBaseType()).getStringConverter(rules); }
public StringToDerivedStringSubtype( ConversionRules rules, AtomicType targetType) { super(rules); this.targetType = targetType; this.whitespaceAction = targetType.getWhitespaceAction(); builtInValidator = ((AtomicType) targetType.getBuiltInBaseType()).getStringConverter(rules); }
private boolean subsumesUnderlyingType(AtomicType type) { BuiltInAtomicType builtIn = type instanceof BuiltInAtomicType ? (BuiltInAtomicType) type : (BuiltInAtomicType) type.getBuiltInBaseType(); while (true) { if (builtIn.isSameType(underlyingType)) { return true; } SchemaType base = builtIn.getBaseType(); if (!(base instanceof BuiltInAtomicType)) { return false; } builtIn = (BuiltInAtomicType) base; } }
private boolean subsumesUnderlyingType(AtomicType type) { BuiltInAtomicType builtIn = type instanceof BuiltInAtomicType ? (BuiltInAtomicType) type : (BuiltInAtomicType) type.getBuiltInBaseType(); while (true) { if (builtIn.isSameType(underlyingType)) { return true; } SchemaType base = builtIn.getBaseType(); if (!(base instanceof BuiltInAtomicType)) { return false; } builtIn = (BuiltInAtomicType) base; } }
/** * During static analysis, if types are known and the collation is known, pre-allocate a comparer * for comparing atomic values. Called by some collating functions during type-checking. The comparer * that is allocated treats NaN as not equal to NaN. * @param type0 the type of the first comparand * @param type1 the type of the second comparand * @param env the static context */ protected void preAllocateComparer(AtomicType type0, AtomicType type1, StaticContext env) { StringCollator collation = getStringCollator(); if (type0 == ErrorType.getInstance() || type1 == ErrorType.getInstance()) { // there will be no instances to compare, so we can use any comparer atomicComparer = EqualityComparer.getInstance(); return; } atomicComparer = GenericAtomicComparer.makeAtomicComparer( (BuiltInAtomicType) type0.getBuiltInBaseType(), (BuiltInAtomicType) type1.getBuiltInBaseType(), stringCollator, env.makeEarlyEvaluationContext()); }
/** * During static analysis, if types are known and the collation is known, pre-allocate a comparer * for comparing atomic values. Called by some collating functions during type-checking. The comparer * that is allocated treats NaN as not equal to NaN. * @param type0 the type of the first comparand * @param type1 the type of the second comparand * @param env the static context */ protected void preAllocateComparer(AtomicType type0, AtomicType type1, StaticContext env) { StringCollator collation = getStringCollator(); if (type0 == ErrorType.getInstance() || type1 == ErrorType.getInstance()) { // there will be no instances to compare, so we can use any comparer atomicComparer = EqualityComparer.getInstance(); return; } atomicComparer = GenericAtomicComparer.makeAtomicComparer( (BuiltInAtomicType) type0.getBuiltInBaseType(), (BuiltInAtomicType) type1.getBuiltInBaseType(), stringCollator, env.makeEarlyEvaluationContext()); }
if (targetType.getBuiltInBaseType() == BuiltInAtomicType.STRING) {
if (targetType.getBuiltInBaseType() == BuiltInAtomicType.STRING) {