Exemple #1
0
 private static Value parseTypedReference(URIString pUriStr) throws IllegalArgumentException {
   Value strVal;
   int pos = pUriStr.getPos();
   try {
     strVal = StringValue.parse(pUriStr);
   } catch (IllegalArgumentException e) {
     String msg =
         "Failed to retrieve typed reference string!\n"
             + pUriStr.markPosition()
             + "Nested message is:\n"
             + e.getMessage();
     throw new IllegalArgumentException(msg);
   }
   URIString refUriStr = new URIString(strVal.toString());
   try {
     URI ref = URI.parseRef(refUriStr, true);
     return new ReferenceValue(ref);
   } catch (IllegalArgumentException e) {
     String msg =
         "Failed to parse typed reference value!\n"
             + pUriStr.markPosition(pos)
             + "Nested message is:\n"
             + e.getMessage();
     throw new IllegalArgumentException(msg);
   }
 }
Exemple #2
0
 private static Value parseTypedDateTime(URIString pUriStr) throws IllegalArgumentException {
   Value strVal;
   try {
     strVal = StringValue.parse(pUriStr);
   } catch (IllegalArgumentException e) {
     String msg =
         "Failed to retrieve typed datetime string!\n"
             + pUriStr.markPosition()
             + "Nested message is:\n"
             + e.getMessage();
     throw new IllegalArgumentException(msg);
   }
   return DateTimeValue.parse(strVal.toString(), true);
 }