From: Alexey L. <lou...@us...> - 2004-04-20 17:20:52
|
User: loubyansky Date: 04/04/20 10:20:32 Modified: src/main/org/jboss/ejb/plugins/cmp/ejbql Tag: Branch_3_2 ASTPath.java Log: sync up with HEAD Revision Changes Path No revision No revision 1.1.4.2 +82 -48 jboss/src/main/org/jboss/ejb/plugins/cmp/ejbql/ASTPath.java Index: ASTPath.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/ejbql/ASTPath.java,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -r1.1.4.1 -r1.1.4.2 --- ASTPath.java 30 Sep 2003 19:37:46 -0000 1.1.4.1 +++ ASTPath.java 20 Apr 2004 17:20:29 -0000 1.1.4.2 @@ -4,10 +4,11 @@ * Distributable under LGPL license. * See terms of license at gnu.org. */ - + package org.jboss.ejb.plugins.cmp.ejbql; import java.util.List; + import org.jboss.ejb.plugins.cmp.bridge.EntityBridge; import org.jboss.ejb.plugins.cmp.bridge.FieldBridge; import org.jboss.ejb.plugins.cmp.bridge.CMPFieldBridge; @@ -17,97 +18,130 @@ * This abstract syntax node represents a path declaration. * * @author <a href="mailto:da...@da...">Dain Sundstrom</a> - * @version $Revision: 1.1.4.1 $ - */ -public final class ASTPath extends SimpleNode { + * @version $Revision: 1.1.4.2 $ + */ +public final class ASTPath extends SimpleNode +{ public List pathList; public List fieldList; public int type; - public ASTPath(int id) { + public boolean innerJoin; + + public ASTPath(int id) + { super(id); } - public String getPath() { - return (String)pathList.get(pathList.size()-1); + public String getPath() + { + return (String) pathList.get(pathList.size() - 1); } - public String getPath(int i) { - return (String)pathList.get(i); + public String getPath(int i) + { + return (String) pathList.get(i); } - public FieldBridge getField() { - return (FieldBridge)fieldList.get(fieldList.size()-1); + public FieldBridge getField() + { + return (FieldBridge) fieldList.get(fieldList.size() - 1); } - public boolean isCMPField() { - return fieldList.get(fieldList.size()-1) instanceof CMPFieldBridge; + public boolean isCMPField() + { + return fieldList.get(fieldList.size() - 1) instanceof CMPFieldBridge; } - public CMPFieldBridge getCMPField() { - return (CMPFieldBridge)fieldList.get(fieldList.size()-1); + public CMPFieldBridge getCMPField() + { + return (CMPFieldBridge) fieldList.get(fieldList.size() - 1); } - public boolean isCMRField() { - return fieldList.get(fieldList.size()-1) instanceof CMRFieldBridge; + public boolean isCMRField() + { + return fieldList.get(fieldList.size() - 1) instanceof CMRFieldBridge; } - public boolean isCMRField(int i) { + public boolean isCMRField(int i) + { return fieldList.get(i) instanceof CMRFieldBridge; } - public CMRFieldBridge getCMRField() { - return (CMRFieldBridge)fieldList.get(fieldList.size()-1); - } - - public CMRFieldBridge getCMRField(int i) { - return (CMRFieldBridge)fieldList.get(i); - } - - public EntityBridge getEntity() { - Object field = fieldList.get(fieldList.size()-1); - if(field instanceof CMRFieldBridge) { - return ((CMRFieldBridge)field).getRelatedEntity(); - } else if(field instanceof EntityBridge) { - return (EntityBridge)field; - } else { + public CMRFieldBridge getCMRField() + { + return (CMRFieldBridge) fieldList.get(fieldList.size() - 1); + } + + public CMRFieldBridge getCMRField(int i) + { + return (CMRFieldBridge) fieldList.get(i); + } + + public EntityBridge getEntity() + { + Object field = fieldList.get(fieldList.size() - 1); + if(field instanceof CMRFieldBridge) + { + return ((CMRFieldBridge) field).getRelatedEntity(); + } + else if(field instanceof EntityBridge) + { + return (EntityBridge) field; + } + else + { return null; } } - public EntityBridge getEntity(int i) { + public EntityBridge getEntity(int i) + { Object field = fieldList.get(i); - if(field instanceof CMRFieldBridge) { - return ((CMRFieldBridge)field).getRelatedEntity(); - } else if(field instanceof EntityBridge) { - return (EntityBridge)field; - } else { + if(field instanceof CMRFieldBridge) + { + return ((CMRFieldBridge) field).getRelatedEntity(); + } + else if(field instanceof EntityBridge) + { + return (EntityBridge) field; + } + else + { return null; } } - public int size() { + public int size() + { return fieldList.size(); } - public String toString() { - return pathList.get(pathList.size()-1) + " <" + type + ">"; + public String toString() + { + return pathList.get(pathList.size() - 1) + " <" + type + ">"; } - public boolean equals(Object o) { - if(o instanceof ASTPath) { - ASTPath path = (ASTPath)o; + public boolean equals(Object o) + { + if(o instanceof ASTPath) + { + ASTPath path = (ASTPath) o; return path.getPath().equals(getPath()); } return false; } - public int hashCode() { + public int hashCode() + { return getPath().hashCode(); } - /** Accept the visitor. **/ - public Object jjtAccept(JBossQLParserVisitor visitor, Object data) { + /** + * Accept the visitor. * + */ + public Object jjtAccept(JBossQLParserVisitor visitor, Object data) + { return visitor.visit(this, data); } } |