/** Creates a clone of the specified EJBQLASTImpl instance. */
 public EJBQLASTImpl create(EJBQLASTImpl tr) {
   try {
     return (tr == null) ? null : (EJBQLASTImpl) tr.clone();
   } catch (CloneNotSupportedException ex) {
     throw new EJBQLException(
         I18NHelper.getMessage(msgs, "ERR_UnexpectedExceptionClone"), ex); // NOI18N
   }
 }
/**
 * Factory to create and connect EJBQLASTImpl nodes.
 *
 * @author Michael Bouschen
 */
public class EJBQLASTFactory extends ASTFactory {
  /** The singleton EJBQLASTFactory instance. */
  private static EJBQLASTFactory factory = new EJBQLASTFactory();

  /** I18N support. */
  private static final ResourceBundle msgs = I18NHelper.loadBundle(EJBQLASTFactory.class);

  /**
   * Get an instance of EJBQLASTFactory.
   *
   * @return an instance of EJBQLASTFactory
   */
  public static EJBQLASTFactory getInstance() {
    return factory;
  }

  /**
   * Constructor. EJBQLASTFactory is a singleton, please use {@link #getInstance} to get the factory
   * instance.
   */
  protected EJBQLASTFactory() {
    this.theASTNodeTypeClass = EJBQLASTImpl.class;
    this.theASTNodeType = this.theASTNodeTypeClass.getName();
  }

  /** Overwrites superclass method to create the correct AST instance. */
  public AST create() {
    return new EJBQLASTImpl();
  }

  /** Overwrites superclass method to create the correct AST instance. */
  public AST create(AST tr) {
    return create((EJBQLASTImpl) tr);
  }

  /** Creates a clone of the specified EJBQLASTImpl instance. */
  public EJBQLASTImpl create(EJBQLASTImpl tr) {
    try {
      return (tr == null) ? null : (EJBQLASTImpl) tr.clone();
    } catch (CloneNotSupportedException ex) {
      throw new EJBQLException(
          I18NHelper.getMessage(msgs, "ERR_UnexpectedExceptionClone"), ex); // NOI18N
    }
  }
}