Currently generating out my ejb-jar.xml file and I’ve got code that looks like this:

    currentTable = initCap (att.getValue(“name”));
    os.println(“ttt<descriptio>Entity Bean ( BMP )</descriptio>”);
    os.println(“ttt<display-name>” + currentTable + “</display-name>”);
    os.println(“ttt<ejb-name>” + currentTable + “</ejb-name>”);
    os.println(“ttt<home>com.pharmarketeer.ejb.entity.” + currentTable + “Home</home>”);
    os.println(“ttt<remote>com.pharmarketeer.ejb.entity.” + currentTable + “</remote>”);
    os.println(“ttt<local-home>com.pharmarketeer.ejb.entity.” + currentTable + “LocalHome</local-home>”);
    os.println(“ttt<local>com.pharmarketeer.ejb.entity.” + currentTable + “Local</local>”);
    os.println(“ttt<ejb-class>com.pharmarketeer.ejb.entity.impl.” + currentTable + “Bea</ejb-class>”);
    os.println(“ttt<prim-key-class>” + currentTable + “PK</prim-key-class>”);

Ugly, isn’t it? It’s the naive way of doing it. I’m going to write a little utility that allows me to specify a template and then put tags in it (a la Bentley’s little languages bit in Programming Pearls). What I’d really like is a Java Stream search and replace like PHP has, where I could use regular expressions and useful stuff like that, as far as I can make out the Java RegExp stuff just gives you some kind of true/false reading. Will post it here when I’m done, use or abuse but no warranty!

Hogs and Quiches compadres.