com.rabbitmq.jms.parse.Parser Maven / Gradle / Ivy
The newest version!
/* Copyright (c) 2013-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. */
package com.rabbitmq.jms.parse;
/**
* A {@link Parser} produces a parse tree of nodes.
*
* Parsing never throws an exception but instead sets a success indicator and error message.
*
*
* @param - type of node in the ParseTree produced
*/
public interface Parser {
/**
* This method returns the parse tree. It is idempotent.
*
* @return a {@link ParseTree ParseTree<Node>} capturing the result of a complete parse attempt.
*/
ParseTree parse();
/**
* This call is idempotent.
* @return true
if the parse completed successfully, otherwise false
, in which case the
* termination message is set.
*/
boolean parseOk();
/**
* This call is idempotent.
* @return a string with a reason for termination. Only valid if {@link #parseOk()} returns false
.
*/
String getErrorMessage();
}