示例#1
0
  public static Boolean evaluate(Object stringArgument, Object regexArgument, Navigator navigator) {

    String string = StringFunction.evaluate(stringArgument, navigator);
    String regex = StringFunction.evaluate(regexArgument, navigator);

    return evaluate(string, regex, 0, navigator);
  }
示例#2
0
  public static Boolean evaluate(
      Object stringArg, Object regexArgument, Object flagsArgument, Navigator navigator) {

    String string = StringFunction.evaluate(stringArg, navigator);
    String regex = StringFunction.evaluate(regexArgument, navigator);
    String flagsString = StringFunction.evaluate(flagsArgument, navigator);

    int flags = 0;

    for (int i = 0; i < flagsString.length(); i++) {
      if (flagsString.charAt(i) == 'i') {
        flags &= Pattern.CASE_INSENSITIVE;
      } else if (flagsString.charAt(i) == 'm') {
        flags &= Pattern.MULTILINE;
      } else if (flagsString.charAt(i) == 's') {
        flags &= Pattern.DOTALL;
      } else if (flagsString.charAt(i) == 'x') {
        flags &= Pattern.COMMENTS;
      }
    }

    return evaluate(string, regex, flags, navigator);
  }
示例#3
0
 public static void setObjectValue(Element elem, Object value) {
   if (value instanceof Node) {
     if (value instanceof SOAPElement) {
       // replace element
       copy(elem, (SOAPElement) value);
     } else if (value instanceof Element) {
       // replace element
       copy(elem, (Element) value);
     } else if (value instanceof Document) {
       // replace element
       copy(elem, ((Document) value).getDocumentElement());
     } else {
       // replace content
       setStringValue(elem, ((Node) value).getNodeValue());
     }
   } else if (value instanceof EndpointReference) {
     // replace element
     ((EndpointReference) value).writeServiceRef(elem);
   } else {
     // replace content
     setStringValue(elem, StringFunction.evaluate(value, DocumentNavigator.getInstance()));
   }
 }