| | +package com.whitemagicsoftware.rxm.tree.xml; |
| | + |
| | +import com.whitemagicsoftware.rxm.grammar.QueryParser; |
| | +import com.whitemagicsoftware.rxm.tree.Payload; |
| | +import com.whitemagicsoftware.rxm.tree.Token; |
| | + |
| | +import org.antlr.v4.runtime.ParserRuleContext; |
| | + |
| | +/** |
| | + * Superclass for common behaviour between INNER and OUTER JOIN clauses. |
| | + */ |
| | +public abstract class JoinMapContext extends PayloadParserRuleContext { |
| | + /** |
| | + * Default constructor (calls super). |
| | + * |
| | + * @param initPayload The payload that associates the parser rule context |
| | + * with the abstract syntax tree. |
| | + */ |
| | + public JoinMapContext( Payload initPayload ) { |
| | + super( initPayload); |
| | + } |
| | + |
| | + public abstract String getJoinType(); |
| | + |
| | + /** |
| | + * Returns the starting text for an OUTER JOIN clause. |
| | + */ |
| | + @Override |
| | + public Token getStart() { |
| | + ParserRuleContext ctx = getParserRuleContext(); |
| | + |
| | + |
| | + |
| | + return new Token( String.format( "%s JOIN %s", getJoinType(), ctx.getText() ) ); |
| | + } |
| | + |
| | + /** |
| | + * Returns the ending text for an OUTER JOIN clause. |
| | + */ |
| | + @Override |
| | + public Token getStop() { |
| | + return new Token( "" ); |
| | + } |
| | +} |
| | + |
| | |