Examples of RegexProcessor


Examples of org.apache.synapse.processors.rules.RegexProcessor

public class RegexProcessorTest extends TestCase {
    public void testRegexProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        sm.setTo(new EndpointReference("http://xmethods.org"));
        RegexProcessor pro = new RegexProcessor();
        pro.setPattern("http://xmethods..\\*");
        boolean result = pro.process(null,sm);
        assertTrue(result);

    }
View Full Code Here

Examples of org.apache.synapse.processors.rules.RegexProcessor

        StageProcessor pro = new StageProcessor();
        boolean result = pro.process(null, sm);
        assertTrue(result);

        List list = new LinkedList();
        list.add(new RegexProcessor());
        list.add(new XPathProcessor());
        pro.setList(list);

        boolean ret = pro.process(null,sm);
View Full Code Here

Examples of org.apache.synapse.processors.rules.RegexProcessor

  private static final QName REGEX_HEADER_ATT_Q = new QName("message-address");

 

  public Processor createProcessor(SynapseEnvironment se, OMElement el) {
    RegexProcessor rp = new RegexProcessor();
    super.addChildrenAndSetName(se, el, rp);

    OMAttribute patt = el.getAttribute(REGEX_PATTERN_ATT_Q);
    if (patt == null) {
      throw new SynapseException(REGEX + " must have "
          + REGEX_PATTERN_ATT_Q + " attribute: " + el.toString());
    }

    OMAttribute prop = el.getAttribute(REGEX_PROPERTY_ATT_Q);
    OMAttribute head = el.getAttribute(REGEX_HEADER_ATT_Q);
    if (prop == null && head == null) {
      throw new SynapseException(REGEX + " must have either "
          + REGEX_PROPERTY_ATT_Q + " or " + REGEX_HEADER_ATT_Q
          + " attributes: " + el.toString());
    }
    rp.setPattern(patt.getAttributeValue());
    if (prop != null) {
      rp.setPropertyName(prop.getAttributeValue());
    } else {
      String header = head.getAttributeValue();
      rp.setHeaderType(header);
    }
    return rp;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.