CVS: jfor/src/org/jfor/jfor/converter TemplateBuilder.java,NONE,1.1
Marra Roberto <[email protected]> Wed, 05 Jun 2002 07:15:06 -0700
| Newsgroups | gmane.text.xml.jfor.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/converter In directory usw-pr-cvs1:/tmp/cvs-serv23178 Added Files: TemplateBuilder.java Log Message: initial checkin --- NEW FILE: TemplateBuilder.java --- package org.jfor.jfor.converter; import java.io.IOException; import org.xml.sax.Attributes; import org.jfor.jfor.rtflib.rtfdoc.RtfAttributes; import org.jfor.jfor.rtflib.rtfdoc.RtfTemplate; /*----------------------------------------------------------------------------- * jfor - Open-Source XSL-FO to RTF converter - see www.jfor.org * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is the contents of this java source file, as distributed * on www.sourceforge.net/projects/jfor and/or www.jfor.org. * * The Initial Developer of the Original Code is Andreas Putz, skynamics AG, * München, Germany, [email protected]. * Portions created by Andreas Putz are Copyright (C) 2001 skynamics AG, München, * Andreas Putz. All Rights Reserved. * * Contributor(s): -----------------------------------------------------------------------------*/ public class TemplateBuilder extends AbstractBuilder { private static final String ATTRIB_NAME = "src"; private static final String ATTRIB_RAW_NAME = "jfor:style-template"; /** * Constructor. */ public TemplateBuilder (BuilderContext ctx) { super (ctx); } /** * called by Converter at the start of an element */ public void start (String rawName, Attributes attrs) throws IOException { String fp = getAttribute(attrs, ATTRIB_RAW_NAME, ATTRIB_NAME, true); RtfTemplate.getInstance().setTemplateFilePath (fp); } /** * called by Converter at the end of an element */ public void end () throws IOException { } /** * this builder processes jfor:style-template elements */ public IBuilder getBuilder (BuilderContext ctx, String rawName, Attributes atts) { if (rawName.equals (ATTRIB_RAW_NAME)) { return new TemplateBuilder (ctx); }else { return null; } } } _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm