1 23 24 25 26 31 32 package com.sun.jdo.spi.persistence.support.ejb.ejbqlc; 33 34 import persistence.antlr.collections.AST; 35 import persistence.antlr.ASTFactory; 36 37 import java.util.ResourceBundle ; 38 import com.sun.jdo.spi.persistence.utility.I18NHelper; 39 40 45 public class EJBQLASTFactory 46 extends ASTFactory 47 { 48 49 private static EJBQLASTFactory factory = new EJBQLASTFactory(); 50 51 52 private final static ResourceBundle msgs = 53 I18NHelper.loadBundle(EJBQLASTFactory.class); 54 55 59 public static EJBQLASTFactory getInstance() 60 { 61 return factory; 62 } 63 64 68 protected EJBQLASTFactory() 69 { 70 this.theASTNodeTypeClass = EJBQLAST.class; 71 this.theASTNodeType = this.theASTNodeTypeClass.getName(); 72 } 73 74 75 public AST create() 76 { 77 return new EJBQLAST(); 78 } 79 80 81 public AST create(AST tr) 82 { 83 return create((EJBQLAST)tr); 84 } 85 86 87 public EJBQLAST create(EJBQLAST tr) 88 { 89 try { 90 return (tr==null) ? null : (EJBQLAST)tr.clone(); 91 } 92 catch(CloneNotSupportedException ex) { 93 throw new EJBQLException( 94 I18NHelper.getMessage(msgs, "ERR_UnexpectedExceptionClone"), ex); } 96 } 97 } 98 99 | Popular Tags |