Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/rxm.git

Abstracted inner and outer join maps into superclass.

AuthorDave Jarvis <email>
Date2015-03-14 14:25:34 GMT-0700
Commita36f9fb6a1b6ad628bc2711c1ae7a5f2d2176fdd
Parentab6658a
source/java/com/whitemagicsoftware/rxm/tree/xml/AttributeMapContext.java
@Override
public Token getStart() {
+ String
+ tableName = getParentTableText(),
+ columnName = getColumnText(),
+ attributeName = getAttributeText();
+
return new Token(
String.format( ",%s", hasPrecedingPayload() ?
- nextAttribute( getParentTableText(), getColumnText(), getAttributeText() ) :
- firstAttribute( getParentTableText(), getColumnText(), getAttributeText() )
+ nextAttribute( tableName, columnName, attributeName ) :
+ firstAttribute( tableName, columnName, attributeName )
)
);
source/java/com/whitemagicsoftware/rxm/tree/xml/EmptyListContext.java
-package com.whitemagicsoftware.rxm.tree.xml;
-
-import com.whitemagicsoftware.rxm.tree.Payload;
-import com.whitemagicsoftware.rxm.tree.Tree;
-
-import org.antlr.v4.runtime.ParserRuleContext;
-
-/**
- * Root context for a FromClauseList.
- */
-public class EmptyListContext extends PayloadParserRuleContext {
- /**
- * Sets the payload to null.
- */
- public EmptyListContext() {
- this( null );
- }
-
- /**
- * Calls the superclass to construct this context instance.
- *
- * @param payload Passed to the superclass.
- */
- public EmptyListContext( Payload payload ) {
- super( payload );
- }
-}
-
source/java/com/whitemagicsoftware/rxm/tree/xml/InnerMapContext.java
* <code>INNER JOIN</code> expression.
*/
-public class InnerMapContext extends PayloadParserRuleContext {
+public class InnerMapContext extends JoinMapContext {
/**
* Default constructor (calls super).
*
* @param ctx The payload that associates the parser rule context with
* the abstract syntax tree.
*/
public InnerMapContext( Payload ctx ) {
super( ctx );
- }
-
- /**
- * Returns the starting text for an INNER JOIN clause.
- */
- @Override
- public Token getStart() {
- return new Token( "INNER JOIN" );
}
- /**
- * Returns the ending text for an INNER JOIN clause.
- */
- @Override
- public Token getStop() {
- return new Token( "" );
+ public String getJoinType() {
+ return "INNER";
}
}
Delta10 lines added, 45 lines removed, 35-line decrease