Class XMLDatatypeUtil

java.lang.Object
org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil

public class XMLDatatypeUtil extends Object
Provides methods for handling the standard XML Schema datatypes.
Author:
Arjohn Kampman
  • Field Details Link icon

  • Constructor Details Link icon

    • XMLDatatypeUtil Link icon

      public XMLDatatypeUtil()
  • Method Details Link icon

    • isPrimitiveDatatype Link icon

      public static boolean isPrimitiveDatatype(IRI datatype)
      Checks whether the supplied datatype is a primitive XML Schema datatype.
      Parameters:
      datatype -
      Returns:
      true if the datatype is a primitive type
    • isDerivedDatatype Link icon

      public static boolean isDerivedDatatype(IRI datatype)
      Checks whether the supplied datatype is a derived XML Schema datatype.
      Parameters:
      datatype -
      Returns:
      true if the datatype is a derived type
    • isBuiltInDatatype Link icon

      public static boolean isBuiltInDatatype(IRI datatype)
      Checks whether the supplied datatype is a built-in XML Schema datatype.
      Parameters:
      datatype -
      Returns:
      true if it is a primitive or derived XML Schema type
    • isNumericDatatype Link icon

      public static boolean isNumericDatatype(IRI datatype)
      Checks whether the supplied datatype is a numeric datatype, i.e.if it is equal to xsd:float, xsd:double, xsd:decimal or one of the datatypes derived from xsd:decimal.
      Parameters:
      datatype -
      Returns:
      true of it is a decimal or floating point type
    • isDecimalDatatype Link icon

      public static boolean isDecimalDatatype(IRI datatype)
      Checks whether the supplied datatype is equal to xsd:decimal or one of the built-in datatypes that is derived from xsd:decimal.
      Parameters:
      datatype -
      Returns:
      true if it is a decimal datatype
    • isIntegerDatatype Link icon

      public static boolean isIntegerDatatype(IRI datatype)
      Checks whether the supplied datatype is equal to xsd:integer or one of the built-in datatypes that is derived from xsd:integer.
      Parameters:
      datatype -
      Returns:
      true if it is an integer type
    • isFloatingPointDatatype Link icon

      public static boolean isFloatingPointDatatype(IRI datatype)
      Checks whether the supplied datatype is equal to xsd:float or xsd:double.
      Parameters:
      datatype -
      Returns:
      true if it is a floating point type
    • isCalendarDatatype Link icon

      public static boolean isCalendarDatatype(IRI datatype)
      Checks whether the supplied datatype is equal to xsd:dateTime, xsd:date, xsd:time, xsd:gYearMonth, xsd:gMonthDay, xsd:gYear, xsd:gMonth or xsd:gDay.These are the primitive datatypes that represent dates and/or times.
      Parameters:
      datatype -
      Returns:
      true if it is a calendar type
      See Also:
    • isDurationDatatype Link icon

      public static boolean isDurationDatatype(IRI datatype)
      Checks whether the supplied datatype is equal to xsd:duration, xsd:dayTimeDuration, xsd:yearMonthDuration. These are the datatypes that represents durations.
      Parameters:
      datatype -
      Returns:
      true if it is a duration type
      See Also:
    • isOrderedDatatype Link icon

      public static boolean isOrderedDatatype(IRI datatype)
      Checks whether the supplied datatype is ordered.The values of an ordered datatype can be compared to each other using operators like < and >.
      Parameters:
      datatype -
      Returns:
      true if the datatype is ordered
    • isValidValue Link icon

      public static boolean isValidValue(String value, IRI datatype)
      Verifies if the supplied lexical value is valid for the given datatype.
      Parameters:
      value - a lexical value
      datatype - an XML Schema datatatype.
      Returns:
      true if the supplied lexical value is valid, false otherwise.
    • isValidValue Link icon

      public static boolean isValidValue(String value, CoreDatatype datatype)
    • isValidValue Link icon

      public static boolean isValidValue(String value, CoreDatatype.XSD datatype)
    • isValidDecimal Link icon

      public static boolean isValidDecimal(String value)
      Verifies if the supplied lexical value is a valid decimal or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidInteger Link icon

      public static boolean isValidInteger(String value)
      Verifies if the supplied lexical value is a valid integer or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidNegativeInteger Link icon

      public static boolean isValidNegativeInteger(String value)
      Verifies if the supplied lexical value is a valid negative integer or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidNonPositiveInteger Link icon

      public static boolean isValidNonPositiveInteger(String value)
      Verifies if the supplied lexical value is a valid non-positive integer or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidNonNegativeInteger Link icon

      public static boolean isValidNonNegativeInteger(String value)
      Verifies if the supplied lexical value is a valid non-negative integer or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidPositiveInteger Link icon

      public static boolean isValidPositiveInteger(String value)
      Verifies if the supplied lexical value is a valid positive integer or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidLong Link icon

      public static boolean isValidLong(String value)
      Verifies if the supplied lexical value is a valid long or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidInt Link icon

      public static boolean isValidInt(String value)
      Verifies if the supplied lexical value is a valid integer or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidShort Link icon

      public static boolean isValidShort(String value)
      Verifies if the supplied lexical value is a valid short or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidByte Link icon

      public static boolean isValidByte(String value)
      Verifies if the supplied lexical value is a valid byte or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidUnsignedLong Link icon

      public static boolean isValidUnsignedLong(String value)
      Verifies if the supplied lexical value is a valid unsigned long or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidUnsignedInt Link icon

      public static boolean isValidUnsignedInt(String value)
      Verifies if the supplied lexical value is a valid unsigned int.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidUnsignedShort Link icon

      public static boolean isValidUnsignedShort(String value)
      Verifies if the supplied lexical value is a valid unsigned short or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidUnsignedByte Link icon

      public static boolean isValidUnsignedByte(String value)
      Verifies if the supplied lexical value is a valid unsigned byte or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidFloat Link icon

      public static boolean isValidFloat(String value)
      Verifies if the supplied lexical value is a valid float or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidDouble Link icon

      public static boolean isValidDouble(String value)
      Verifies if the supplied lexical value is a valid double or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidBoolean Link icon

      public static boolean isValidBoolean(String value)
      Verifies if the supplied lexical value is a valid boolean or not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidDuration Link icon

      public static boolean isValidDuration(String value)
      Verifies if the supplied lexical value is a valid duration.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidDayTimeDuration Link icon

      public static boolean isValidDayTimeDuration(String value)
      Verifies if the supplied lexical value is a valid day-time duration ot not.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidYearMonthDuration Link icon

      public static boolean isValidYearMonthDuration(String value)
      Verifies if the supplied lexical value is a valid year-month duration.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidDateTime Link icon

      public static boolean isValidDateTime(String value)
      Verifies if the supplied lexical value is a valid date-time.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidDateTimeStamp Link icon

      public static boolean isValidDateTimeStamp(String value)
      Verifies if the supplied lexical value is a valid date-timestamp.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidDate Link icon

      public static boolean isValidDate(String value)
      Determines if the supplied value is a valid xsd:date string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidTime Link icon

      public static boolean isValidTime(String value)
      Determines if the supplied value is a valid xsd:time string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidGDay Link icon

      public static boolean isValidGDay(String value)
      Determines if the supplied value is a valid xsd:gDay string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidGMonth Link icon

      public static boolean isValidGMonth(String value)
      Determines if the supplied value is a valid xsd:gMonth string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidGMonthDay Link icon

      public static boolean isValidGMonthDay(String value)
      Determines if the supplied value is a valid xsd:gMonthDay string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidGYear Link icon

      public static boolean isValidGYear(String value)
      Determines if the supplied value is a valid xsd:gYear string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidGYearMonth Link icon

      public static boolean isValidGYearMonth(String value)
      Determines if the supplied value is a valid xsd:gYearMonth string.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidQName Link icon

      public static boolean isValidQName(String value)
      Determines if the supplied value is a valid xsd:QName string. Note that this method only checks for syntax errors in the supplied string itself. It does not validate that the prefix is a declared and in-scope namespace prefix.
      Parameters:
      value -
      Returns:
      true if valid, false otherwise
    • isValidAnyURI Link icon

      public static boolean isValidAnyURI(String value)
      Determines if the supplied value is an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track.
      Parameters:
      value -
      Returns:
      true if a valid IRI, false otherwise
    • normalize Link icon

      public static String normalize(String value, IRI datatype)
      Normalizes the supplied value according to the normalization rules for the supplied datatype.
      Parameters:
      value - The value to normalize.
      datatype - The value's datatype.
      Returns:
      The normalized value if there are any (supported) normalization rules for the supplied datatype, or the original supplied value otherwise.
      Throws:
      IllegalArgumentException - If the supplied value is illegal considering the supplied datatype.
    • normalize Link icon

      public static String normalize(String value, CoreDatatype.XSD datatype)
    • normalizeBoolean Link icon

      public static String normalizeBoolean(String value)
      Normalizes a boolean value to its canonical representation. More specifically, the values 1 and 0 will be normalized to the canonical values true and false, respectively. Supplied canonical values will remain as is.
      Parameters:
      value - The boolean value to normalize.
      Returns:
      The normalized value.
      Throws:
      IllegalArgumentException - If the supplied value is not a legal boolean.
    • normalizeDecimal Link icon

      public static String normalizeDecimal(String decimal)
      Normalizes a decimal to its canonical representation. For example: 120 becomes 120.0, +.3 becomes 0.3, 00012.45000 becomes 12.45 and -.0 becomes 0.0.
      Parameters:
      decimal - The decimal to normalize.
      Returns:
      The canonical representation of decimal.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal decimal.
    • normalizeInteger Link icon

      public static String normalizeInteger(String value)
      Normalizes an integer to its canonical representation. For example: +120 becomes 120 and 00012 becomes 12.
      Parameters:
      value - The value to normalize.
      Returns:
      The canonical representation of value.
      Throws:
      IllegalArgumentException - If the supplied value is not a legal integer.
    • normalizeNegativeInteger Link icon

      public static String normalizeNegativeInteger(String value)
      Normalizes an xsd:negativeInteger.
    • normalizeNonPositiveInteger Link icon

      public static String normalizeNonPositiveInteger(String value)
      Normalizes an xsd:nonPositiveInteger.
    • normalizeNonNegativeInteger Link icon

      public static String normalizeNonNegativeInteger(String value)
      Normalizes an xsd:nonNegativeInteger.
    • normalizePositiveInteger Link icon

      public static String normalizePositiveInteger(String value)
      Normalizes an xsd:positiveInteger.
    • normalizeLong Link icon

      public static String normalizeLong(String value)
      Normalizes an xsd:long.
    • normalizeInt Link icon

      public static String normalizeInt(String value)
      Normalizes an xsd:int.
    • normalizeShort Link icon

      public static String normalizeShort(String value)
      Normalizes an xsd:short.
    • normalizeByte Link icon

      public static String normalizeByte(String value)
      Normalizes an xsd:byte.
    • normalizeUnsignedLong Link icon

      public static String normalizeUnsignedLong(String value)
      Normalizes an xsd:unsignedLong.
    • normalizeUnsignedInt Link icon

      public static String normalizeUnsignedInt(String value)
      Normalizes an xsd:unsignedInt.
    • normalizeUnsignedShort Link icon

      public static String normalizeUnsignedShort(String value)
      Normalizes an xsd:unsignedShort.
    • normalizeUnsignedByte Link icon

      public static String normalizeUnsignedByte(String value)
      Normalizes an xsd:unsignedByte.
    • normalizeFloat Link icon

      public static String normalizeFloat(String value)
      Normalizes a float to its canonical representation.
      Parameters:
      value - The value to normalize.
      Returns:
      The canonical representation of value.
      Throws:
      IllegalArgumentException - If the supplied value is not a legal float.
    • normalizeDouble Link icon

      public static String normalizeDouble(String value)
      Normalizes a double to its canonical representation.
      Parameters:
      value - The value to normalize.
      Returns:
      The canonical representation of value.
      Throws:
      IllegalArgumentException - If the supplied value is not a legal double.
    • normalizeFPNumber Link icon

      public static String normalizeFPNumber(String value)
      Normalizes a floating point number to its canonical representation.
      Parameters:
      value - The value to normalize.
      Returns:
      The canonical representation of value.
      Throws:
      IllegalArgumentException - If the supplied value is not a legal floating point number.
    • normalizeDateTime Link icon

      public static String normalizeDateTime(String value)
      Normalizes an xsd:dateTime.
      Parameters:
      value - The value to normalize.
      Returns:
      The normalized value.
      Throws:
      IllegalArgumentException - If the supplied value is not a legal xsd:dateTime value.
    • collapseWhiteSpace Link icon

      public static String collapseWhiteSpace(String s)
      Replaces all contiguous sequences of #x9 (tab), #xA (line feed) and #xD (carriage return) with a single #x20 (space) character, and removes any leading and trailing whitespace characters, as specified for whiteSpace facet collapse.
      Parameters:
      s -
      Returns:
      new string
    • compare Link icon

      public static int compare(String value1, String value2, IRI datatype)
    • compareDecimals Link icon

      public static int compareDecimals(String dec1, String dec2)
      Compares two decimals to eachother.
      Parameters:
      dec1 -
      dec2 -
      Returns:
      A negative number if dec1 is smaller than dec2, 0 if they are equal, or positive (>0) if dec1 is larger than dec2.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal decimal.
    • compareCanonicalDecimals Link icon

      public static int compareCanonicalDecimals(String dec1, String dec2)
      Compares two canonical decimals to each other.
      Parameters:
      dec1 -
      dec2 -
      Returns:
      A negative number if dec1 is smaller than dec2, 0 if they are equal, or positive (>0) if dec1 is larger than dec2. The result is undefined when one or both of the arguments is not a canonical decimal.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal decimal.
    • compareIntegers Link icon

      public static int compareIntegers(String int1, String int2)
      Compares two integers to each other.
      Parameters:
      int1 -
      int2 -
      Returns:
      A negative number if int1 is smaller than int2, 0 if they are equal, or positive (>0) if int1 is larger than int2.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal integer.
    • compareCanonicalIntegers Link icon

      public static int compareCanonicalIntegers(String int1, String int2)
      Compares two canonical integers to each other.
      Parameters:
      int1 -
      int2 -
      Returns:
      A negative number if int1 is smaller than int2, 0 if they are equal, or positive (>0) if int1 is larger than int2. The result is undefined when one or both of the arguments is not a canonical integer.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal integer.
    • compareNegativeIntegers Link icon

      public static int compareNegativeIntegers(String int1, String int2)
    • compareNonPositiveIntegers Link icon

      public static int compareNonPositiveIntegers(String int1, String int2)
    • compareNonNegativeIntegers Link icon

      public static int compareNonNegativeIntegers(String int1, String int2)
    • comparePositiveIntegers Link icon

      public static int comparePositiveIntegers(String int1, String int2)
    • compareLongs Link icon

      public static int compareLongs(String int1, String int2)
    • compareInts Link icon

      public static int compareInts(String int1, String int2)
    • compareShorts Link icon

      public static int compareShorts(String int1, String int2)
    • compareBytes Link icon

      public static int compareBytes(String int1, String int2)
    • compareUnsignedLongs Link icon

      public static int compareUnsignedLongs(String int1, String int2)
    • compareUnsignedInts Link icon

      public static int compareUnsignedInts(String int1, String int2)
    • compareUnsignedShorts Link icon

      public static int compareUnsignedShorts(String int1, String int2)
    • compareUnsignedBytes Link icon

      public static int compareUnsignedBytes(String int1, String int2)
    • compareFloats Link icon

      public static int compareFloats(String float1, String float2)
      Compares two floats to each other.
      Parameters:
      float1 -
      float2 -
      Returns:
      A negative number if float1 is smaller than float2, 0 if they are equal, or positive (>0) if float1 is larger than float2.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal float or if NaN is compared to a float other than NaN.
    • compareCanonicalFloats Link icon

      public static int compareCanonicalFloats(String float1, String float2)
      Compares two canonical floats to each other.
      Parameters:
      float1 -
      float2 -
      Returns:
      A negative number if float1 is smaller than float2, 0 if they are equal, or positive (>0) if float1 is larger than float2. The result is undefined when one or both of the arguments is not a canonical float.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal float or if NaN is compared to a float other than NaN.
    • compareDoubles Link icon

      public static int compareDoubles(String double1, String double2)
      Compares two doubles to each other.
      Parameters:
      double1 -
      double2 -
      Returns:
      A negative number if double1 is smaller than double2, 0 if they are equal, or positive (>0) if double1 is larger than double2.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal double or if NaN is compared to a double other than NaN.
    • compareCanonicalDoubles Link icon

      public static int compareCanonicalDoubles(String double1, String double2)
      Compares two canonical doubles to eachother.
      Parameters:
      double1 -
      double2 -
      Returns:
      A negative number if double1 is smaller than double2, 0 if they are equal, or positive (>0) if double1 is larger than double2. The result is undefined when one or both of the arguments is not a canonical double.
      Throws:
      IllegalArgumentException - If one of the supplied strings is not a legal double or if NaN is compared to a double other than NaN.
    • compareFPNumbers Link icon

      public static int compareFPNumbers(String fp1, String fp2)
      Compares two floating point numbers to eachother.
      Parameters:
      fp1 -
      fp2 -
      Returns:
      A negative number if float1 is smaller than float2, 0 if they are equal, or positive (>0) if float1 is larger than float2. @throws IllegalArgumentException If one of the supplied strings is not a legal floating point number or if NaN is compared to a floating point number other than NaN.
    • compareCanonicalFPNumbers Link icon

      public static int compareCanonicalFPNumbers(String float1, String float2)
      Compares two canonical floating point numbers to each other.
      Parameters:
      float1 -
      float2 -
      Returns:
      A negative number if float1 is smaller than float2, 0 if they are equal, or positive (>0) if float1 is larger than float2. The result is undefined when one or both of the arguments is not a canonical floating point number. @throws IllegalArgumentException If one of the supplied strings is not a legal floating point number or if NaN is compared to a floating point number other than NaN.
    • compareDateTime Link icon

      public static int compareDateTime(String value1, String value2)
      Compares two dateTime objects. Important: The comparison only works if both values have, or both values don't have specified a valid value for the timezone.
      Parameters:
      value1 - An xsd:dateTime value.
      value2 - An xsd:dateTime value.
      Returns:
      -1 if value1 is before value2 (i.e. if the dateTime object represented by value1 is before the dateTime object represented by value2), 0 if both are equal and 1 if value2 is before value1
      .
    • parseBoolean Link icon

      public static boolean parseBoolean(String s)
      Parses the supplied xsd:boolean string and returns its value.
      Parameters:
      s - A string representation of an xsd:boolean value.
      Returns:
      The boolean value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:boolean value.
    • parseByte Link icon

      public static byte parseByte(String s)
      Parses the supplied xsd:byte string and returns its value.
      Parameters:
      s - A string representation of an xsd:byte value.
      Returns:
      The byte value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:byte value.
    • parseShort Link icon

      public static short parseShort(String s)
      Parses the supplied xsd:short string and returns its value.
      Parameters:
      s - A string representation of an xsd:short value.
      Returns:
      The short value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:short value.
    • parseInt Link icon

      public static int parseInt(String s)
      Parses the supplied xsd:int strings and returns its value.
      Parameters:
      s - A string representation of an xsd:int value.
      Returns:
      The int value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:int value.
    • parseLong Link icon

      public static long parseLong(String s)
      Parses the supplied xsd:long string and returns its value.
      Parameters:
      s - A string representation of an xsd:long value.
      Returns:
      The long value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:long value.
    • parseFloat Link icon

      public static float parseFloat(String s)
      Parses the supplied xsd:float string and returns its value.
      Parameters:
      s - A string representation of an xsd:float value.
      Returns:
      The float value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:float value.
    • parseDouble Link icon

      public static double parseDouble(String s)
      Parses the supplied xsd:double string and returns its value.
      Parameters:
      s - A string representation of an xsd:double value.
      Returns:
      The double value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:double value.
    • parseInteger Link icon

      public static BigInteger parseInteger(String s)
      Parses the supplied xsd:integer string and returns its value.
      Parameters:
      s - A string representation of an xsd:integer value.
      Returns:
      The integer value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:integer value.
    • parseDecimal Link icon

      public static BigDecimal parseDecimal(String s)
      Parses the supplied decimal/floating point string and returns its value.
      Parameters:
      s - A string representation of an xsd:decimal or xsd:double value.
      Returns:
      The decimal/floating point value represented by the supplied string argument.
      Throws:
      NumberFormatException - If the supplied string is not a valid xsd:decimal or xsd:double value.
    • parseCalendar Link icon

      public static XMLGregorianCalendar parseCalendar(String s)
      Parses the supplied calendar value string and returns its value.
      Parameters:
      s - A string representation of an xsd:dateTime, xsd:time, xsd:date, xsd:gYearMonth, xsd:gMonthDay, xsd:gYear, xsd:gMonth or xsd:gDay value.
      Returns:
      The calendar value represented by the supplied string argument.
      Throws:
      IllegalArgumentException - If the supplied string is not a valid calendar value.
    • parseDuration Link icon

      public static Duration parseDuration(String s)
      Parses the supplied xsd:duration value string and returns its value.
      Parameters:
      s - A string representation of an xsd:duration value.
      Returns:
      The Duration value represented by the supplied string argument.
      Throws:
      IllegalArgumentException - If the supplied string is not a valid xsd:duration value.
      UnsupportedOperationException - If implementation cannot support requested values. The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An UnsupportedOperationException will be thrown with a message indicating implementation limits if implementation capacities are exceeded.
    • qnameToURI Link icon

      public static IRI qnameToURI(QName qname)
      Maps a datatype QName from the javax.xml.namespace package to an XML Schema 1.0 URI for the corresponding datatype. This method recognizes the XML Schema qname mentioned in DatatypeConstants.

      Note that Java 8 / 11 do not have constants for XML Schema 1.1 datatypes like xsd:dateTimeStamp.

      Parameters:
      qname - One of the XML Schema qnames from DatatypeConstants.
      Returns:
      A URI for the specified datatype.
      Throws:
      IllegalArgumentException - If the supplied qname was not recognized by this method.
      See Also:
    • qnameToCoreDatatype Link icon

      public static CoreDatatype.XSD qnameToCoreDatatype(QName qname)
    • toString Link icon

      public static String toString(Number value)