/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.mif;
// Java
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.List;
/**
* The is the basis for MIF document elements.
public class MIFElement {
protected String name;
protected String valueStr = null;
- protected ArrayList valueElements = null;
+ protected List valueElements = null;
protected boolean started = false;
protected boolean finish = false;
}
public void addElement(MIFElement el) {
- if(valueElements == null) {
- valueElements = new ArrayList();
+ if (valueElements == null) {
+ valueElements = new java.util.ArrayList();
}
valueElements.add(el);
}
* the finish method is called.
*/
public boolean output(OutputStream os, int indent) throws IOException {
- if(finished) return true;
- if(valueElements == null && valueStr == null) return false;
+ if (finished) {
+ return true;
+ }
+ if (valueElements == null && valueStr == null) {
+ return false;
+ }
String indentStr = "";
- for(int c = 0; c < indent; c++) indentStr += " ";
- if(!started) {
+ for (int c = 0; c < indent; c++) {
+ indentStr += " ";
+ }
+ if (!started) {
os.write((indentStr + "<" + name).getBytes());
- if(valueElements != null)
+ if (valueElements != null) {
os.write(("\n").getBytes());
+ }
started = true;
}
- if(valueElements != null) {
+ if (valueElements != null) {
boolean done = true;
- for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = valueElements.iterator(); iter.hasNext();) {
MIFElement el = (MIFElement)iter.next();
boolean d = el.output(os, indent + 1);
- if(d) {
+ if (d) {
iter.remove();
} else {
done = false;
break;
}
}
- if(!finish || !done) {
+ if (!finish || !done) {
return false;
}
os.write((indentStr + "> # end of " + name + "\n").getBytes());
public void finish(boolean deep) {
finish = true;
- if(deep && valueElements != null) {
- for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) {
+ if (deep && valueElements != null) {
+ for (Iterator iter = valueElements.iterator(); iter.hasNext();) {
MIFElement el = (MIFElement)iter.next();
el.finish(deep);
}
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.mif;
// Java
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.List;
/**
* The MIF File.
protected MIFElement initialAutoNums = null;
protected MIFElement aFrames = null;
protected MIFElement tbls = null;
- protected ArrayList pages = new ArrayList();
- protected ArrayList textFlows = null;
+ protected List pages = new java.util.ArrayList();
+ protected List textFlows = null;
- /**
- */
public MIFFile() {
super("");
- valueElements = new ArrayList();
+ valueElements = new java.util.ArrayList();
setup();
}
}
public void output(OutputStream os) throws IOException {
- if(finished) return;
+ if (finished) {
+ return;
+ }
- if(!started) {
+ if (!started) {
os.write(("<MIFFile 5.00> # Generated by FOP\n"/* + getVersion()*/).getBytes());
started = true;
}
boolean done = true;
- for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = valueElements.iterator(); iter.hasNext();) {
MIFElement el = (MIFElement)iter.next();
boolean d = el.output(os, 0);
- if(d) {
+ if (d) {
iter.remove();
} else {
done = false;
break;
}
}
- if(done && finish) {
+ if (done && finish) {
os.write(("# end of MIFFile").getBytes());
}
}
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.mif;
-import org.apache.fop.apps.StructureHandler;
-import org.apache.fop.layout.FontInfo;
-import org.apache.fop.fo.pagination.*;
-import org.apache.fop.fo.flow.*;
-import org.apache.fop.fo.*;
-import org.apache.fop.apps.FOPException;
-
// Java
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.OutputStream;
+// XML
import org.xml.sax.SAXException;
-// do we really want every method throwing a SAXException
+// FOP
+import org.apache.fop.apps.StructureHandler;
+import org.apache.fop.fo.Title;
+import org.apache.fop.fo.flow.Block;
+import org.apache.fop.fo.flow.Flow;
+import org.apache.fop.fo.pagination.LayoutMasterSet;
+import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.fo.pagination.PageSequenceMaster;
+import org.apache.fop.fo.pagination.SimplePageMaster;
+import org.apache.fop.layout.FontInfo;
+import org.apache.fop.apps.FOPException;
+
+// TODO: do we really want every method throwing a SAXException
/**
* The MIF Handler.
* This builds an MIF file and writes it to the output.
*/
public class MIFHandler extends StructureHandler {
+
+ /** the MIFFile instance */
protected MIFFile mifFile;
+ /** the OutputStream to write to */
protected OutputStream outStream;
private FontInfo fontInfo = new FontInfo();
// current state elements
- MIFElement textFlow;
- MIFElement para;
+ private MIFElement textFlow;
+ private MIFElement para;
/**
+ * Creates a new MIF handler on a given OutputStream.
+ * @param os OutputStream to write to
*/
public MIFHandler(OutputStream os) {
outStream = os;
org.apache.fop.render.pdf.FontSetup.setup(fontInfo, null);
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#getFontInfo()
+ */
public FontInfo getFontInfo() {
return fontInfo;
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#startDocument()
+ */
public void startDocument() throws SAXException {
mifFile = new MIFFile();
try {
mifFile.output(outStream);
- } catch(IOException ioe) {
+ } catch (IOException ioe) {
throw new SAXException(ioe);
}
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#endDocument()
+ */
public void endDocument() throws SAXException {
// finish all open elements
mifFile.finish(true);
try {
mifFile.output(outStream);
outStream.flush();
- } catch(IOException ioe) {
+ } catch (IOException ioe) {
throw new SAXException(ioe);
}
}
* Start the page sequence.
* This creates the pages in the MIF document that will be used
* by the following flows and static areas.
+ * @see org.apache.fop.apps.StructureHandler
*/
public void startPageSequence(PageSequence pageSeq, Title seqTitle, LayoutMasterSet lms) {
// get the layout master set
// setup the pages for this sequence
String name = pageSeq.getProperty("master-reference").getString();
SimplePageMaster spm = lms.getSimplePageMaster(name);
- if(spm == null) {
+ if (spm == null) {
PageSequenceMaster psm = lms.getPageSequenceMaster(name);
} else {
// create simple master with regions
}
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#endPageSequence(PageSequence)
+ */
public void endPageSequence(PageSequence pageSeq) throws FOPException {
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#startFlow(Flow)
+ */
public void startFlow(Flow fl) {
// start text flow in body region
textFlow = new MIFElement("TextFlow");
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#endFlow(Flow)
+ */
public void endFlow(Flow fl) {
textFlow.finish(true);
mifFile.addElement(textFlow);
textFlow = null;
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#startBlock(Block)
+ */
public void startBlock(Block bl) {
para = new MIFElement("Para");
// get font
textFlow.addElement(para);
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#endBlock(Block)
+ */
public void endBlock(Block bl) {
para.finish(true);
para = null;
}
+ /**
+ * @see org.apache.fop.apps.StructureHandler#characters(char[], int, int)
+ */
public void characters(char data[], int start, int length) {
- if(para != null) {
+ if (para != null) {
String str = new String(data, start, length);
str = str.trim();
// break into nice length chunks
- if(str.length() == 0) {
+ if (str.length() == 0) {
return;
}
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.mif;
-// Java
-import java.io.*;
-import java.util.*;
-
/**
* Font Catalog element.
* This is the reference lookup element for fonts in
public class PGFElement extends RefElement {
/**
+ * Creates a new font catalog element.
*/
public PGFElement() {
super("PgfCatalog");
}
public MIFElement lookupElement(Object key) {
- if(key == null) {
+ if (key == null) {
MIFElement pgf = new MIFElement("Pgf");
MIFElement prop = new MIFElement("PgfTag");
prop.setValue("`Body'");
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.mif;
-// Java
-import java.io.*;
-import java.util.*;
-
/**
* Reference MIF Element.
* This element is a lookup reference set that contains
public class RefElement extends MIFElement {
/**
+ * @see org.apache.fop.mif.MIFElement#MIFElement(String)
*/
public RefElement(String n) {
super(n);
/*
* $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.mif;
-// Java
-import java.io.*;
-import java.util.*;
-
-/**
- *
- */
public class RulingElement extends RefElement {
- /**
- */
public RulingElement() {
super("RulingCatalog");
}
public MIFElement lookupElement(Object key) {
- if(key == null) {
+ if (key == null) {
MIFElement rul = new MIFElement("Ruling");
MIFElement prop = new MIFElement("RulingTag");
prop.setValue("`Default'");