Interface SyntaxIdentifier

All Superinterfaces:
ComponentLifecycle, Condition
All Known Implementing Classes:
AlwaysMatchSyntaxIdentifier, RegexpSyntaxIdentifier, SyntaxIdentifierBase, SyntaxIdentifierImpl, XmlSyntaxIdentifierImpl, XpathNodeIdentifier, XpathSyntaxIdentifier

public interface SyntaxIdentifier extends Condition
Interface used by SyntaxRoutingService.

The contract for this interface is such that isThisSyntax(String) should only return true, if and only if ALL the configured patterns are matched within the document.

Since 3.10.0 this interface extends Condition which means that it can be used as part of the conditional services; if used in such a manner, then configuration is contextual, get/setDestination will be ignored (but may still have to be configured due to validation

See Also:
  • Method Details

    • setDestination

      void setDestination(String dest)
      Set the configured destination.

      This is the value that will be stored against the metadata key specified by SyntaxRoutingService.

      Parameters:
      dest - the destination.
    • getDestination

      String getDestination()
      Get the configured destination.
      Returns:
      the destination.
    • isThisSyntax

      boolean isThisSyntax(String message) throws ServiceException
      Determine if this SyntaxIdentifer considers the message to match all the configured patterns.
      Parameters:
      message - the message to identify against.
      Returns:
      true if it matches.
      Throws:
      ServiceException - if there was an error with the pattern.
    • evaluate

      default boolean evaluate(AdaptrisMessage msg) throws CoreException
      Default implementation for Condition
      Specified by:
      evaluate in interface Condition
      Throws:
      CoreException
      Implementation Note:
      the default implementation just calls isThisSyntax(String) with the message content.