/** * Produce a representation of this type name for use in error messages. * Where this is a QName, it will use conventional prefixes */ public String toString(NamePool pool) { return getDisplayName(); }
/** * Produce a representation of this type name for use in error messages. * Where this is a QName, it will use conventional prefixes */ public String toString(NamePool pool) { return getDisplayName(); }
public String toString() { return getDisplayName(); }
public String toString() { return getDisplayName(); }
public String getDescription() { return getDisplayName(); }
public String getDescription() { return getDisplayName(); }
public String getDescription() { return getDisplayName(); }
public String getDescription() { return getDisplayName(); }
public String toString() { return getDisplayName(); }
public String toString() { return getDisplayName(); }
/** * Determine whether a given built-in type is disallowed in a given environment, and in the * case where it is disallowed, return a string explaining why * * @param pack the containing package * @param type the built-in type to be tested * @return null if the type is OK to be used; or a string explaining why not. */ public static String whyDisallowedType(PackageData pack, BuiltInAtomicType type) { if (!type.isAllowedInXSD10() && pack.getConfiguration().getXsdVersion() == Configuration.XSD10) { return "The built-in atomic type " + type.getDisplayName() + " is not recognized unless XSD 1.1 is enabled"; } return null; }
/** * Determine whether a given built-in type is disallowed in a given environment, and in the * case where it is disallowed, return a string explaining why * * @param pack the containing package * @param type the built-in type to be tested * @return null if the type is OK to be used; or a string explaining why not. */ public static String whyDisallowedType(PackageData pack, BuiltInAtomicType type) { if (!type.isAllowedInXSD10() && pack.getConfiguration().getXsdVersion() == Configuration.XSD10) { return "The built-in atomic type " + type.getDisplayName() + " is not recognized unless XSD 1.1 is enabled"; } return null; }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method checks that the value is valid against the rules for a given subtype. * * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ /*@Nullable*/ public ValidationFailure validateAgainstSubType(/*@NotNull*/ BuiltInAtomicType type) { if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method checks that the value is valid against the rules for a given subtype. * * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ public ValidationFailure validateAgainstSubType(BuiltInAtomicType type) { if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method checks that the value is valid against the rules for a given subtype. * * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ public ValidationFailure validateAgainstSubType(BuiltInAtomicType type) { if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method checks that the value is valid against the rules for a given subtype. * * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ /*@Nullable*/ public ValidationFailure validateAgainstSubType(/*@NotNull*/ BuiltInAtomicType type) { if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method sets the required type label. Note that this method modifies the value in situ. * * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ /*@Nullable*/ public ValidationFailure convertToSubType(/*@NotNull*/ BuiltInAtomicType type, boolean validate) { if (!validate) { typeLabel = type; return null; } if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method sets the required type label. Note that this method modifies the value in situ. * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ public ValidationFailure convertToSubType(BuiltInAtomicType type, boolean validate) { if (!validate) { typeLabel = type; return null; } if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * This class allows subtypes of xs:integer to be held, as well as xs:integer values. * This method sets the required type label. Note that this method modifies the value in situ. * @param type the subtype of integer required * @return null if the operation succeeds, or a ValidationException if the value is out of range */ public ValidationFailure convertToSubType(BuiltInAtomicType type, boolean validate) { if (!validate) { typeLabel = type; return null; } if (IntegerValue.checkBigRange(value, type)) { typeLabel = type; return null; } else { ValidationFailure err = new ValidationFailure( "Integer value is out of range for subtype " + type.getDisplayName()); err.setErrorCode("FORG0001"); return err; } }
/** * Convert a QName to target data type * @param requiredType an integer identifying the required atomic type * @param context XPath dynamic context * @return an AtomicValue, a value of the required type; or an ErrorValue */ public ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context) { switch (requiredType.getPrimitiveType()) { case StandardNames.XS_ANY_ATOMIC_TYPE: case StandardNames.XS_QNAME: return this; case StandardNames.XS_STRING: return new StringValue(getStringValue()); case StandardNames.XS_UNTYPED_ATOMIC: return new UntypedAtomicValue(getStringValue()); default: ValidationFailure err = new ValidationFailure("Cannot convert QName to " + requiredType.getDisplayName()); err.setErrorCode("XPTY0004"); return err; } }