cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types Attribute.java BooleanConverter.java BooleanResult.java NumericConverter.java NumericResult.java Validator.java
Date Wed, 06 Mar 2002 16:58:06 GMT
nicolaken    02/03/06 08:58:06

  Added:       src/java/org/apache/cocoon/components/elementprocessor
                        CannotCreateElementProcessorException.java
                        ElementProcessor.java ElementProcessorFactory.java
               src/java/org/apache/cocoon/components/elementprocessor/impl
                        AbstractElementProcessorFactory.java
               src/java/org/apache/cocoon/components/elementprocessor/impl/poi
                        POIFSElementProcessor.java
               src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf
                        HSSFElementProcessorFactory.java
               src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements
                        Anchors.java Anchors.java.rep
                        BaseElementProcessor.java BorderStyle.java
                        Cell.java CellType.java ColorCode.java
                        ConstraintType.java Direction.java EPAttribute.java
                        EPAttributes.java EPBottom.java EPButton.java
                        EPCell.java EPCellComment.java EPCells.java
                        EPCheckbox.java EPColInfo.java EPCols.java
                        EPConstr.java EPContent.java EPDiagonal.java
                        EPFont.java EPFooter.java EPFrame.java
                        EPGeometry.java EPHeader.java EPItem.java
                        EPLabel.java EPLeft.java EPMargins.java
                        EPMaxCol.java EPMaxRow.java EPName.java
                        EPNames.java EPObjects.java EPPrintInformation.java
                        EPRev_Diagonal.java EPRight.java EPRowInfo.java
                        EPRows.java EPSelection.java EPSelections.java
                        EPSheet.java EPSheetName.java EPSheetNameIndex.java
                        EPSheetObjectBonobo.java EPSheetObjectFilled.java
                        EPSheets.java EPSolver.java EPStyle.java
                        EPStyleBorder.java EPStyleRegion.java EPStyles.java
                        EPSummary.java EPTop.java EPUIData.java
                        EPWorkbook.java EPZoom.java EP_Bottom.java
                        EP_Default_.java EP_Draft.java
                        EP_EvenIfOnlyStyles.java EP_Footer.java
                        EP_Grid.java EP_HCenter.java EP_Header.java
                        EP_Left.java EP_Monochrome.java EP_Name.java
                        EP_Order.java EP_Orientation.java EP_Paper.java
                        EP_RepeatLeft.java EP_RepeatTop.java EP_Right.java
                        EP_Titles.java EP_Top.java EP_Type.java
                        EP_VCenter.java EP_ValString.java EP_Value.java
                        GTKTypes.java HorizontalAlignment.java
                        ObjectFill.java Offsets.java PrintOrder.java
                        PrintOrientation.java PrintUnits.java Row.java
                        Sheet.java StyleOrientation.java StyleShading.java
                        UnderlineType.java VerticalAlignment.java
                        Workbook.java
               src/java/org/apache/cocoon/components/elementprocessor/types
                        Attribute.java BooleanConverter.java
                        BooleanResult.java NumericConverter.java
                        NumericResult.java Validator.java
  Log:
  Jakarta POI elementprocessor component, HSSF Serializer and samples. Original code by Marc Johnson (mjohnson at apache dot org) and  Andrew C. Oliver (acoliver at apache dot org).
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/CannotCreateElementProcessorException.java
  
  Index: CannotCreateElementProcessorException.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor;
  
  import org.apache.cocoon.components.elementprocessor.types.*;
  import java.lang.reflect.Constructor;
  import java.lang.reflect.InvocationTargetException;
  
  import java.util.*;
  
      /**
       * Exception to be thrown when an ElementProcessor cannot be created.
       *
       * @author Marc Johnson (marc_johnson27591@hotmail.com)
       */
  
      public class CannotCreateElementProcessorException
          extends Exception
      {
          private String _element_name;
          private String _reason;
  
          /**
           * Constructor
           *
           * @param reason a simple explanation why the specified
           *               ElementProcessor could not be created.
           */
  
          public CannotCreateElementProcessorException(final String reason)
          {
              _element_name = null;
              _reason       = (reason == null) ? ""
                                               : reason;
          }
  
          public void setElementName(final String name)
          {
              _element_name = name;
          }
  
          /**
           * override of Throwable's getMessage; allows us to format it
           * with the element name
           *
           * @return a succinct but useful message describing the
           *         problem and which element name we couldn't handle.
           */
  
          public String getMessage()
          {
              StringBuffer buffer = new StringBuffer();
  
              buffer.append("Could not create ElementProcessor for element ");
              buffer.append(_element_name);
              buffer.append(" ");
              if (_reason.length() != 0)
              {
                  buffer.append("(").append(_reason).append(")");
              }
              return buffer.toString();
          }
      }   // end public class CannotCreateElementProcessorExcepti
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/ElementProcessor.java
  
  Index: ElementProcessor.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.components.elementprocessor.types.*;
  import java.io.IOException;
  
  /**
   * The ElementProcessor interface defines behavior for classes that
   * can handle a particular XML element's content.
   * <br>
   * The life cycle of an ElementProcessor instance is:
   * <ol>
   *     <li>Creation
   *     <li>Initialization via a call to initialize
   *     <li>Acquisition of element data via calls to acceptCharacters
   *         and acceptWhitespaceCharacters
   *     <li>Completion of processing via a call to endProcessing
   * </ol>
   * In response to a startElement event, the POIFSSerializer creates an
   * ElementProcessor, delegating the act of creation to an
   * ElementProcessorFactory, and then initializes the
   * ElementProcessor. In response to subsequent characters and
   * ignorableWhitespace events, the POIFSSerializer will pass data to
   * the ElementProcessor via the acceptCharacters or
   * acceptWhitespaceCharacters methods. Finally, in response to an
   * endElement event, the POIFSSerializer calls the ElementProcessor's
   * endProcessing method.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public interface ElementProcessor 
                      extends org.apache.avalon.framework.component.Component
  {
  
      String ROLE = "org.apache.cocoon.components.elementprocessor.ElementProcessor";
      
      /**
       * The implementation should walk the array of attributes and
       * perform appropriate actions based on that data. The array of
       * attributes is guaranteed never to be null, but it can be
       * empty. An implementation can expect code like this to work
       * without throwing runtime exceptions:
       * <br>
       * <code>
       * for (int k = 0; k < attributes.length; k++)<br>
       * {<br>
       * &nbsp;&nbsp;&nbsp;&nbsp;Attribute attr = attributes[ k ];<br>
       * &nbsp;&nbsp;&nbsp;&nbsp;// process attribute</br>
       * }</br>
       * </code>
       * <br>
       * <b>NOTE: if the XML DTD or schema includes <i>IMPLIED</i>
       * attributes for an element, those attributes are not included in
       * the Attribute array - they're not in the data provided in the
       * startElement call. The constructor for the ElementProcessor
       * should set those implied attributes itself, and allow them to
       * be overridden if the XML source provided <i>explicit</i> values
       * for them.</b>
       * <br>
       * The parent ElementProcessor is a reference to the
       * ElementProcessor whose corresponding XML element contains this
       * ElementProcessor's corresponding XML element. It will not be
       * null unless this ElementProcessor's corresponding XML element
       * is the top-level element in the XML document. Whether this
       * ElementProcessor needs to establish a containment relationship
       * with its parent or not, and whether it needs to do so at the
       * beginning, middle, or end of its life cycle, are private
       * matters left to the discretion of the individual
       * ElementProcessor implementation. If the ElementProcessor needs
       * to interact with its parent ElementProcessor, but is not ready
       * to do so when the initialize method is called, it must cache
       * the reference to its parent.
       * <br>
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       *
       * @exception IOException if anything goes wrong
       */
  
      public void initialize(Attribute [] attributes, ElementProcessor parent)
          throws IOException;
  
      /**
       * The data provided in this method call comes from the
       * corresponding XML element's contents. The array is guaranteed
       * not to be null and will never be empty.
       * <br>
       * The POIFSSerializer will make 0 to many calls to this method;
       * all such calls will occur after the initialize method is called
       * and before the endProcessing method is called.
       * <br>
       * Calls to this method may be interleaved with calls to
       * acceptWhitespaceCharacters. All calls to acceptCharacters and
       * acceptWhitespaceCharacters are guaranteed to be in the same
       * order as their data is in the element.
       *
       * @param data the character data
       */
  
      public void acceptCharacters(char [] data);
  
      /**
       * The data provided in this method call comes from the
       * corresponding XML element's contents. The array is guaranteed
       * not to be null and will never be empty.
       * <br>
       * The POIFSSerializer will make 0 to many calls to this method;
       * all such calls will occur after the initialize method is called
       * and before the endProcessing method is called.
       * <br>
       * Calls to this method may be interleaved with calls to
       * acceptCharacters. All calls to acceptCharacters and
       * acceptWhitespaceCharacters are guaranteed to be in the same
       * order as their data is in the element.
       *
       * @param data the whitespace characters
       */
  
      public void acceptWhitespaceCharacters(char [] data);
  
      /**
       * This is the last method call executed by the
       * POIFSSerializer. When this method is called, the
       * ElementProcessor should finish its work and perform its final
       * interactions with its parent ElementProcessor.
       * <br>
       * If the implementation cached the parent ElementProcessor
       * reference, when the initialize method was called, it should
       * null out that reference.
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException;
  }   // end public interface ElementProcessor
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/ElementProcessorFactory.java
  
  Index: ElementProcessorFactory.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor;
  
  import org.apache.avalon.framework.component.Component;
  
  import org.apache.cocoon.components.elementprocessor.types.*;
  import java.lang.reflect.Constructor;
  import java.lang.reflect.InvocationTargetException;
  
  import java.util.*;
  
  /**
   * Create instances of specific ElementProcessor implementations to
   * handle specific XML elements and their content.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public interface ElementProcessorFactory
                      extends org.apache.avalon.framework.component.Component
  {
  
      String ROLE = "org.apache.cocoon.components.elementprocessor.ElementProcessorFactory";
  
      /**
       * Given an XML element name, create and return an appropriate
       * ElementProcessor.
       *
       * @param name element name
       *
       * @return the specified ElementProcessor
       *
       * @exception CannotCreateElementProcessorException if there is no
       *            ElementProcessor available for the specified name
       */
  
      public ElementProcessor createElementProcessor(final String name)
          throws CannotCreateElementProcessorException;
  
  }       // end public interface ElementProcessorFactory
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/AbstractElementProcessorFactory.java
  
  Index: AbstractElementProcessorFactory.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor.impl;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.logger.AbstractLoggable;
  
  import org.apache.cocoon.components.elementprocessor.*;
  import org.apache.cocoon.components.elementprocessor.types.*;
  import java.lang.reflect.Constructor;
  import java.lang.reflect.InvocationTargetException;
  
  import java.util.*;
  
  /**
   * Create instances of specific ElementProcessor implementations to
   * handle specific XML elements and their content.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public abstract class AbstractElementProcessorFactory
       extends AbstractLoggable implements ElementProcessorFactory, Component
  {
  
      // uses XML element names as keys and ElementProcessor progenitors
      // as values. An ElementProcessor progenitor is an Object that can
      // be used to create a new ElementProcessor instance that is
      // specific to a particular XML element. A progenitor may be a
      // Constructor or Class that can construct a new instance of an
      // appropriate ElementProcessor implementation, or any other
      // Object that an extension of AbstractElementProcessorFactory finds
      // useful to create new ElementProcessor instances.
      private Map _element_processor_map;
  
      /**
       * Protected default constructor
       */
  
      protected AbstractElementProcessorFactory()
      {
          _element_processor_map = new HashMap();
      }
  
      /**
       * Given an XML element name, create and return an appropriate
       * ElementProcessor.
       *
       * @param name element name
       *
       * @return the specified ElementProcessor
       *
       * @exception CannotCreateElementProcessorException if there is no
       *            ElementProcessor available for the specified name
       */
  
      public ElementProcessor createElementProcessor(final String name)
          throws CannotCreateElementProcessorException
      {
          Object progenitor = lookupElementProcessorProgenitor(name);
  
          if (progenitor == null)
          {
              CannotCreateElementProcessorException exception =
                  new CannotCreateElementProcessorException(
                      "Cannot find progenitor for that name");
  
              exception.setElementName(name);
              throw exception;
          }
          ElementProcessor processor = null;
  
          try
          {
              processor = doCreateElementProcessor(progenitor);
          }
          catch (CannotCreateElementProcessorException e)
          {
              e.setElementName(name);
              throw e;
          }
          return processor;
      }
  
      /**
       * A method for extending classes to populate the map.
       *
       * @param name the element name for this progenitor; cannot be
       *             null ot empty
       * @param progenitor an object that can be used to generate an
       *                   appropriate ElementProcessor; cannot be nukk
       *
       * @exception IllegalArgumentException if name is already in the
       *            map or progenitor is null.
       */
  
      protected void addElementProcessorProgenitor(final String name,
              final Object progenitor)
      {
          if ((name == null) || (name.equals("")))
          {
              throw new IllegalArgumentException(
                  "Cannot use null or empty name as a key");
          }
          if (progenitor == null)
          {
              throw new IllegalArgumentException(
                  "Cannot add null progenitor to the map");
          }
          if (_element_processor_map.put(name, progenitor) != null)
          {
              throw new IllegalArgumentException(
                  name + " is already in use in the map");
          }
      }
  
      /**
       * A method to get the progenitor value associated with a
       * specified element name.
       *
       * @param name the element name
       *
       * @return the associated ElementProcessor progenitor; will be
       *         null if the element name has not yet been associated
       *         with a progenitor.
       */
  
      protected Object lookupElementProcessorProgenitor(final String name)
      {
          Object o = _element_processor_map.get(name);
  	if ((o == null) && (!name.equals("*")))
  	{
  	    o = lookupElementProcessorProgenitor("*");
  	}
  	return o;
      }
  
      /**
       * The method that a concrete extension of AbstractElementProcessorFactory
       * must implement. When this method is called, the element name
       * has already been looked up in the map and a progenitor Object
       * has been acquired. The progenitor is guaranteed not to be null.
       *
       * @param progenitor the object from which to create an
       *                   ElementProcessor
       *
       * @return freshly created ElementProcessor
       *
       * @exception CannotCreateElementProcessorException if the
       *            specified ElementProcessor cannot be created.
       */
  
      protected abstract ElementProcessor doCreateElementProcessor(
          final Object progenitor)
          throws CannotCreateElementProcessorException;
  
      /**
       * A reference implementation of doCreateElementProcessor that can
       * be used by an extending class whose progenitors are Class
       * objects for ElementProcessor implementations.
       *
       * @param progenitor a Class representing an ElementProcessor
       *
       * @return the new ElementProcessor instance
       *
       * @exception CannotCreateElementProcessorException if the
       *            ElementProcessor cannot be created.
       */
  
      protected ElementProcessor createNewElementProcessorInstance(
              final Class progenitor)
          throws CannotCreateElementProcessorException
      {
          ElementProcessor rval = null;
  
          try
          {
              rval = ( ElementProcessor ) progenitor.newInstance();
              if(rval instanceof org.apache.avalon.framework.logger.AbstractLoggable)
              {
                 ((AbstractLoggable)rval).setLogger(getLogger());
              }
          }
          catch (ExceptionInInitializerError e)
          {
              throw new CannotCreateElementProcessorException(
                  "an exception (" + e
                  + ")occurred in initializing the associated ElementProcessor class");
          }
          catch (SecurityException e)
          {
              throw new CannotCreateElementProcessorException(
                  "a security exception was caught while creating the associated ElementProcessor");
          }
          catch (InstantiationException e)
          {
              throw new CannotCreateElementProcessorException(
                  "associated ElementProcessor is an interface or abstract class or has no zero-parameter constructor");
          }
          catch (IllegalAccessException e)
          {
              throw new CannotCreateElementProcessorException(
                  "cannot access ElementProcessor class or its zero-parameter constructor");
          }
          catch (ClassCastException e)
          {
              throw new CannotCreateElementProcessorException(
                  "object created does not implement ElementProcessor");
          }
          catch (Exception e)
          {
              throw new CannotCreateElementProcessorException(
                  "exception (" + e
                  + ") occured while creating new instance of ElementProcessor");
          }
          if (rval == null)
          {
              throw new CannotCreateElementProcessorException(
                  "somehow generated a null ElementProcessor");
          }
          return rval;
      }
  
      /**
       * A reference implementation of doCreateElementProcessor that can
       * be used by an extending class whose progenitors are Constructor
       * objects that can create new instances of ElementProcessor
       * implementations.
       *
       * @param progenitor a Constructor of an ElementProcessor
       *
       * @return the newly created ElementProcessor
       *
       * @exception CannotCreateElementProcessorException if the
       *            ElementProcessor cannot be created.
       */
  
      protected ElementProcessor constructElementProcessor(
              final Constructor progenitor)
          throws CannotCreateElementProcessorException
      {
          ElementProcessor rval = null;
  
          try
          {
              rval = ( ElementProcessor ) progenitor
                  .newInstance(new Object[ 0 ]);
                  
              if(rval instanceof org.apache.avalon.framework.logger.AbstractLoggable)
              {
                 ((AbstractLoggable)rval).setLogger(getLogger());
              }
          }
          catch (ExceptionInInitializerError e)
          {
              throw new CannotCreateElementProcessorException(
                  "an exception (" + e
                  + ")occurred in initializing the associated ElementProcessor class");
          }
          catch (IllegalArgumentException e)
          {
              throw new CannotCreateElementProcessorException(
                  "the ElementProcessor constructor apparently needs parameters");
          }
          catch (InstantiationException e)
          {
              throw new CannotCreateElementProcessorException(
                  "associated ElementProcessor is an interface or abstract class");
          }
          catch (IllegalAccessException e)
          {
              throw new CannotCreateElementProcessorException(
                  "cannot access ElementProcessor class or its zero-parameter constructor");
          }
          catch (InvocationTargetException e)
          {
              throw new CannotCreateElementProcessorException(
                  "ElementProcessor constructor threw an exception ["
                  + e.toString() + "]");
          }
          catch (ClassCastException e)
          {
              throw new CannotCreateElementProcessorException(
                  "object created does not implement ElementProcessor");
          }
          if (rval == null)
          {
              throw new CannotCreateElementProcessorException(
                  "somehow generated a null ElementProcessor");
          }
          return rval;
      }
  
  }       // end public abstract class AbstractElementProcessorFactory
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/POIFSElementProcessor.java
  
  Index: POIFSElementProcessor.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor.impl.poi;
  
  import org.apache.cocoon.components.elementprocessor.*;
  import org.apache.cocoon.components.elementprocessor.types.*;
  
  import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  
  /**
   * extension of ElementProcessor for POIFSSerializers
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public interface POIFSElementProcessor extends ElementProcessor
  {
  
      /**
       * Set the POIFSFileSystem for the element processor
       *
       * @param fs the POIFSFileSystem instance
       */
  
      public void setFilesystem(POIFSFileSystem fs);
  }
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/HSSFElementProcessorFactory.java
  
  Index: HSSFElementProcessorFactory.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf;
  
  import org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements.*;
  import org.apache.cocoon.components.elementprocessor.*;
  import org.apache.cocoon.components.elementprocessor.impl.AbstractElementProcessorFactory;
  
  /**
   * a simple extension of ElementProcessorFactory that maps the HSSF
   * XML element names to HSSF-specific ElementProcessor progenitor
   * objects.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class HSSFElementProcessorFactory
      extends AbstractElementProcessorFactory
  {
  
      /**
       * default constructor
       */
  
      public HSSFElementProcessorFactory()
      {
          super();
          addElementProcessorProgenitor("Attribute", EPAttribute.class);
          addElementProcessorProgenitor("Attributes", EPAttributes.class);
          addElementProcessorProgenitor("Bottom", EPBottom.class);
          addElementProcessorProgenitor("bottom", EP_Bottom.class);
          addElementProcessorProgenitor("Button", EPButton.class);
          addElementProcessorProgenitor("Cell", EPCell.class);
          addElementProcessorProgenitor("CellComment", EPCellComment.class);
          addElementProcessorProgenitor("Cells", EPCells.class);
          addElementProcessorProgenitor("Checkbox", EPCheckbox.class);
          addElementProcessorProgenitor("ColInfo", EPColInfo.class);
          addElementProcessorProgenitor("Cols", EPCols.class);
          addElementProcessorProgenitor("Constr", EPConstr.class);
          addElementProcessorProgenitor("Content", EPContent.class);
          addElementProcessorProgenitor("Diagonal", EPDiagonal.class);
          addElementProcessorProgenitor("draft", EP_Draft.class);
          addElementProcessorProgenitor("even_if_only_styles",
                                        EP_EvenIfOnlyStyles.class);
          addElementProcessorProgenitor("Font", EPFont.class);
          addElementProcessorProgenitor("Footer", EPFooter.class);
          addElementProcessorProgenitor("footer", EP_Footer.class);
          addElementProcessorProgenitor("Frame", EPFrame.class);
          addElementProcessorProgenitor("Geometry", EPGeometry.class);
          addElementProcessorProgenitor("grid", EP_Grid.class);
          addElementProcessorProgenitor("hcenter", EP_HCenter.class);
          addElementProcessorProgenitor("Header", EPHeader.class);
          addElementProcessorProgenitor("header", EP_Header.class);
          addElementProcessorProgenitor("Item", EPItem.class);
          addElementProcessorProgenitor("Label", EPLabel.class);
          addElementProcessorProgenitor("Left", EPLeft.class);
          addElementProcessorProgenitor("left", EP_Left.class);
          addElementProcessorProgenitor("Margins", EPMargins.class);
          addElementProcessorProgenitor("MaxCol", EPMaxCol.class);
          addElementProcessorProgenitor("MaxRow", EPMaxRow.class);
          addElementProcessorProgenitor("monochrome", EP_Monochrome.class);
          addElementProcessorProgenitor("Name", EPName.class);
          addElementProcessorProgenitor("name", EP_Name.class);
          addElementProcessorProgenitor("Names", EPNames.class);
          addElementProcessorProgenitor("Objects", EPObjects.class);
          addElementProcessorProgenitor("order", EP_Order.class);
          addElementProcessorProgenitor("orientation", EP_Orientation.class);
          addElementProcessorProgenitor("paper", EP_Paper.class);
          addElementProcessorProgenitor("PrintInformation",
                                        EPPrintInformation.class);
          addElementProcessorProgenitor("repeat_left", EP_RepeatLeft.class);
          addElementProcessorProgenitor("repeat_top", EP_RepeatTop.class);
          addElementProcessorProgenitor("Rev-Diagonal", EPRev_Diagonal.class);
          addElementProcessorProgenitor("Right", EPRight.class);
          addElementProcessorProgenitor("right", EP_Right.class);
          addElementProcessorProgenitor("RowInfo", EPRowInfo.class);
          addElementProcessorProgenitor("Rows", EPRows.class);
          addElementProcessorProgenitor("Selection", EPSelection.class);
          addElementProcessorProgenitor("Sheet", EPSheet.class);
          addElementProcessorProgenitor("SheetName", EPSheetName.class);
          addElementProcessorProgenitor("SheetNameIndex",
                                        EPSheetNameIndex.class);
          addElementProcessorProgenitor("SheetObjectBonobo",
                                        EPSheetObjectBonobo.class);
          addElementProcessorProgenitor("SheetObjectFilled",
                                        EPSheetObjectFilled.class);
          addElementProcessorProgenitor("Sheets", EPSheets.class);
          addElementProcessorProgenitor("Selections", EPSelections.class);
          addElementProcessorProgenitor("Solver", EPSolver.class);
          addElementProcessorProgenitor("Style", EPStyle.class);
          addElementProcessorProgenitor("StyleBorder", EPStyleBorder.class);
          addElementProcessorProgenitor("StyleRegion", EPStyleRegion.class);
          addElementProcessorProgenitor("Styles", EPStyles.class);
          addElementProcessorProgenitor("Summary", EPSummary.class);
          addElementProcessorProgenitor("titles", EP_Titles.class);
          addElementProcessorProgenitor("Top", EPTop.class);
          addElementProcessorProgenitor("top", EP_Top.class);
          addElementProcessorProgenitor("type", EP_Type.class);
          addElementProcessorProgenitor("UIData", EPUIData.class);
          addElementProcessorProgenitor("val-string", EP_ValString.class);
          addElementProcessorProgenitor("value", EP_Value.class);
          addElementProcessorProgenitor("vcenter", EP_VCenter.class);
          addElementProcessorProgenitor("Workbook", EPWorkbook.class);
          addElementProcessorProgenitor("Zoom", EPZoom.class);
  	addElementProcessorProgenitor("*", EP_Default_.class);
      }
  
      /**
       * create an ElementProcessor
       *
       * @param progenitor the Object from which the ElementProcessor
       * will be created
       *
       * @return the new ElementProcessor
       *
       * @exception CannotCreateElementProcessorException
       */
  
      protected ElementProcessor doCreateElementProcessor(
              final Object progenitor)
          throws CannotCreateElementProcessorException
      {
          ElementProcessor rval = null;
  
          try
          {
              rval = createNewElementProcessorInstance(( Class ) progenitor);
          }
          catch (ClassCastException e)
          {
              e.printStackTrace();
              throw new CannotCreateElementProcessorException(
                  "Progenitor is not an instance of Class");
          }
          return rval;
      }
  }   // end public class HSSFElementProcessorFactory
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Anchors.java
  
  Index: Anchors.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * Anchors. This particular object is represented in gnumeric's XML as
   * four integers, space separated. Presumably, each represents an
   * anchor for a particular direction -- top, bottom, left, right --
   * but what the reference is for each anchor is not known, nor is it
   * known which one is top, bottom, left, or right, or even whether
   * that's the correct interpretation of the numbers. This is an area
   * of the gnumeric XML that is not terribly well documented even in
   * their code, and I don't think the features that use anchors are
   * terribly mature yet.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class Anchors
  {
      private static final int       _component_count                  = 4;
      private int[]                  _components                       =
          new int[ _component_count ];
  
      // Each element of an anchor has to be one of these values:
      public static final int        ANCHOR_UNKNOWN                    = 0;
      public static final int        ANCHOR_PERCENTAGE_FROM_COLROW_ST  = 16;
      public static final int        ANCHOR_PERCENTAGE_FROM_COLROW_END = 17;
      public static final int        ANCHOR_PTS_FROM_COLROW_START      = 32;
      public static final int        ANCHOR_PTS_FROM_COLROW_END        = 33;
      public static final int        ANCHOR_PTS_ABSOLUTE               = 48;
      private static final Validator _validator                        =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              switch (number.intValue())
              {
  
                  case ANCHOR_UNKNOWN :
                  case ANCHOR_PERCENTAGE_FROM_COLROW_ST :
                  case ANCHOR_PERCENTAGE_FROM_COLROW_END :
                  case ANCHOR_PTS_FROM_COLROW_START :
                  case ANCHOR_PTS_FROM_COLROW_END :
                  case ANCHOR_PTS_ABSOLUTE :
                      return null;
  
                  default :
                      return new IOException("\"" + number
                                             + "\" is not a legal value");
              }
          }
      };
  
      /**
       * construct the Anchors object
       *
       * @param value the string containing the anchor values
       *
       * @exception IOException if the string is badly formed
       */
  
      public Anchors(final String value)
          throws IOException
      {
          if (value == null)
          {
              throw new IOException("cannot process a null anchors string");
          }
          char[]   input   = value.trim().toCharArray();
          String[] anchors = new String[ _component_count ];
          int      index   = 0;
  
          for (int j = 0; j < _component_count; j++)
          {
              while ((index < input.length)
                      && (Character.isWhitespace(input[ index ])))
              {
                  ++index;
              }
              if (index == input.length)
              {
                  throw new IOException("insufficient anchors in string");
              }
              int tailIndex = index;
  
              while ((tailIndex < input.length)
                      && (!Character.isWhitespace(input[ tailIndex ])))
              {
                  ++tailIndex;
              }
              _components[ j ] = NumericConverter.extractInteger(
                  new String(input, index, tailIndex - index),
                  _validator).intValue();
              index            = tailIndex;
          }
          if (new String(input, index, input.length - index).trim().length()
                  != 0)
          {
              throw new IOException("Too much data in string for "
                                    + _component_count + " anchors");
          }
      }
  
      /**
       * @return components
       */
  
      public int [] getComponents()
      {
          return _components;
      }
  }   // end public class Anchors
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Anchors.java.rep
  
  Index: Anchors.java.rep
  ===================================================================
  trim
  input
  switch
  new
  extractInteger
  import
  net
  getComponents
  cocoon
  ANCHOR_PTS_FROM_COLROW_END
  serialization
  sourceforge
  public
  util
  null
  Character
  default
  package
  throw
  class
  Anchors
  Validator
  throws
  component_count
  anchors
  toCharArray
  tailIndex
  length
  validate
  xml
  Number
  components
  ANCHOR_PERCENTAGE_FROM_COLROW_ST
  io
  ANCHOR_PTS_ABSOLUTE
  NumericConverter
  index
  while
  if
  private
  final
  static
  poi
  isWhitespace
  int
  char
  ANCHOR_PTS_FROM_COLROW_START
  String
  java
  for
  ANCHOR_PERCENTAGE_FROM_COLROW_END
  value
  hssf
  case
  j
  IOException
  return
  intValue
  validator
  ANCHOR_UNKNOWN
  number
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/BaseElementProcessor.java
  
  Index: BaseElementProcessor.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  import org.apache.cocoon.components.elementprocessor.*;
  import org.apache.cocoon.components.elementprocessor.types.*;
  import org.apache.cocoon.components.elementprocessor.impl.poi.POIFSElementProcessor;
  
  import org.apache.avalon.framework.logger.AbstractLoggable;
  
  import java.util.*;
  
  import java.io.IOException;
  
  /**
   * The BaseElementProcessor class provides default behavior for
   * classes that can handle a particular XML element's content.
   *
   * It is intended that all ElementProcessors should extend this class.
   * This class is declared Abstract although it has no abstract
   * methods. It can be used 'as is' for a no-op ElementProcessor, and
   * an ElementProcessor that chooses to simply extend this class with
   * no overrides will be a no-op ElementProcessor.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public abstract class BaseElementProcessor extends AbstractLoggable 
       implements POIFSElementProcessor
  {
      private Map                  _attributes;
      private POIFSFileSystem      _filesystem;
      private BaseElementProcessor _parent;
      private StringBuffer         _data;
      
      /**
       * Constructor
       *
       * @param implied_attributes an array of Attributes which might
       *                           not appear in the initialization call
       *                           because they are implied, and the SAX
       *                           processor will not automatically
       *                           generate them.
       */
  
      protected BaseElementProcessor(final Attribute [] implied_attributes)
      {
          _attributes = new HashMap();
          _filesystem = null;
          _parent     = null;
          _data       = new StringBuffer();
  
          if (implied_attributes != null)
          {
              for (int k = 0; k < implied_attributes.length; k++)
              {
                  _attributes.put(implied_attributes[ k ].getName(),
                                  implied_attributes[ k ]);
              }
          }
      }
  
      /**
       * @return the Attributes managed by this ElementProcessor. May be
       *         empty, but never null
       */
  
      protected Iterator getAttributes()
      {
          return _attributes.values().iterator();
      }
  
      /**
       * Get the value of an attribute
       *
       * @param name the name of the attribute to look up
       *
       * @return the value of the specified attribute; will be null if
       *         the attribute doesn't exist
       */
  
      protected String getValue(final String name)
      {
          String    value = null;
          Attribute attr  = ( Attribute ) _attributes.get(name);
  
          if (attr != null)
          {
              value = attr.getValue();
          }
          return value;
      }
  
      /**
       * @return the POIFSFileSystem object
       */
  
      protected POIFSFileSystem getFilesystem()
      {
          return _filesystem;
      }
  
  
      /**
       * @return the parent ElementProcessor; may be null
       */
  
      protected ElementProcessor getParent()
      {
          return _parent;
      }
  
      /**
       * get the nearest ancestor that happens to be an instance of the
       * specified class
       *
       * @param theclass the class we're looking for
       *
       * @return an ancestor of the specified class; null if no such
       *         ancestor exists
       */
  
      protected ElementProcessor getAncestor(final Class theclass)
      {
  	ElementProcessor parent = getParent();
  	if ((parent == null) || parent.getClass().equals(theclass))
  	{
  	    return parent;
  	}
  	else
  	{
  	    return ((BaseElementProcessor)parent).getAncestor(theclass);
  	}
      }
  
      /**
       * @return the data, both regular characters and whitespace
       *         characters, collected so far
       */
  
      protected String getData()
      {
          return _data.toString().trim();
      }
  
      /**
       * get the workbook we're working on. If it isn't in this
       * instance, check the parent
       *
       * @return the workbook we're working on. Never null
       *
       * @exception IOException if the workbook is missing
       */
  
      protected Workbook getWorkbook()
          throws IOException
      {
          if (_parent == null)
          {
  
              // hit the end of the containment hierarchy without
              // finding it. This Is Bad
              throw new IOException("Cannot find the workbook object");
          }
          else
          {
              return _parent.getWorkbook();
          }
      }
  
      /**
       * get the current sheet we're working on. If it isn't in this
       * instance, check the parent
       *
       * @return the current sheet we're working on. Never null
       *
       * @exception IOException if the sheet is missing
       */
  
      protected Sheet getSheet()
          throws IOException
      {
          if (_parent == null)
          {
  
              // hit the end of the containment hierarchy without
              // finding it. This Is Bad
              throw new IOException("Cannot find the sheet object");
          }
          else
          {
              return _parent.getSheet();
          }
      }
  
      /**
       * get the current cell we're working on. If it isn't in this
       * instance, check the parent
       *
       * @return the current cell we're working on. Never null
       *
       * @exception IOException if the cell is missing
       */
  
      protected Cell getCell()
          throws IOException
      {
          if (_parent == null)
          {
  
              // hit the end of the containment hierarchy without
              // finding it. This Is Bad
              throw new IOException("Cannot find the cell object");
          }
          else
          {
              return _parent.getCell();
          }
      }
  
      /* ********** START implementation of ElementProcessor ********** */
  
      /**
       * The implementation should walk the array of attributes and
       * perform appropriate actions based on that data. The array of
       * attributes is guaranteed never to be null, but it can be
       * empty. An implementation can expect code like this to work
       * without throwing runtime exceptions:
       * <br>
       * <code>
       * for (int k = 0; k < attributes.length; k++)<br>
       * {<br>
       * &nbsp;&nbsp;&nbsp;&nbsp;Attribute attr = attributes[ k ];<br>
       * &nbsp;&nbsp;&nbsp;&nbsp;// process attribute</br>
       * }</br>
       * </code>
       * <br>
       * <b>NOTE: if the XML DTD or schema includes <i>IMPLIED</i>
       * attributes for an element, those attributes are not included in
       * the Attribute array - they're not in the data provided in the
       * startElement call. The constructor for the ElementProcessor
       * should set those implied attributes itself, and allow them to
       * be overridden if the XML source provided <i>explicit</i> values
       * for them.</b>
       * <br>
       * The parent ElementProcessor is a reference to the
       * ElementProcessor whose corresponding XML element contains this
       * ElementProcessor's corresponding XML element. It will not be
       * null unless this ElementProcessor's corresponding XML element
       * is the top-level element in the XML document. Whether this
       * ElementProcessor needs to establish a containment relationship
       * with its parent or not, and whether it needs to do so at the
       * beginning, middle, or end of its life cycle, are private
       * matters left to the discretion of the individual
       * ElementProcessor implementation. If the ElementProcessor needs
       * to interact with its parent ElementProcessor, but is not ready
       * to do so when the initialize method is called, it must cache
       * the reference to its parent.
       * <br>
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          try
          {
              _parent = ( BaseElementProcessor ) parent;
          }
          catch (ClassCastException ignored)
          {
              throw new IOException(
                  "parent is not compatible with this serializer");
          }
  
          // can't trust the guarantee -- an overriding implementation
          // may have screwed this up
          if (attributes != null)
          {
              for (int k = 0; k < attributes.length; k++)
              {
                  _attributes.put(attributes[ k ].getName(), attributes[ k ]);
              }
          }
      }
  
      /**
       * The data provided in this method call comes from the
       * corresponding XML element's contents. The array is guaranteed
       * not to be null and will never be empty.
       * <br>
       * The POIFSSerializer will make 0 to many calls to this method;
       * all such calls will occur after the initialize method is called
       * and before the endProcessing method is called.
       * <br>
       * Calls to this method may be interleaved with calls to
       * acceptWhitespaceCharacters. All calls to acceptCharacters and
       * acceptWhitespaceCharacters are guaranteed to be in the same
       * order as their data is in the element.
       *
       * @param data the character data
       */
  
      public void acceptCharacters(final char [] data)
      {
          if (data != null)
          {
              _data.append(data);
          }
      }
  
      /**
       * The data provided in this method call comes from the
       * corresponding XML element's contents. The array is guaranteed
       * not to be null and will never be empty.
       * <br>
       * The POIFSSerializer will make 0 to many calls to this method;
       * all such calls will occur after the initialize method is called
       * and before the endProcessing method is called.
       * <br>
       * Calls to this method may be interleaved with calls to
       * acceptCharacters. All calls to acceptCharacters and
       * acceptWhitespaceCharacters are guaranteed to be in the same
       * order as their data is in the element.
       *
       * @param data the whitespace characters
       */
  
      public void acceptWhitespaceCharacters(final char [] data)
      {
          if (data != null)
          {
              _data.append(data);
          }
      }
  
      /**
       * This is the last method call executed by the
       * POIFSSerializer. When this method is called, the
       * ElementProcessor should finish its work and perform its final
       * interactions with its parent ElementProcessor and the
       * filesystem, if necessary.
       * <br>
       * If the implementation cached the parent ElementProcessor
       * reference, the filesystem reference, or both, when the
       * initialize method was called, it should null out those
       * references.
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          _filesystem = null;
          _parent     = null;
      }
  
      /* **********  END  implementation of ElementProcessor ********** */
      /* ********** START implementation of POIFSElementProcessor ********** */
  
      /**
       * Set the POIFSFileSystem for the element processor
       *
       * @param fs the POIFSFileSystem instance
       */
  
      public void setFilesystem(POIFSFileSystem fs)
      {
  	_filesystem = fs;
      }
  
  
      /* **********  END  implementation of POIFSElementProcessor ********** */
  }   // end package scope abstract class BaseElementProcessor
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/BorderStyle.java
  
  Index: BorderStyle.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * Border style codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class BorderStyle
  {
      public static final int BORDER_STYLE_NONE                = 0;    
      public static final int BORDER_STYLE_THIN                = 1;
      public static final int BORDER_STYLE_MEDIUM              = 2;
      public static final int BORDER_STYLE_DASHED              = 3;
      public static final int BORDER_STYLE_DOTTED              = 4;
      public static final int BORDER_STYLE_THICK               = 5;
      public static final int BORDER_STYLE_DOUBLE              = 6;
      public static final int BORDER_STYLE_HAIR                = 7;
      public static final int BORDER_STYLE_MEDIUM_DASH         = 8;
      public static final int BORDER_STYLE_DASH_DOT            = 9;
      public static final int BORDER_STYLE_MEDIUM_DASH_DOT     = 10;
      public static final int BORDER_STYLE_DASH_DOT_DOT        = 11;
      public static final int BORDER_STYLE_MEDIUM_DASH_DOT_DOT = 12;
      public static final int BORDER_STYLE_SLANTED_DASH_DOT    = 13;
  
      private BorderStyle()
      {
      }
  
      /**
       * Is this a valid border style?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(int val)
      {
          return ((val >= BORDER_STYLE_NONE)
                  && (val <= BORDER_STYLE_SLANTED_DASH_DOT));
      }
  }   // end public class BorderStyle
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
  
  Index: Cell.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.poi.hssf.usermodel.HSSFCell;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  
  import java.io.IOException;
  
  /**
   * internal representation of a Cell
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  // package scope
  class Cell
  {
      private HSSFCell _cell;
  
      // original CellType value
      private int      _celltype;
  
      /**
       * Constructor Cell
       *
       * @param cell
       */
  
      Cell(final HSSFCell cell, final int cellType)
      {
          _cell     = cell;
          _celltype = cellType;
      }
  
      /**
       * set content
       *
       * @param content the value of the cell, as a string
       *
       * @exception IOException
       */
  
      void setContent(final String content)
          throws IOException
      {
          if (_cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC)
          {
              try
              {
                  if (_celltype == CellType.CELL_TYPE_FLOAT)
                  {
                      _cell.setCellValue(Double.parseDouble(content));
                  }
                  else
                  {
                      _cell.setCellValue(Integer.parseInt(content));
                  }
              }
              catch (NumberFormatException e)
              {
                  throw new IOException("Invalid value for a numeric cell: "
                                        + content);
              }
          }
          else if (_cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
          {
              _cell.setCellValue(content);
          }
      }
      
      void setStyle (HSSFCellStyle style) {
          if (style != null) {
              _cell.setCellStyle(style);
          }
      }
  
      /**
       * @return cell type
       */
  
      int getCellType()
      {
          return _cell.getCellType();
      }
  
      /**
       * @return string value
       */
  
      String getStringValue()
      {
          return _cell.getStringCellValue();
      }
  
      /**
       * @return numeric value
       */
  
      double getNumericValue()
      {
          return _cell.getNumericCellValue();
      }
  }   // end package scope class Cell
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/CellType.java
  
  Index: CellType.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.poi.hssf.usermodel.HSSFCell;
  
  /**
   * Cell type codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class CellType
  {
      public static final int CELL_TYPE_EMPTY     = 10;
      public static final int CELL_TYPE_BOOLEAN   = 20;
      public static final int CELL_TYPE_INTEGER   = 30;
      public static final int CELL_TYPE_FLOAT     = 40;
      public static final int CELL_TYPE_ERROR     = 50;
      public static final int CELL_TYPE_STRING    = 60;
      public static final int CELL_TYPE_CELLRANGE = 70;
      public static final int CELL_TYPE_ARRAY     = 80;
  
      private CellType()
      {
      }
  
      /**
       * Is this a valid cell type?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(final int val)
      {
          switch (val)
          {
  
              case CELL_TYPE_EMPTY :
              case CELL_TYPE_BOOLEAN :
              case CELL_TYPE_INTEGER :
              case CELL_TYPE_FLOAT :
              case CELL_TYPE_ERROR :
              case CELL_TYPE_STRING :
              case CELL_TYPE_CELLRANGE :
              case CELL_TYPE_ARRAY :
                  return true;
  
              default :
                  return false;
          }
      }
  
      /**
       * Convert a CellType enum into an HSSFCell enum
       *
       * @param val the value to be converted
       *
       * @return the converted value
       */
  
      static int convertCellType(final int val)
      {
          switch (val)
          {
  
              case CELL_TYPE_INTEGER :
              case CELL_TYPE_FLOAT :
                  return HSSFCell.CELL_TYPE_NUMERIC;
  
              case CELL_TYPE_STRING :
                  return HSSFCell.CELL_TYPE_STRING;
  
              default :
                  return HSSFCell.CELL_TYPE_BLANK;
          }
      }
  }   // end public class CellType
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ColorCode.java
  
  Index: ColorCode.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import java.io.IOException;
  
  import java.util.StringTokenizer;
  
  /**
   * Color codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class ColorCode
  {
      private static final int _red             = 0;
      private static final int _green           = 1;
      private static final int _blue            = 2;
      private static final int _component_count = 3;
      private int[]            _components      = new int[ _component_count ];
      private String           rgbstring        = null;
  
      /**
       * construct the ColorCode object
       *
       * @param value the string containing the colors
       *
       * @exception IOException if the string is badly formed
       */
  
      public ColorCode(final String value)
          throws IOException
      {
          rgbstring = value;
          if (value == null)
          {
              throw new IOException("cannot process a null color code");
          }
          StringTokenizer tokenizer = new StringTokenizer(value.trim(), ":");
  
          if (tokenizer.countTokens() != _component_count)
          {
              throw new IOException("color code must have exactly "
                                    + _component_count
                                    + " components, no more, no less");
          }
          for (int j = 0; j < _component_count; j++)
          {
              try
              {
                  _components[ j ] = Integer.parseInt(tokenizer.nextToken(),
                                                      16);
              }
              catch (Exception e)
              {
                  throw new IOException("cannot parse component #" + j + " ("
                                        + e.getMessage() + ")");
              }
              if ((_components[ j ] < 0) || (_components[ j ] > 65535))
              {
                  throw new IOException("Component #" + j + " is out of range");
              }
          }
      }
  
      /**
       * @return red component
       */
  
      public int getRed()
      {
          return _components[ _red ];
      }
  
      /**
       * @return green component
       */
  
      public int getGreen()
      {
          return _components[ _green ];
      }
  
      /**
       * @return blue component
       */
  
      public int getBlue()
      {
          return _components[ _blue ];
      }
      
      public String toString() {
          return rgbstring;
      }
  }   // end public class ColorCode
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ConstraintType.java
  
  Index: ConstraintType.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * Contraint codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class ConstraintType
  {
      public static final int CONSTRAINT_TYPE_NONE         = 0;
      public static final int CONSTRAINT_TYPE_LESS_THAN    = 1;
      public static final int CONSTRAINT_TYPE_GREATER_THAN = 2;
      public static final int CONSTRAINT_TYPE_EQUALS       = 4;
      public static final int CONSTRAINT_TYPE_INT          = 8;
      public static final int CONSTRAINT_TYPE_BOOL         = 16;
  
      private ConstraintType()
      {
      }
  
      /**
       * Is this a valid constraint?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(final int val)
      {
          switch (val)
          {
  
              case CONSTRAINT_TYPE_NONE :
              case CONSTRAINT_TYPE_LESS_THAN :
              case CONSTRAINT_TYPE_GREATER_THAN :
              case CONSTRAINT_TYPE_EQUALS :
              case CONSTRAINT_TYPE_INT :
              case CONSTRAINT_TYPE_BOOL :
                  return true;
  
              default :
                  return false;
          }
      }
  }   // end public class ConstraintType
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Direction.java
  
  Index: Direction.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * Direction codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class Direction
  {
      public static final int DIRECTION_UNKNOWN    = -1;
      public static final int DIRECTION_UP_RIGHT   = 0;
      public static final int DIRECTION_UP_LEFT    = 1;
      public static final int DIRECTION_DOWN_RIGHT = 16;
      public static final int DIRECTION_DOWN_LEFT  = 17;
  
      private Direction()
      {
      }
  
      /**
       * Is this a valid direction?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(final int val)
      {
          switch (val)
          {
  
              case DIRECTION_UNKNOWN :
              case DIRECTION_UP_RIGHT :
              case DIRECTION_UP_LEFT :
              case DIRECTION_DOWN_RIGHT :
              case DIRECTION_DOWN_LEFT :
                  return true;
  
              default :
                  return false;
          }
      }
  }   // end public class Direction
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPAttribute.java
  
  Index: EPAttribute.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Attribute" tag
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * Attribute has no attributes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPAttribute
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPAttribute()
      {
          super(null);
      }
  }   // end public class EPAttribute
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPAttributes.java
  
  Index: EPAttributes.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Attributes"
   * tag
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * This element has no attributes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPAttributes
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPAttributes()
      {
          super(null);
      }
  }   // end public class EPAttributes
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPBottom.java
  
  Index: EPBottom.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import org.apache.poi.hssf.util.HSSFColor;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  
  import java.io.IOException;
  import java.util.Hashtable;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Bottom" tag
   *
   * This element has two attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPBottom
      extends BaseElementProcessor
  {
      private NumericResult          _style;
      private ColorCode              _color;
      private boolean                _color_fetched;
      private static final String    _style_attribute = "Style";
      private static final String    _color_attribute = "Color";
      private static final Validator _style_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return BorderStyle.isValid(number.intValue()) ? null
                                                            : new IOException(
                                                                "\"" + number
                                                                + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPBottom()
      {
          super(null);
          _style         = null;
          _color         = null;
  	_color_fetched = false;
      }
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          EPStyle pstyle = (EPStyle) getAncestor(EPStyle.class);
          if ((pstyle != null) && pstyle.isValid()) {
              Hashtable colorhash = pstyle.getColorHash();        
              HSSFColor color = null;
  
              HSSFCellStyle style = pstyle.getStyle();  //oops a little confusing
                                                        //below is the style attribute
                                                        //this is an HSSFCellStyle
                                                        //associated with EPStyle
              style.setBorderBottom((short)getStyle());
  
              ColorCode colorCode = getColor();
              if (colorCode != null) {
                  color = (HSSFColor)colorhash.get(colorCode.toString());
              }
              if (color == null) color = new HSSFColor.BLACK();
  
  
              style.setBottomBorderColor(color.getIndex());
          }
          
      }    
      
      
      
  
      /**
       * @return style as an int from BorderStyle
       *
       * @exception IOException
       */
  
      public int getStyle()
          throws IOException
      {
          if (_style == null)
          {
              _style =
                  NumericConverter.extractInteger(getValue(_style_attribute),
                                                  _style_validator);
          }
          return _style.intValue();
      }
  
      /**
       * @return color
       *
       * @exception IOException
       */
  
      public ColorCode getColor()
          throws IOException
      {
          if (!_color_fetched)
          {
  	    String colorString = getValue(_color_attribute);
  	    if (colorString != null)
  	    {
  		_color = new ColorCode(colorString);
  	    }
  	    _color_fetched = true;
          }
          return _color;
      }
  }   // end public class EPBottom
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPButton.java
  
  Index: EPButton.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Button" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPButton
      extends BaseElementProcessor
  {
      private String                 _label;
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private static final String    _label_attribute              = "Label";
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPButton()
      {
          super(null);
          _label              = null;
          _object_bound       = null;
          _object_offset      = null;
          _object_anchor_type = null;
          _direction          = null;
      }
  
      /**
       * @return label
       *
       * @exception IOException
       */
  
      public String getLabel()
          throws IOException
      {
          if (_label == null)
          {
              _label = getValue(_label_attribute);
              if (_label == null)
              {
                  throw new IOException("missing " + _label_attribute
                                        + " attribute");
              }
          }
          return _label;
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  }   // end public class EPButton
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPCell.java
  
  Index: EPCell.java
  ===================================================================
  
  /*
   * =========================================================================
   *
   *                 The POI Project Software License,  Version 1.1
   *                           (based on APL 1.1)
   *         Copyright (c) 2002 SuperLink Software, Inc. and Marcus Johnson
   *                           All rights reserved.
   *
   * =========================================================================
   *
   * Redistribution and use in source and binary forms,  with or without modi-
   * fication, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code  must retain the above copyright notice
   *    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 acknowlegement:
   *
   *       "This product includes  software developed  by SuperLink
   *        Software, Inc. <www.superlinksoftware.com> and Marcus Johnson as
   *        well as other POI project <poi.sourceforge.net> contributers"
   *
   *    Alternately, this acknowlegement may appear in the software itself, if
   *    and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names  "POI",  "HSSF", "SuperLink Software, Inc." and "Marcus
   *    Johnson"  must not be used  to endorse or promote  products derived
   *    from this  software without  prior  written  permission.  For  written
   *    permission, please contact <andyoliver at yahoo dot com>.
   *
   * 5. Products derived from this software may not be called "POI" nor may
   *    "POI" appear in their names without prior written permission of
   *    SuperLink Software, Inc.
   *
   * 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 SUPERLINK SOFTWARE, INC., ANDREW C. OLIVER OR  THE   CONTRIBUTORS  TO
   * THE POI PROJECT BE LIABLE  FOR ANY  DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR  CONSEQUENTIAL DAMAGES (INCLUDING,  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 indivi-
   * duals on behalf of  SuperLink Software, Inc.  For more information
   * on the SuperLink Software, Inc, please see
   * <http://www.superlinksoftware.com/>.  For more information on the POI
   * project see <www.sf.net/projects/poi>.
   *
   * =========================================================================
   */
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * implementation of ElementProcessor to handle the "Cell" tag
   *
   * This element has several attributes and may contain other elements.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPCell
      extends BaseElementProcessor
  {
      private Cell                   _cell;
      private NumericResult          _col;
      private NumericResult          _row;
      private NumericResult          _expr_id;
      private NumericResult          _cols;
      private NumericResult          _rows;
      private NumericResult          _value_type;
      private String                 _value_format;
      private boolean                _expr_id_fetched;
      private boolean                _cols_fetched;
      private boolean                _rows_fetched;
      private boolean                _value_type_fetched;
      private boolean                _value_format_fetched;
      private static final String    _col_attribute          = "Col";
      private static final String    _row_attribute          = "Row";
      private static final String    _expr_id_attribute      = "ExprID";
      private static final String    _cols_attribute         = "Cols";
      private static final String    _rows_attribute         = "Rows";
      private static final String    _value_type_attribute   = "ValueType";
      private static final String    _value_format_attribute = "ValueFormat";
      private static final Validator _cell_type_validator    = new Validator()
      {
          public IOException validate(final Number number)
          {
              return CellType.isValid(number.intValue()) ? null
                                                         : new IOException(
                                                             "\"" + number
                                                             + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPCell()
      {
          super(null);
          _cell                 = null;
          _col                  = null;
          _row                  = null;
          _expr_id              = null;
          _cols                 = null;
          _rows                 = null;
          _value_type           = null;
          _value_format         = null;
          _expr_id_fetched      = false;
          _cols_fetched         = false;
          _rows_fetched         = false;
          _value_type_fetched   = false;
          _value_format_fetched = false;
      }
  
      /**
       * @return column
       *
       * @exception IOException
       */
  
      public int getColumn()
          throws IOException
      {
          if (_col == null)
          {
              _col = NumericConverter
                  .extractNonNegativeInteger(getValue(_col_attribute));
          }
          return _col.intValue();
      }
  
      /**
       * @return row
       *
       * @exception IOException
       */
  
      public int getRow()
          throws IOException
      {
          if (_row == null)
          {
              _row = NumericConverter
                  .extractNonNegativeInteger(getValue(_row_attribute));
          }
          return _row.intValue();
      }
  
      /**
       * @return expression id
       *
       * @exception IOException
       * @exception NullPointerException
       */
  
      public int getExpressionId()
          throws IOException, NullPointerException
      {
          if (!_expr_id_fetched)
          {
              String valueString = getValue(_expr_id_attribute);
  
              if (valueString != null)
              {
                  _expr_id =
                      NumericConverter.extractPositiveInteger(valueString);
              }
              _expr_id_fetched = true;
          }
          return _expr_id.intValue();
      }
  
      /**
       * @return columns
       *
       * @exception IOException
       * @exception NullPointerException
       */
  
      public int getColumns()
          throws IOException, NullPointerException
      {
          if (!_cols_fetched)
          {
              String valueString = getValue(_cols_attribute);
  
              if (valueString != null)
              {
                  _cols = NumericConverter.extractPositiveInteger(valueString);
              }
              _cols_fetched = true;
          }
          return _cols.intValue();
      }
  
      /**
       * @return rows
       *
       * @exception IOException
       * @exception NullPointerException
       */
  
      public int getRows()
          throws IOException, NullPointerException
      {
          if (!_rows_fetched)
          {
              String valueString = getValue(_rows_attribute);
  
              if (valueString != null)
              {
                  _rows = NumericConverter.extractPositiveInteger(valueString);
              }
              _rows_fetched = true;
          }
          return _rows.intValue();
      }
  
      /**
       * @return cell type as a public member of CellType
       *
       * @exception IOException, NullPointerException
       * @exception NullPointerException
       */
  
      public int getCellType()
          throws IOException, NullPointerException
      {
          if (!_value_type_fetched)
          {
              String valueString = getValue(_value_type_attribute);
  
              if (valueString != null)
              {
                  _value_type = NumericConverter.extractInteger(valueString,
                          _cell_type_validator);
              }
              _value_type_fetched = true;
          }
          return _value_type.intValue();
      }
  
      /**
       * @return format string; null if no such attribute
       *
       * @exception IOException
       */
  
      public String getFormat()
          throws IOException
      {
          if (!_value_format_fetched)
          {
              _value_format         = getValue(_value_format_attribute);
              _value_format_fetched = true;
          }
          return _value_format;
      }
  
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          int cellType = -1;
  
          try
          {
              cellType = getCellType();
          }
          catch (NullPointerException ignored)
          {
          }
          _cell = getSheet().getRow(( short ) getRow()).createCell(getColumn(),
                                    cellType);
          
         
      }
  
      /**
       * override of getCell()
       *
       * @return the cell
       */
  
      protected Cell getCell()
      {
          return _cell;
      }
  }   // end public class EPCell
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPCellComment.java
  
  Index: EPCellComment.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "CellComment" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPCellComment
      extends BaseElementProcessor
  {
      private String                 _author;
      private String                 _text;
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private static final String    _author_attribute             = "Author";
      private static final String    _text_attribute               = "Text";
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPCellComment()
      {
          super(null);
          _author             = null;
          _text               = null;
          _object_bound       = null;
          _object_offset      = null;
          _object_anchor_type = null;
          _direction          = null;
      }
  
      /**
       * @return author
       *
       * @exception IOException
       */
  
      public String getAuthor()
          throws IOException
      {
          if (_author == null)
          {
              _author = getValue(_author_attribute);
              if (_author == null)
              {
                  throw new IOException("missing " + _author_attribute
                                        + " attribute");
              }
          }
          return _author;
      }
  
      /**
       * @return text
       *
       * @exception IOException
       */
  
      public String getText()
          throws IOException
      {
          if (_text == null)
          {
              _text = getValue(_text_attribute);
              if (_text == null)
              {
                  throw new IOException("missing " + _text_attribute
                                        + " attribute");
              }
          }
          return _text;
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  }   // end public class EPCellComment
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPCells.java
  
  Index: EPCells.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Cells" tag
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPCells
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPCells()
      {
          super(null);
      }
  }   // end public class EPCells
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPCheckbox.java
  
  Index: EPCheckbox.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "Checkbox" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPCheckbox
      extends BaseElementProcessor
  {
      private String                 _input;
      private NumericResult          _value;
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private static final String    _input_attribute              = "Input";
      private static final String    _value_attribute              = "Value";
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPCheckbox()
      {
          super(null);
          _input              = null;
          _value              = null;
          _object_bound       = null;
          _object_offset      = null;
          _object_anchor_type = null;
          _direction          = null;
      }
  
      /**
       * @return input
       *
       * @exception IOException
       */
  
      public String getInput()
          throws IOException
      {
          if (_input == null)
          {
              _input = getValue(_input_attribute);
              if (_input == null)
              {
                  throw new IOException("missing " + _input_attribute
                                        + " attribute");
              }
          }
          return _input;
      }
  
      /**
       * @return value
       *
       * @exception IOException
       */
  
      public int getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  NumericConverter.extractInteger(getValue(_value_attribute));
          }
          return _value.intValue();
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  }   // end public class EPCheckbox
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPColInfo.java
  
  Index: EPColInfo.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "ColInfo"
   * tag
   *
   * This element has several attributes and has no content
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPColInfo
      extends BaseElementProcessor
  {
  
      // column number
      private NumericResult          _no;
  
      // size, in points
      private NumericResult          _unit;
  
      // top margin, in points
      private NumericResult          _margin_a;
  
      // bottom margin, in points
      private NumericResult          _margin_b;
  
      // true if size is explicitly set
      private BooleanResult          _hard_size;
  
      // true if column is hidden
      private BooleanResult          _hidden;
  
      // true if column is collapsed
      private BooleanResult          _collapsed;
  
      // outline level
      private NumericResult          _outline_level;
  
      // rle count
      private NumericResult          _count;
      private static final String    _no_attribute            = "No";
      private static final String    _unit_attribute          = "Unit";
      private static final String    _margin_a_attribute      = "MarginA";
      private static final String    _margin_b_attribute      = "MarginB";
      private static final String    _hard_size_attribute     = "HardSize";
      private static final String    _hidden_attribute        = "Hidden";
      private static final String    _collapsed_attribute     = "Collapsed";
      private static final String    _outline_level_attribute = "OutlineLevel";
      private static final String    _count_attribute         = "Count";
      private static final Validator _margin_validator        = new Validator()
      {
          public IOException validate(final Number number)
          {
              int val = number.intValue();
  
              return ((val >= 0) && (val <= 7)) ? null
                                                : new IOException(
                                                    "\"" + number
                                                    + "\" is not a legal value");
          }
      };
      private static final Attribute[] _implied_attributes =
      {
          new Attribute(_hard_size_attribute, "0"),
          new Attribute(_hidden_attribute, "0"),
          new Attribute(_collapsed_attribute, "0"),
          new Attribute(_outline_level_attribute, "0"),
          new Attribute(_count_attribute, "1")
      };
  
      /**
       * constructor
       */
  
      public EPColInfo()
      {
          super(_implied_attributes);
          _no            = null;
          _unit          = null;
          _margin_a      = null;
          _margin_b      = null;
          _hard_size     = null;
          _hidden        = null;
          _collapsed     = null;
          _outline_level = null;
          _count         = null;
      }
  
      /**
       * @return column number
       *
       * @exception IOException
       */
  
      public int getColumnNo()
          throws IOException
      {
          if (_no == null)
          {
              _no = NumericConverter
                  .extractNonNegativeInteger(getValue(_no_attribute));
          }
          return _no.intValue();
      }
  
      /**
       * @return column size in points
       *
       * @exception IOException
       */
  
      public double getPoints()
          throws IOException
      {
          if (_unit == null)
          {
              _unit = NumericConverter.extractDouble(getValue(_unit_attribute));
          }
          return _unit.doubleValue();
      }
  
      /**
       * @return top margin
       *
       * @exception IOException
       */
  
      public int getTopMargin()
          throws IOException
      {
          if (_margin_a == null)
          {
              _margin_a =
                  NumericConverter.extractInteger(getValue(_margin_a_attribute),
                                                  _margin_validator);
          }
          return _margin_a.intValue();
      }
  
      /**
       * @return bottom margin
       *
       * @exception IOException
       */
  
      public int getBottomMargin()
          throws IOException
      {
          if (_margin_b == null)
          {
              _margin_b =
                  NumericConverter.extractInteger(getValue(_margin_b_attribute),
                                                  _margin_validator);
          }
          return _margin_b.intValue();
      }
  
      /**
       * @return hard size
       *
       * @exception IOException
       */
  
      public boolean getHardSize()
          throws IOException
      {
          if (_hard_size == null)
          {
              _hard_size =
                  BooleanConverter
                      .extractBoolean(getValue(_hard_size_attribute));
          }
          return _hard_size.booleanValue();
      }
  
      /**
       * @return hidden state
       *
       * @exception IOException
       */
  
      public boolean getHidden()
          throws IOException
      {
          if (_hidden == null)
          {
              _hidden =
                  BooleanConverter.extractBoolean(getValue(_hidden_attribute));
          }
          return _hidden.booleanValue();
      }
  
      /**
       * @return collapsed state
       *
       * @exception IOException
       */
  
      public boolean getCollapsed()
          throws IOException
      {
          if (_collapsed == null)
          {
              _collapsed =
                  BooleanConverter
                      .extractBoolean(getValue(_collapsed_attribute));
          }
          return _collapsed.booleanValue();
      }
  
      /**
       * @return outline level
       *
       * @exception IOException
       */
  
      public int getOutlineLevel()
          throws IOException
      {
          if (_outline_level == null)
          {
              _outline_level =
                  NumericConverter
                      .extractInteger(getValue(_outline_level_attribute));
          }
          return _outline_level.intValue();
      }
  
      /**
       * @return rle count
       *
       * @exception IOException
       */
  
      public int getRLECount()
          throws IOException
      {
          if (_count == null)
          {
              _count =
                  NumericConverter.extractInteger(getValue(_count_attribute));
          }
          return _count.intValue();
      }
  
      /**
       * Set this column's width
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          getSheet().setColumnWidth(getColumnNo(), getPoints());
      }
  }   // end public class EPColInfo
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPCols.java
  
  Index: EPCols.java
  ===================================================================
  
  /*
   * =========================================================================
   *
   *                 The POI Project Software License,  Version 1.1
   *                           (based on APL 1.1)
   *         Copyright (c) 2002 SuperLink Software, Inc. and Marcus Johnson
   *                           All rights reserved.
   *
   * =========================================================================
   *
   * Redistribution and use in source and binary forms,  with or without modi-
   * fication, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code  must retain the above copyright notice
   *    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 acknowlegement:
   *
   *       "This product includes  software developed  by SuperLink
   *        Software, Inc. <www.superlinksoftware.com> and Marcus Johnson as
   *        well as other POI project <poi.sourceforge.net> contributers"
   *
   *    Alternately, this acknowlegement may appear in the software itself, if
   *    and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names  "POI",  "HSSF", "SuperLink Software, Inc." and "Marcus
   *    Johnson"  must not be used  to endorse or promote  products derived
   *    from this  software without  prior  written  permission.  For  written
   *    permission, please contact <andyoliver at yahoo dot com>.
   *
   * 5. Products derived from this software may not be called "POI" nor may
   *    "POI" appear in their names without prior written permission of
   *    SuperLink Software, Inc.
   *
   * 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 SUPERLINK SOFTWARE, INC., ANDREW C. OLIVER OR  THE   CONTRIBUTORS  TO
   * THE POI PROJECT BE LIABLE  FOR ANY  DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR  CONSEQUENTIAL DAMAGES (INCLUDING,  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 indivi-
   * duals on behalf of  SuperLink Software, Inc.  For more information
   * on the SuperLink Software, Inc, please see
   * <http://www.superlinksoftware.com/>.  For more information on the POI
   * project see <www.sf.net/projects/poi>.
   *
   * =========================================================================
   */
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Cols" tag
   *
   * This element has an attribute (DefaultSizePts) and is a container
   * element
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPCols
      extends BaseElementProcessor
  {
      private NumericResult       _default_size_pts;
      private boolean             _default_size_pts_fetched;
      private static final String _default_size_pts_attribute =
          "DefaultSizePts";
  
      // package scope so test code can access
      static final String         DEFAULT_SIZE_PTS            = "40.0";
  
      /**
       * constructor
       */
  
      public EPCols()
      {
          super(null);
          _default_size_pts         = null;
          _default_size_pts_fetched = false;
      }
  
      /**
       * get the default size of columns, in points
       *
       * @return size in points
       *
       * @exception IOException if the attribute is malformed
       * @exception NullPointerException if the attribute is missing
       */
  
      public double getDefaultSizePts()
          throws IOException, NullPointerException
      {
          if (!_default_size_pts_fetched)
          {
              String value = getValue(_default_size_pts_attribute);
  
              if ((value == null) || value.trim().equals(""))
              {
                  value = DEFAULT_SIZE_PTS;
              }
              _default_size_pts         = NumericConverter.extractDouble(value);
              _default_size_pts_fetched = true;
          }
          return _default_size_pts.doubleValue();
      }
  
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          getSheet().setDefaultColumnWidth(getDefaultSizePts());
      }
  }   // end public class EPCols
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPConstr.java
  
  Index: EPConstr.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Constr" tag
   *
   * This element contains several attributes and no content or other
   * elements.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPConstr
      extends BaseElementProcessor
  {
      private NumericResult          _lcol;
      private NumericResult          _lrow;
      private NumericResult          _rcol;
      private NumericResult          _rrow;
      private NumericResult          _cols;
      private NumericResult          _rows;
      private NumericResult          _type;
      private static final String    _lcol_attribute = "Lcol";
      private static final String    _lrow_attribute = "Lrow";
      private static final String    _rcol_attribute = "Rcol";
      private static final String    _rrow_attribute = "Rrow";
      private static final String    _cols_attribute = "Cols";
      private static final String    _rows_attribute = "Rows";
      private static final String    _type_attribute = "Type";
      private static final Validator _type_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return ConstraintType.isValid(number.intValue()) ? null
                                                               : new IOException(
                                                                   "\""
                                                                   + number
                                                                   + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPConstr()
      {
          super(null);
          _lcol = null;
          _lrow = null;
          _rcol = null;
          _rrow = null;
          _cols = null;
          _rows = null;
          _type = null;
      }
  
      /**
       * @return lcol
       *
       * @exception IOException
       */
  
      public int getLcol()
          throws IOException
      {
          if (_lcol == null)
          {
              _lcol =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_lcol_attribute));
          }
          return _lcol.intValue();
      }
  
      /**
       * @return lrow
       *
       * @exception IOException
       */
  
      public int getLrow()
          throws IOException
      {
          if (_lrow == null)
          {
              _lrow =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_lrow_attribute));
          }
          return _lrow.intValue();
      }
  
      /**
       * @return rcol
       *
       * @exception IOException
       */
  
      public int getRcol()
          throws IOException
      {
          if (_rcol == null)
          {
              _rcol =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_rcol_attribute));
          }
          return _rcol.intValue();
      }
  
      /**
       * @return rrow
       *
       * @exception IOException
       */
  
      public int getRrow()
          throws IOException
      {
          if (_rrow == null)
          {
              _rrow =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_rrow_attribute));
          }
          return _rrow.intValue();
      }
  
      /**
       * @return cols
       *
       * @exception IOException
       */
  
      public int getCols()
          throws IOException
      {
          if (_cols == null)
          {
              _cols =
                  NumericConverter
                      .extractPositiveInteger(getValue(_cols_attribute));
          }
          return _cols.intValue();
      }
  
      /**
       * @return rows
       *
       * @exception IOException
       */
  
      public int getRows()
          throws IOException
      {
          if (_rows == null)
          {
              _rows =
                  NumericConverter
                      .extractPositiveInteger(getValue(_rows_attribute));
          }
          return _rows.intValue();
      }
  
      /**
       * @return type
       *
       * @exception IOException
       */
  
      public int getType()
          throws IOException
      {
          if (_type == null)
          {
              _type = NumericConverter.extractInteger(getValue(_type_attribute),
                                                      _type_validator);
          }
          return _type.intValue();
      }
  }   // end public class EPConstr
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPContent.java
  
  Index: EPContent.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Content"
   * tag
   *
   * This element has no attributes and holds its parent element's
   * content.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPContent
      extends BaseElementProcessor
  {
      private String _content;
  
      /**
       * constructor
       */
  
      public EPContent()
      {
          super(null);
          _content = null;
      }
  
      /**
       * @return content
       */
  
      public String getContent()
      {
          if (_content == null)
          {
              _content = getData();
          }
          return _content;
      }
  
      /**
       * end processing -- pass their content up to their cell
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          getCell().setContent(getContent());
      }
  }   // end public class EPContent
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPDiagonal.java
  
  Index: EPDiagonal.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Diagonal"
   * tag
   *
   * This element has two attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPDiagonal
      extends BaseElementProcessor
  {
      private NumericResult          _style;
      private boolean                _color_fetched;
      private ColorCode              _color;
      private static final String    _style_attribute = "Style";
      private static final String    _color_attribute = "Color";
      private static final Validator _style_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return BorderStyle.isValid(number.intValue()) ? null
                                                            : new IOException(
                                                                "\"" + number
                                                                + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPDiagonal()
      {
          super(null);
          _style         = null;
          _color         = null;
  	_color_fetched = false;
      }
  
      /**
       * @return style as an int from BorderStyle
       *
       * @exception IOException
       */
  
      public int getStyle()
          throws IOException
      {
          if (_style == null)
          {
              _style =
                  NumericConverter.extractInteger(getValue(_style_attribute),
                                                  _style_validator);
          }
          return _style.intValue();
      }
  
      /**
       * @return color
       *
       * @exception IOException
       */
  
      public ColorCode getColor()
          throws IOException
      {
          if (!_color_fetched)
          {
  	    String colorString = getValue(_color_attribute);
  	    if (colorString != null)
  	    {
  		_color = new ColorCode(colorString);
  	    }
  	    _color_fetched = true;
          }
          return _color;
      }
  }   // end public class EPDiagonal
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPFont.java
  
  Index: EPFont.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  import org.apache.poi.hssf.usermodel.HSSFFont;
  import org.apache.poi.hssf.util.HSSFColor;
  
  import java.io.IOException;
  import java.util.Hashtable;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Font" tag
   *
   * This element has five attributes and also holds the name of the
   * font as element content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPFont
      extends BaseElementProcessor
  {
      private NumericResult          _unit;
      private BooleanResult          _bold;
      private BooleanResult          _italic;
      private NumericResult          _underline;
      private BooleanResult          _strike_through;
      private String                 _font;
      private static final String    _unit_attribute           = "Unit";
      private static final String    _bold_attribute           = "Bold";
      private static final String    _italic_attribute         = "Italic";
      private static final String    _underline_attribute      = "Underline";
      private static final String    _strike_through_attribute =
          "StrikeThrough";
      private static final Validator _underline_type_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return UnderlineType.isValid(number.intValue()) ? null
                                                              : new IOException(
                                                                  "\"" + number
                                                                  + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPFont()
      {
          super(null);
          _unit           = null;
          _bold           = null;
          _italic         = null;
          _underline      = null;
          _strike_through = null;
          _font           = null;
      }
      
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          EPStyle pstyle = (EPStyle) parent;
          if (pstyle.isValid()) {
              Hashtable colorhash = pstyle.getColorHash();
              HSSFColor color = null;
  
              HSSFCellStyle style = pstyle.getStyle();
              //style.setFillForegroundColor(
              Workbook workbook = getWorkbook();
              HSSFFont font = workbook.createFont();
              style.setFont(font);
              font.setFontHeightInPoints((short)getUnit());
              font.setFontName(getFont());
              font.setItalic(getItalic());
              if (getBold()) {
                  font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
              } else {
                  font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);            
              }
              font.setUnderline((byte)getUnderline());
              font.setStrikeout(getStrikeThrough());
  
              color = (HSSFColor)colorhash.get(pstyle.getForegroundColor().toString());
              //System.out.println(pstyle.getForegroundColor().toString());
              if (color == null) color = new HSSFColor.BLACK();
              font.setColor(color.getIndex());
          }
      }    
      
  
      /**
       * @return unit
       *
       * @exception IOException
       */
  
      public double getUnit()
          throws IOException
      {
          if (_unit == null)
          {
              _unit = NumericConverter.extractDouble(getValue(_unit_attribute));
          }
          return _unit.doubleValue();
      }
  
      /**
       * @return bold
       *
       * @exception IOException
       */
  
      public boolean getBold()
          throws IOException
      {
          if (_bold == null)
          {
              _bold =
                  BooleanConverter.extractBoolean(getValue(_bold_attribute));
          }
          return _bold.booleanValue();
      }
  
      /**
       * @return italic
       *
       * @exception IOException
       */
  
      public boolean getItalic()
          throws IOException
      {
          if (_italic == null)
          {
              _italic =
                  BooleanConverter.extractBoolean(getValue(_italic_attribute));
          }
          return _italic.booleanValue();
      }
  
      /**
       * @return underline as one of the public variables in
       *         UnderlineType
       *
       * @exception IOException
       */
  
      public int getUnderline()
          throws IOException
      {
          if (_underline == null)
          {
              _underline = NumericConverter.extractInteger(
                  getValue(_underline_attribute), _underline_type_validator);
          }
          return _underline.intValue();
      }
  
      /**
       * @return strikeThrough
       *
       * @exception IOException
       */
  
      public boolean getStrikeThrough()
          throws IOException
      {
          if (_strike_through == null)
          {
              _strike_through =
                  BooleanConverter
                      .extractBoolean(getValue(_strike_through_attribute));
          }
          return _strike_through.booleanValue();
      }
  
      /**
       * @return name of the font
       */
  
      public String getFont()
      {
          if (_font == null)
          {
              _font = getData();
          }
          return _font;
      }
  }   // end public class EPFont
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPFooter.java
  
  Index: EPFooter.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Footer" tag
   *
   * This element has three attributes: Left, Middle, and Top, and no
   * contents.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPFooter
      extends BaseElementProcessor
  {
      private String              _left;
      private String              _middle;
      private String              _right;
      private static final String _left_attribute   = "Left";
      private static final String _middle_attribute = "Middle";
      private static final String _right_attribute  = "Right";
  
      /**
       * constructor
       */
  
      public EPFooter()
      {
          super(null);
          _left   = null;
          _middle = null;
          _right  = null;
      }
  
      /**
       * @return the left string
       */
  
      public String getLeft()
      {
          if (_left == null)
          {
              _left = getValue(_left_attribute);
              if (_left == null)
              {
                  _left = "";
              }
          }
          return _left;
      }
  
      /**
       * @return the middle string
       */
  
      public String getMiddle()
      {
          if (_middle == null)
          {
              _middle = getValue(_middle_attribute);
              if (_middle == null)
              {
                  _middle = "";
              }
          }
          return _middle;
      }
  
      /**
       * @return the right string
       */
  
      public String getRight()
      {
          if (_right == null)
          {
              _right = getValue(_right_attribute);
              if (_right == null)
              {
                  _right = "";
              }
          }
          return _right;
      }
  }   // end public class EPFooter
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPFrame.java
  
  Index: EPFrame.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Frame" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPFrame
      extends BaseElementProcessor
  {
      private String                 _label;
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private static final String    _label_attribute              = "Label";
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPFrame()
      {
          super(null);
          _label              = null;
          _object_bound       = null;
          _object_offset      = null;
          _object_anchor_type = null;
          _direction          = null;
      }
  
      /**
       * @return label
       *
       * @exception IOException
       */
  
      public String getLabel()
          throws IOException
      {
          if (_label == null)
          {
              _label = getValue(_label_attribute);
              if (_label == null)
              {
                  throw new IOException("missing " + _label_attribute
                                        + " attribute");
              }
          }
          return _label;
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  }   // end public class EPFrame
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPGeometry.java
  
  Index: EPGeometry.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Geometry" tag
   *
   * This element has two attributes: Width and Height
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPGeometry
      extends BaseElementProcessor
  {
      private static final String _width_attribute  = "Width";
      private static final String _height_attribute = "Height";
      private NumericResult       _width;
      private NumericResult       _height;
  
      /**
       * constructor
       */
  
      public EPGeometry()
      {
          super(null);
          _width  = null;
          _height = null;
      }
  
      /**
       * @return height
       *
       * @exception IOException
       */
  
      int getHeight()
          throws IOException
      {
          if (_height == null)
          {
              _height =
                  NumericConverter
                      .extractPositiveInteger(getValue(_height_attribute));
          }
          return _height.intValue();
      }
  
      /**
       * @return width
       *
       * @exception IOException
       */
  
      int getWidth()
          throws IOException
      {
          if (_width == null)
          {
              _width =
                  NumericConverter
                      .extractPositiveInteger(getValue(_width_attribute));
          }
          return _width.intValue();
      }
  }   // end public class EPGeometry
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPHeader.java
  
  Index: EPHeader.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Header" tag
   *
   * This element has three attributes: Left, Middle, and Top, and no
   * contents.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPHeader
      extends BaseElementProcessor
  {
      private String              _left;
      private String              _middle;
      private String              _right;
      private static final String _left_attribute   = "Left";
      private static final String _middle_attribute = "Middle";
      private static final String _right_attribute  = "Right";
  
      /**
       * constructor
       */
  
      public EPHeader()
      {
          super(null);
          _left   = null;
          _middle = null;
          _right  = null;
      }
  
      /**
       * @return the left string
       */
  
      public String getLeft()
      {
          if (_left == null)
          {
              _left = getValue(_left_attribute);
              if (_left == null)
              {
                  _left = "";
              }
          }
          return _left;
      }
  
      /**
       * @return the middle string
       */
  
      public String getMiddle()
      {
          if (_middle == null)
          {
              _middle = getValue(_middle_attribute);
              if (_middle == null)
              {
                  _middle = "";
              }
          }
          return _middle;
      }
  
      /**
       * @return the right string
       */
  
      public String getRight()
      {
          if (_right == null)
          {
              _right = getValue(_right_attribute);
              if (_right == null)
              {
                  _right = "";
              }
          }
          return _right;
      }
  }   // end public class EPHeader
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPItem.java
  
  Index: EPItem.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Item" tag
   *
   * This element has no attributes and contains other elements
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPItem
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPItem()
      {
          super(null);
      }
  }   // end public class EPItem
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPLabel.java
  
  Index: EPLabel.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Label" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPLabel
      extends BaseElementProcessor
  {
      private String                 _label;
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private static final String    _label_attribute              = "Label";
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPLabel()
      {
          super(null);
          _label              = null;
          _object_bound       = null;
          _object_offset      = null;
          _object_anchor_type = null;
          _direction          = null;
      }
  
      /**
       * @return label
       *
       * @exception IOException
       */
  
      public String getLabel()
          throws IOException
      {
          if (_label == null)
          {
              _label = getValue(_label_attribute);
              if (_label == null)
              {
                  throw new IOException("missing " + _label_attribute
                                        + " attribute");
              }
          }
          return _label;
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  }   // end public class EPLabel
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPLeft.java
  
  Index: EPLeft.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import org.apache.poi.hssf.util.HSSFColor;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  
  import java.io.IOException;
  import java.util.Hashtable;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Left" tag
   *
   * This element has two attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPLeft
      extends BaseElementProcessor
  {
      private NumericResult          _style;
      private ColorCode              _color;
      private boolean                _color_fetched;
      private static final String    _style_attribute = "Style";
      private static final String    _color_attribute = "Color";
      private static final Validator _style_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return BorderStyle.isValid(number.intValue()) ? null
                                                            : new IOException(
                                                                "\"" + number
                                                                + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPLeft()
      {
          super(null);
          _style         = null;
          _color         = null;
  	_color_fetched = false;
      }
      
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          EPStyle pstyle = (EPStyle)getAncestor(EPStyle.class);
          if ((pstyle != null) &&  pstyle.isValid()) {
              Hashtable colorhash = pstyle.getColorHash();        
              HSSFColor color = null;
  
              HSSFCellStyle style = pstyle.getStyle();  //oops a little confusing
                                                        //below is the style attribute
                                                        //this is an HSSFCellStyle
                                                        //associated with EPStyle
              style.setBorderLeft((short)getStyle());
  
              ColorCode colorCode = getColor();
              if (colorCode != null) {
                  color = (HSSFColor)colorhash.get(colorCode.toString());
              }
              if (color == null) color = new HSSFColor.BLACK();
  
  
              style.setLeftBorderColor(color.getIndex());
          }
          
      }        
  
      /**
       * @return style as an int from BorderStyle
       *
       * @exception IOException
       */
  
      public int getStyle()
          throws IOException
      {
          if (_style == null)
          {
              _style =
                  NumericConverter.extractInteger(getValue(_style_attribute),
                                                  _style_validator);
          }
          return _style.intValue();
      }
  
      /**
       * @return color
       *
       * @exception IOException
       */
  
      public ColorCode getColor()
          throws IOException
      {
          if (!_color_fetched)
          {
  	    String colorString = getValue(_color_attribute);
  	    if (colorString != null)
  	    {
  		_color = new ColorCode(colorString);
  	    }
  	    _color_fetched = true;
          }
          return _color;
      }
  }   // end public class EPLeft
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMargins.java
  
  Index: EPMargins.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Margins" tag
   *
   * This is a container element with no attributes.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPMargins
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPMargins()
      {
          super(null);
      }
  }   // end public class EPMargins
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMaxCol.java
  
  Index: EPMaxCol.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "MaxCol" tag
   *
   * This element contains the maximum number of columns in the
   * containing sheet. The value is contained in the data.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPMaxCol
      extends BaseElementProcessor
  {
      private NumericResult _max_col;
  
      /**
       * constructor
       */
  
      public EPMaxCol()
      {
          super(null);
          _max_col = null;
      }
  
      /**
       * get the maximum column for the containing sheet
       *
       * @return maximum column number
       *
       * @exception IOException if the data is malformed
       */
  
      public int getMaxCol()
          throws IOException
      {
          if (_max_col == null)
          {
              _max_col = NumericConverter.extractPositiveInteger(getData());
          }
          return _max_col.intValue();
      }
  }   // end public class EPMaxCol
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMaxRow.java
  
  Index: EPMaxRow.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "MaxRow" tag
   *
   * This element contains the maximum number of rows in the containing
   * sheet. The value is contained in the data.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPMaxRow
      extends BaseElementProcessor
  {
      private NumericResult _max_row;
  
      /**
       * constructor
       */
  
      public EPMaxRow()
      {
          super(null);
          _max_row = null;
      }
  
      /**
       * get the maximum row for the containing sheet
       *
       * @return maximum row number
       *
       * @exception IOException if the data is malformed
       */
  
      public int getMaxRow()
          throws IOException
      {
          if (_max_row == null)
          {
              _max_row = NumericConverter.extractPositiveInteger(getData());
          }
          return _max_row.intValue();
      }
  }   // end public class EPMaxRow
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPName.java
  
  Index: EPName.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Name" tag
   *
   * This element contains the name of the containing Sheet
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPName
      extends BaseElementProcessor
  {
      private String _name;
  
      /**
       * constructor
       */
  
      public EPName()
      {
          super(null);
          _name = null;
      }
  
      /**
       * @return the name of the spreadsheet (may be empty)
       */
  
      public String getName()
      {
          if (_name == null)
          {
              _name = getData();
          }
          return _name;
      }
  
      /**
       * give the sheet its name
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          getSheet().renameSheet(getName());
      }
  }   // end public class EPName
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPNames.java
  
  Index: EPNames.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Names" tag
   *
   * This element has no attributes and contains a string.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPNames
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPNames()
      {
          super(null);
      }
  }   // end public class EPNames
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPObjects.java
  
  Index: EPObjects.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Objects" tag
   *
   * This element is a container element with no attributes.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPObjects
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPObjects()
      {
          super(null);
      }
  }   // end public class EPObjects
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPPrintInformation.java
  
  Index: EPPrintInformation.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "PrintInformation" tag
   *
   * This element is a container element with no attributes.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPPrintInformation
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPPrintInformation()
      {
          super(null);
      }
  }   // end public class EPPrintInformation
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPRev_Diagonal.java
  
  Index: EPRev_Diagonal.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "Rev-Diagonal" tag
   *
   * This element has two attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPRev_Diagonal
      extends BaseElementProcessor
  {
      private NumericResult          _style;
      private boolean                _color_fetched;
      private ColorCode              _color;
      private static final String    _style_attribute = "Style";
      private static final String    _color_attribute = "Color";
      private static final Validator _style_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return BorderStyle.isValid(number.intValue()) ? null
                                                            : new IOException(
                                                                "\"" + number
                                                                + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPRev_Diagonal()
      {
          super(null);
          _style         = null;
          _color         = null;
  	_color_fetched = false;
      }
  
      /**
       * @return style as an int from BorderStyle
       *
       * @exception IOException
       */
  
      public int getStyle()
          throws IOException
      {
          if (_style == null)
          {
              _style =
                  NumericConverter.extractInteger(getValue(_style_attribute),
                                                  _style_validator);
          }
          return _style.intValue();
      }
  
      /**
       * @return color
       *
       * @exception IOException
       */
  
      public ColorCode getColor()
          throws IOException
      {
          if (!_color_fetched)
          {
  	    String colorString = getValue(_color_attribute);
  	    if (colorString != null)
  	    {
  		_color = new ColorCode(colorString);
  	    }
  	    _color_fetched = true;
          }
          return _color;
      }
  }   // end public class EPRev_Diagonal
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPRight.java
  
  Index: EPRight.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import org.apache.poi.hssf.util.HSSFColor;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  
  import java.io.IOException;
  import java.util.Hashtable;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Right" tag
   *
   * This element has two attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPRight
      extends BaseElementProcessor
  {
      private NumericResult          _style;
      private ColorCode              _color;
      private boolean                _color_fetched;
      private static final String    _style_attribute = "Style";
      private static final String    _color_attribute = "Color";
      private static final Validator _style_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return BorderStyle.isValid(number.intValue()) ? null
                                                            : new IOException(
                                                                "\"" + number
                                                                + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPRight()
      {
          super(null);
          _style         = null;
          _color         = null;
  	_color_fetched = false;
      }
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          EPStyle pstyle = (EPStyle)getAncestor(EPStyle.class);
          if ((pstyle != null) && pstyle.isValid()) {
              Hashtable colorhash = pstyle.getColorHash();        
              HSSFColor color = null;
  
              HSSFCellStyle style = pstyle.getStyle();  //oops a little confusing
                                                        //below is the style attribute
                                                        //this is an HSSFCellStyle
                                                        //associated with EPStyle
              style.setBorderRight((short)getStyle());
  
              ColorCode colorCode = getColor();
              if (colorCode != null) {
                  color = (HSSFColor)colorhash.get(colorCode.toString());
              }
              if (color == null) color = new HSSFColor.BLACK();
  
  
              style.setRightBorderColor(color.getIndex());
          }
          
      }        
  
      /**
       * @return style as an int from BorderStyle
       *
       * @exception IOException
       */
  
      public int getStyle()
          throws IOException
      {
          if (_style == null)
          {
              _style =
                  NumericConverter.extractInteger(getValue(_style_attribute),
                                                  _style_validator);
          }
          return _style.intValue();
      }
  
      /**
       * @return color
       *
       * @exception IOException
       */
  
      public ColorCode getColor()
          throws IOException
      {
          if (!_color_fetched)
          {
  	    String colorString = getValue(_color_attribute);
  	    if (colorString != null)
  	    {
  		_color = new ColorCode(colorString);
  	    }
  	    _color_fetched = true;
          }
          return _color;
      }
  }   // end public class EPRight
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPRowInfo.java
  
  Index: EPRowInfo.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "RowInfo"
   * tag
   *
   * This element has several attributes and has no content
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPRowInfo
      extends BaseElementProcessor
  {
  
      // row number
      private NumericResult          _no;
  
      // size, in points
      private NumericResult          _unit;
  
      // left margin, in points
      private NumericResult          _margin_a;
  
      // right margin, in points
      private NumericResult          _margin_b;
  
      // true if size is explicitly set
      private BooleanResult          _hard_size;
  
      // true if row is hidden
      private BooleanResult          _hidden;
  
      // true if row is collapsed
      private BooleanResult          _collapsed;
  
      // outline level
      private NumericResult          _outline_level;
  
      // rle count
      private NumericResult          _count;
      private static final String    _no_attribute            = "No";
      private static final String    _unit_attribute          = "Unit";
      private static final String    _margin_a_attribute      = "MarginA";
      private static final String    _margin_b_attribute      = "MarginB";
      private static final String    _hard_size_attribute     = "HardSize";
      private static final String    _hidden_attribute        = "Hidden";
      private static final String    _collapsed_attribute     = "Collapsed";
      private static final String    _outline_level_attribute = "OutlineLevel";
      private static final String    _count_attribute         = "Count";
      private static final Validator _margin_validator        = new Validator()
      {
          public IOException validate(final Number number)
          {
              int val = number.intValue();
  
              return ((val >= 0) && (val <= 7)) ? null
                                                : new IOException(
                                                    "\"" + number
                                                    + "\" is not a legal value");
          }
      };
      private static final Attribute[] _implied_attributes =
      {
          new Attribute(_hard_size_attribute, "0"),
          new Attribute(_hidden_attribute, "0"),
          new Attribute(_collapsed_attribute, "0"),
          new Attribute(_outline_level_attribute, "0"),
          new Attribute(_count_attribute, "1")
      };
  
      /**
       * constructor
       */
  
      public EPRowInfo()
      {
          super(_implied_attributes);
          _no            = null;
          _unit          = null;
          _margin_a      = null;
          _margin_b      = null;
          _hard_size     = null;
          _hidden        = null;
          _collapsed     = null;
          _outline_level = null;
          _count         = null;
      }
  
      /**
       * @return row number
       *
       * @exception IOException
       */
  
      public int getRowNo()
          throws IOException
      {
          if (_no == null)
          {
              _no = NumericConverter
                  .extractNonNegativeInteger(getValue(_no_attribute));
          }
          return _no.intValue();
      }
  
      /**
       * @return row size in points
       *
       * @exception IOException
       */
  
      public double getPoints()
          throws IOException
      {
          if (_unit == null)
          {
              _unit = NumericConverter.extractDouble(getValue(_unit_attribute));
          }
          return _unit.doubleValue();
      }
  
      /**
       * @return left margin
       *
       * @exception IOException
       */
  
      public int getLeftMargin()
          throws IOException
      {
          if (_margin_a == null)
          {
              _margin_a =
                  NumericConverter.extractInteger(getValue(_margin_a_attribute),
                                                  _margin_validator);
          }
          return _margin_a.intValue();
      }
  
      /**
       * @return right margin
       *
       * @exception IOException
       */
  
      public int getRightMargin()
          throws IOException
      {
          if (_margin_b == null)
          {
              _margin_b =
                  NumericConverter.extractInteger(getValue(_margin_b_attribute),
                                                  _margin_validator);
          }
          return _margin_b.intValue();
      }
  
      /**
       * @return hard size
       *
       * @exception IOException
       */
  
      public boolean getHardSize()
          throws IOException
      {
          if (_hard_size == null)
          {
              _hard_size =
                  BooleanConverter
                      .extractBoolean(getValue(_hard_size_attribute));
          }
          return _hard_size.booleanValue();
      }
  
      /**
       * @return hidden state
       *
       * @exception IOException
       */
  
      public boolean getHidden()
          throws IOException
      {
          if (_hidden == null)
          {
              _hidden =
                  BooleanConverter.extractBoolean(getValue(_hidden_attribute));
          }
          return _hidden.booleanValue();
      }
  
      /**
       * @return collapsed state
       *
       * @exception IOException
       */
  
      public boolean getCollapsed()
          throws IOException
      {
          if (_collapsed == null)
          {
              _collapsed =
                  BooleanConverter
                      .extractBoolean(getValue(_collapsed_attribute));
          }
          return _collapsed.booleanValue();
      }
  
      /**
       * @return outline level
       *
       * @exception IOException
       */
  
      public int getOutlineLevel()
          throws IOException
      {
          if (_outline_level == null)
          {
              _outline_level =
                  NumericConverter
                      .extractInteger(getValue(_outline_level_attribute));
          }
          return _outline_level.intValue();
      }
  
      /**
       * @return rle count
       *
       * @exception IOException
       */
  
      public int getRLECount()
          throws IOException
      {
          if (_count == null)
          {
              _count =
                  NumericConverter.extractInteger(getValue(_count_attribute));
          }
          return _count.intValue();
      }
  
      /**
       * Set this row's height
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          int row = getRowNo();
  
          if (row > Short.MAX_VALUE)
          {
              throw new IOException("Illegal row value: " + row);
          }
          getSheet().getRow(( short ) row).setHeight(getPoints());
      }
  }   // end public class EPRowInfo
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPRows.java
  
  Index: EPRows.java
  ===================================================================
  
  /*
   * ========================================================================= 
   *                                                                           
   *                 The POI Project Software License,  Version 1.1            
   *                           (based on APL 1.1)                              
   *         Copyright (c) 2002 SuperLink Software, Inc. and Marcus Johnson    
   *                           All rights reserved.                            
   *                                                                           
   * ========================================================================= 
   *                                                                           
   * Redistribution and use in source and binary forms,  with or without modi- 
   * fication, are permitted provided that the following conditions are met:   
   *                                                                           
   * 1. Redistributions of source code  must retain the above copyright notice 
   *    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 acknowlegement:                             
   *                                                                           
   *       "This product includes  software developed  by SuperLink            
   *        Software, Inc. <www.superlinksoftware.com> and Marcus Johnson as   
   *        well as other POI project <poi.sourceforge.net> contributers"      
   *                                                                           
   *    Alternately, this acknowlegement may appear in the software itself, if 
   *    and wherever such third-party acknowlegements normally appear.         
   *                                                                           
   * 4. The names  "POI",  "HSSF", "SuperLink Software, Inc." and "Marcus      
   *    Johnson"  must not be used  to endorse or promote  products derived    
   *    from this  software without  prior  written  permission.  For  written 
   *    permission, please contact <andyoliver at yahoo dot com>.              
   *                                                                           
   * 5. Products derived from this software may not be called "POI" nor may    
   *    "POI" appear in their names without prior written permission of        
   *    SuperLink Software, Inc.                                               
   *                                                                           
   * 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 SUPERLINK SOFTWARE, INC., ANDREW C. OLIVER OR  THE   CONTRIBUTORS  TO 
   * THE POI PROJECT BE LIABLE  FOR ANY  DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR  CONSEQUENTIAL DAMAGES (INCLUDING,  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 indivi- 
   * duals on behalf of  SuperLink Software, Inc.  For more information        
   * on the SuperLink Software, Inc, please see                                
   * <http://www.superlinksoftware.com/>.  For more information on the POI     
   * project see <www.sf.net/projects/poi>.                                    
   *                                                                           
   * ========================================================================= 
   */
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Rows" tag
   *
   * This element has an attribute (DefaultSizePts) and is a container
   * element
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPRows
      extends BaseElementProcessor
  {
      private NumericResult       _default_size_pts;
      private static final String _default_size_pts_attribute =
          "DefaultSizePts";
  
      // package scope so test code can see it
      static final String         DEFAULT_SIZE_PTS            = "12.8";
  
      /**
       * constructor
       */
  
      public EPRows()
      {
          super(null);
          _default_size_pts = null;
      }
  
      /**
       * get the default size of rows, in points
       *
       * @return size in points
       *
       * @exception IOException if the attribute is missing or malformed
       */
  
      public double getDefaultSizePts()
          throws IOException
      {
          if (_default_size_pts == null)
          {
              String value = getValue(_default_size_pts_attribute);
  
              if ((value == null) || value.trim().equals(""))
              {
                  value = DEFAULT_SIZE_PTS;
              }
              _default_size_pts = NumericConverter.extractDouble(value);
          }
          return _default_size_pts.doubleValue();
      }
  
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          getSheet().setDefaultRowHeight(getDefaultSizePts());
      }
  }   // end public class EPRows
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSelection.java
  
  Index: EPSelection.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "Selection" tag
   *
   * This element is a container of other elements and has four
   * attributes that define the boundaries of the region.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSelection
      extends BaseElementProcessor
  {
      private static final String _start_col_attribute = "startCol";
      private static final String _start_row_attribute = "startRow";
      private static final String _end_col_attribute   = "endCol";
      private static final String _end_row_attribute   = "endRow";
      private NumericResult       _start_col;
      private NumericResult       _start_row;
      private NumericResult       _end_col;
      private NumericResult       _end_row;
  
      /**
       * constructor
       */
  
      public EPSelection()
      {
          super(null);
          _start_col = null;
          _start_row = null;
          _end_col   = null;
          _end_row   = null;
      }
  
      /**
       * @return start row
       *
       * @exception IOException
       */
  
      public int getStartRow()
          throws IOException
      {
          if (_start_row == null)
          {
              _start_row = NumericConverter
                  .extractNonNegativeInteger(getValue(_start_row_attribute));
          }
          return _start_row.intValue();
      }
  
      /**
       * @return start column
       *
       * @exception IOException
       */
  
      public int getStartCol()
          throws IOException
      {
          if (_start_col == null)
          {
              _start_col = NumericConverter
                  .extractNonNegativeInteger(getValue(_start_col_attribute));
          }
          return _start_col.intValue();
      }
  
      /**
       * @return end row
       *
       * @exception IOException
       */
  
      public int getEndRow()
          throws IOException
      {
          if (_end_row == null)
          {
              _end_row =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_end_row_attribute));
          }
          return _end_row.intValue();
      }
  
      /**
       * @return end column
       *
       * @exception IOException
       */
  
      public int getEndCol()
          throws IOException
      {
          if (_end_col == null)
          {
              _end_col =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_end_col_attribute));
          }
          return _end_col.intValue();
      }
  }   // end public class EPSelection
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSelections.java
  
  Index: EPSelections.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Selections"
   * tag
   *
   * This element is a container element with two attributes: CursorCol
   * and CursorRow, which presumable show where the cursor should be.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSelections
      extends BaseElementProcessor
  {
      private static final String _cursor_col_attribute = "CursorCol";
      private static final String _cursor_row_attribute = "CursorRow";
      private NumericResult       _cursor_col;
      private NumericResult       _cursor_row;
  
      /**
       * constructor
       */
  
      public EPSelections()
      {
          super(null);
          _cursor_col = null;
          _cursor_row = null;
      }
  
      /**
       * @return cursor column
       *
       * @exception IOException
       */
  
      public int getCursorCol()
          throws IOException
      {
          if (_cursor_col == null)
          {
              _cursor_col = NumericConverter
                  .extractNonNegativeInteger(getValue(_cursor_col_attribute));
          }
          return _cursor_col.intValue();
      }
  
      /**
       * @return cursor row
       *
       * @exception IOException
       */
  
      public int getCursorRow()
          throws IOException
      {
          if (_cursor_row == null)
          {
              _cursor_row = NumericConverter
                  .extractNonNegativeInteger(getValue(_cursor_row_attribute));
          }
          return _cursor_row.intValue();
      }
  }   // end public class EPSelections
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheet.java
  
  Index: EPSheet.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Sheet" tag
   *
   * This element contains other elements and has the following boolean
   * attributes:
   * <ul>
   * <li>DisplayFormulas
   * <li>HideZero
   * <li>HideGrid
   * <li>HideColHeader
   * <li>HideRowHeader
   * <li>DisplayOutlines
   * <li>OutlineSymbolsBelow
   * <li>OutlineSymbolsRight
   * </ul>
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com) 
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPSheet
      extends BaseElementProcessor
  {
      private Sheet               _sheet;
      private BooleanResult       _display_formulas;
      private BooleanResult       _hide_zero;
      private BooleanResult       _hide_grid;
      private BooleanResult       _hide_col_header;
      private BooleanResult       _hide_row_header;
      private BooleanResult       _display_outlines;
      private BooleanResult       _outline_symbols_below;
      private BooleanResult       _outline_symbols_right;
      private static final String _display_formulas_attribute      =
          "DisplayFormulas";
      private static final String _hide_zero_attribute             = "HideZero";
      private static final String _hide_grid_attribute             = "HideGrid";
      private static final String _hide_col_header_attribute       =
          "HideColHeader";
      private static final String _hide_row_header_attribute       =
          "HideRowHeader";
      private static final String _display_outlines_attribute      =
          "DisplayOutlines";
      private static final String _outline_symbols_below_attribute =
          "OutlineSymbolsBelow";
      private static final String _outline_symbols_right_attribute =
          "OutlineSymbolsRight";
  
      /**
       * constructor
       */
  
      public EPSheet()
      {
          super(null);
          _display_formulas      = null;
          _hide_zero             = null;
          _hide_grid             = null;
          _hide_col_header       = null;
          _hide_row_header       = null;
          _display_outlines      = null;
          _outline_symbols_below = null;
          _outline_symbols_right = null;
      }
  
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          try
          {
              _sheet = new Sheet(getWorkbook());
          }
          catch (IOException e)
          {
              throw e;
          }
          catch (Exception e)
          {
              throw new IOException(e.getMessage());
          }
      }
      
      /**
       * override of endProcessing().  Reponsible for fixing
       * style regions with blank cells.
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          _sheet.assignBlanksToRegions();
      }
      
      
  
      /**
       * override of getSheet()
       *
       * @return the sheet
       */
  
      protected Sheet getSheet()
      {
          return _sheet;
      }
  
      /**
       * @return true if formulas should be displayed
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getDisplayFormulas()
          throws IOException
      {
          if (_display_formulas == null)
          {
              _display_formulas =
                  BooleanConverter
                      .extractBoolean(getValue(_display_formulas_attribute));
          }
          return _display_formulas.booleanValue();
      }
  
      /**
       * @return true if zeroes should be suppressed
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getHideZero()
          throws IOException
      {
          if (_hide_zero == null)
          {
              _hide_zero =
                  BooleanConverter
                      .extractBoolean(getValue(_hide_zero_attribute));
          }
          return _hide_zero.booleanValue();
      }
  
      /**
       * @return true if grid should be hidden
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getHideGrid()
          throws IOException
      {
          if (_hide_grid == null)
          {
              _hide_grid =
                  BooleanConverter
                      .extractBoolean(getValue(_hide_grid_attribute));
          }
          return _hide_grid.booleanValue();
      }
  
      /**
       * @return true if column headers should be hidden
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getHideColHeader()
          throws IOException
      {
          if (_hide_col_header == null)
          {
              _hide_col_header =
                  BooleanConverter
                      .extractBoolean(getValue(_hide_col_header_attribute));
          }
          return _hide_col_header.booleanValue();
      }
  
      /**
       * @return true if row headers should be hidden
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getHideRowHeader()
          throws IOException
      {
          if (_hide_row_header == null)
          {
              _hide_row_header =
                  BooleanConverter
                      .extractBoolean(getValue(_hide_row_header_attribute));
          }
          return _hide_row_header.booleanValue();
      }
  
      /**
       * @return true if outlines should be displayed
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getDisplayOutlines()
          throws IOException
      {
          if (_display_outlines == null)
          {
              _display_outlines =
                  BooleanConverter
                      .extractBoolean(getValue(_display_outlines_attribute));
          }
          return _display_outlines.booleanValue();
      }
  
      /**
       * @return true if outline symbols are below
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getOutlineSymbolsBelow()
          throws IOException
      {
          if (_outline_symbols_below == null)
          {
              _outline_symbols_below = BooleanConverter
                  .extractBoolean(getValue(_outline_symbols_below_attribute));
          }
          return _outline_symbols_below.booleanValue();
      }
  
      /**
       * @return true if outline symbols are on the right
       *
       * @exception IOException if attribute is missing or malformed
       */
  
      public boolean getOutlineSymbolsRight()
          throws IOException
      {
          if (_outline_symbols_right == null)
          {
              _outline_symbols_right = BooleanConverter
                  .extractBoolean(getValue(_outline_symbols_right_attribute));
          }
          return _outline_symbols_right.booleanValue();
      }
  }   // end public class EPSheet
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheetName.java
  
  Index: EPSheetName.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "SheetName"
   * tag
   *
   * This element has no attributes and contains a string
   *
   * This element is not used in HSSFSerializer 1.0 and probably never
   * will be, as the gnumeric code indicates that it is a kludge
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSheetName
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPSheetName()
      {
          super(null);
      }
  }   // end public class EPSheetName
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheetNameIndex.java
  
  Index: EPSheetNameIndex.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "SheetNameIndex" tag
   *
   * This element has no attributes and contains other elements
   *
   * This element is not used in HSSFSerializer 1.0 and probably never
   * will be, as the gnumeric code indicates that it is a kludge
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSheetNameIndex
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPSheetNameIndex()
      {
          super(null);
      }
  }   // end public class EPSheetNameIndex
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheetObjectBonobo.java
  
  Index: EPSheetObjectBonobo.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "SheetObjectBonobo" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSheetObjectBonobo
      extends BaseElementProcessor
  {
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPSheetObjectBonobo()
      {
          super(null);
          _object_bound       = null;
          _object_offset      = null;
          _object_anchor_type = null;
          _direction          = null;
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  }   // end public class EPSheetObjectBonobo
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheetObjectFilled.java
  
  Index: EPSheetObjectFilled.java
  ===================================================================
  
  /*
   * =========================================================================
   *
   *                 The POI Project Software License,  Version 1.1
   *                           (based on APL 1.1)
   *         Copyright (c) 2002 SuperLink Software, Inc. and Marcus Johnson
   *                           All rights reserved.
   *
   * =========================================================================
   *
   * Redistribution and use in source and binary forms,  with or without modi-
   * fication, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code  must retain the above copyright notice
   *    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 acknowlegement:
   *
   *       "This product includes  software developed  by SuperLink
   *        Software, Inc. <www.superlinksoftware.com> and Marcus Johnson as
   *        well as other POI project <poi.sourceforge.net> contributers"
   *
   *    Alternately, this acknowlegement may appear in the software itself, if
   *    and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names  "POI",  "HSSF", "SuperLink Software, Inc." and "Marcus
   *    Johnson"  must not be used  to endorse or promote  products derived
   *    from this  software without  prior  written  permission.  For  written
   *    permission, please contact <andyoliver at yahoo dot com>.
   *
   * 5. Products derived from this software may not be called "POI" nor may
   *    "POI" appear in their names without prior written permission of
   *    SuperLink Software, Inc.
   *
   * 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 SUPERLINK SOFTWARE, INC., ANDREW C. OLIVER OR  THE   CONTRIBUTORS  TO
   * THE POI PROJECT BE LIABLE  FOR ANY  DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR  CONSEQUENTIAL DAMAGES (INCLUDING,  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 indivi-
   * duals on behalf of  SuperLink Software, Inc.  For more information
   * on the SuperLink Software, Inc, please see
   * <http://www.superlinksoftware.com/>.  For more information on the POI
   * project see <www.sf.net/projects/poi>.
   *
   * =========================================================================
   */
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "SheetObjectFilled" tag
   *
   * This element has a small number of Attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSheetObjectFilled
      extends BaseElementProcessor
  {
      private String                 _object_bound;
      private Offsets                _object_offset;
      private Anchors                _object_anchor_type;
      private NumericResult          _direction;
      private ColorCode              _outline_color;
      private ColorCode              _fill_color;
      private NumericResult          _type;
      private NumericResult          _width;
      private NumericResult          _arrow_shape_a;
      private NumericResult          _arrow_shape_b;
      private NumericResult          _arrow_shape_c;
      private boolean                _arrow_shape_a_fetched;
      private boolean                _arrow_shape_b_fetched;
      private boolean                _arrow_shape_c_fetched;
      private static final String    _object_bound_attribute       =
          "ObjectBound";
      private static final String    _object_offset_attribute      =
          "ObjectOffset";
      private static final String    _object_anchor_type_attribute =
          "ObjectAnchorType";
      private static final String    _direction_attribute          =
          "Direction";
      private static final String    _outline_color_attribute      =
          "OutlineColor";
      private static final String    _fill_color_attribute         =
          "FillColor";
      private static final String    _type_attribute               = "Type";
      private static final String    _width_attribute              = "Width";
      private static final String    _arrow_shape_a_attribute      =
          "ArrowShapeA";
      private static final String    _arrow_shape_b_attribute      =
          "ArrowShapeB";
      private static final String    _arrow_shape_c_attribute      =
          "ArrowShapeC";
      private static final Validator _direction_validator          =
          new Validator()
      {
          public IOException validate(final Number number)
          {
              return Direction.isValid(number.intValue()) ? null
                                                          : new IOException(
                                                              "\"" + number
                                                              + "\" is not a legal value");
          }
      };
      private static final Validator _object_fill_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return ObjectFill.isValid(number.intValue()) ? null
                                                           : new IOException(
                                                               "\"" + number
                                                               + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPSheetObjectFilled()
      {
          super(null);
          _object_bound          = null;
          _object_offset         = null;
          _object_anchor_type    = null;
          _direction             = null;
          _outline_color         = null;
          _fill_color            = null;
          _type                  = null;
          _width                 = null;
          _arrow_shape_a         = null;
          _arrow_shape_b         = null;
          _arrow_shape_c         = null;
          _arrow_shape_a_fetched = false;
          _arrow_shape_b_fetched = false;
          _arrow_shape_c_fetched = false;
      }
  
      /**
       * @return object_bound
       *
       * @exception IOException
       */
  
      public String getObjectBound()
          throws IOException
      {
          if (_object_bound == null)
          {
              _object_bound = getValue(_object_bound_attribute);
              if (_object_bound == null)
              {
                  throw new IOException("missing " + _object_bound_attribute
                                        + " attribute");
              }
          }
          return _object_bound;
      }
  
      /**
       * @return offsets
       *
       * @exception IOException
       */
  
      public Offsets getOffsets()
          throws IOException
      {
          if (_object_offset == null)
          {
              _object_offset = new Offsets(getValue(_object_offset_attribute));
          }
          return _object_offset;
      }
  
      /**
       * @return anchors
       *
       * @exception IOException
       */
  
      public Anchors getAnchors()
          throws IOException
      {
          if (_object_anchor_type == null)
          {
              _object_anchor_type =
                  new Anchors(getValue(_object_anchor_type_attribute));
          }
          return _object_anchor_type;
      }
  
      /**
       * @return direction as a public member of Direction
       *
       * @exception IOException
       */
  
      public int getDirection()
          throws IOException
      {
          if (_direction == null)
          {
              _direction = NumericConverter.extractInteger(
                  getValue(_direction_attribute), _direction_validator);
          }
          return _direction.intValue();
      }
  
      /**
       * @return outline color
       *
       * @exception IOException
       */
  
      public ColorCode getOutlineColor()
          throws IOException
      {
          if (_outline_color == null)
          {
              _outline_color =
                  new ColorCode(getValue(_outline_color_attribute));
          }
          return _outline_color;
      }
  
      /**
       * @return fill color
       *
       * @exception IOException
       */
  
      public ColorCode getFillColor()
          throws IOException
      {
          if (_fill_color == null)
          {
              _fill_color = new ColorCode(getValue(_fill_color_attribute));
          }
          return _fill_color;
      }
  
      /**
       * @return type as a public member of ObjectFill
       *
       * @exception IOException
       */
  
      public int getType()
          throws IOException
      {
          if (_type == null)
          {
              _type = NumericConverter.extractInteger(getValue(_type_attribute),
                                                      _object_fill_validator);
          }
          return _type.intValue();
      }
  
      /**
       * @return width
       *
       * @exception IOException
       */
  
      public int getWidth()
          throws IOException
      {
          if (_width == null)
          {
              _width =
                  NumericConverter
                      .extractPositiveInteger(getValue(_width_attribute));
          }
          return _width.intValue();
      }
  
      /**
       * @return arrow shape a
       *
       * @exception IOException
       * @exception NullPointerException
       */
  
      public double getArrowShapeA()
          throws IOException, NullPointerException
      {
          if (!_arrow_shape_a_fetched)
          {
              _arrow_shape_a_fetched  = true;
              String arrowShapeString = getValue(_arrow_shape_a_attribute);
              if (arrowShapeString != null)
              {
                  _arrow_shape_a =
                      NumericConverter.extractDouble(arrowShapeString);
              }
              else
              {
                  throw new NullPointerException("attribute "
                                                 + _arrow_shape_a_attribute
                                                 + " is absent");
              }
          }
          return _arrow_shape_a.doubleValue();
      }
  
      /**
       * @return arrow shape b
       *
       * @exception IOException, NullPointerException
       * @exception NullPointerException
       */
  
      public double getArrowShapeB()
          throws IOException, NullPointerException
      {
          if (!_arrow_shape_b_fetched)
          {
              _arrow_shape_b_fetched  = true;
              String arrowShapeString = getValue(_arrow_shape_b_attribute);
              if (arrowShapeString != null)
              {
                  _arrow_shape_b =
                      NumericConverter.extractDouble(arrowShapeString);
              }
              else
              {
                  throw new NullPointerException("attribute "
                                                 + _arrow_shape_b_attribute
                                                 + " is absent");
              }
          }
          return _arrow_shape_b.doubleValue();
      }
  
      /**
       * @return arrow shape c
       *
       * @exception IOException, NullPointerException
       * @exception NullPointerException
       */
  
      public double getArrowShapeC()
          throws IOException, NullPointerException
      {
          if (!_arrow_shape_c_fetched)
          {
              _arrow_shape_c_fetched  = true;
              String arrowShapeString = getValue(_arrow_shape_c_attribute);
              if (arrowShapeString != null)
              {
                  _arrow_shape_c =
                      NumericConverter.extractDouble(arrowShapeString);
              }
              else
              {
                  throw new NullPointerException("attribute "
                                                 + _arrow_shape_c_attribute
                                                 + " is absent");
              }
          }
          return _arrow_shape_c.doubleValue();
      }
  }   // end public class EPSheetObjectFilled
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSheets.java
  
  Index: EPSheets.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Sheets" tag
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSheets
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPSheets()
      {
          super(null);
      }
  }   // end public class EPSheets
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSolver.java
  
  Index: EPSolver.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Solver" tag
   *
   * This element is a container with four atributes (TargetRow,
   * TargetCol, and ProblemType are integers, and Inputs is a String)
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSolver
      extends BaseElementProcessor
  {
      private NumericResult       _target_row;
      private NumericResult       _target_col;
      private NumericResult       _problem_type;
      private String              _inputs;
      private static final String _target_row_attribute   = "TargetRow";
      private static final String _target_col_attribute   = "TargetCol";
      private static final String _problem_type_attribute = "ProblemType";
      private static final String _inputs_attribute       = "Inputs";
  
      /**
       * constructor
       */
  
      public EPSolver()
      {
          super(null);
          _target_row   = null;
          _target_col   = null;
          _problem_type = null;
          _inputs       = null;
      }
  
      /**
       * @return target column
       *
       * @exception IOException
       */
  
      public int getTargetCol()
          throws IOException
      {
          if (_target_col == null)
          {
              _target_col =
                  NumericConverter
                      .extractInteger(getValue(_target_col_attribute));
          }
          return _target_col.intValue();
      }
  
      /**
       * @return target row
       *
       * @exception IOException
       */
  
      public int getTargetRow()
          throws IOException
      {
          if (_target_row == null)
          {
              _target_row =
                  NumericConverter
                      .extractInteger(getValue(_target_row_attribute));
          }
          return _target_row.intValue();
      }
  
      /**
       * @return problem type
       *
       * @exception IOException
       */
  
      public int getProblemType()
          throws IOException
      {
          if (_problem_type == null)
          {
              _problem_type =
                  NumericConverter
                      .extractInteger(getValue(_problem_type_attribute));
          }
          return _problem_type.intValue();
      }
  
      /**
       * @return inputs
       */
  
      public String getInputs()
      {
          if (_inputs == null)
          {
              String value = getValue(_inputs_attribute);
  
              _inputs = (value == null) ? ""
                                        : value.trim();
          }
          return _inputs;
      }
  }   // end public class EPSolver
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPStyle.java
  
  Index: EPStyle.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import org.apache.poi.hssf.util.Region;
  import org.apache.poi.hssf.util.HSSFColor;
  
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  
  import java.io.IOException;
  import java.util.Hashtable;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Style" tag
   *
   * This element is a container of other elements and has several
   * attributes
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPStyle
      extends BaseElementProcessor
  {
      private HorizontalAlignment    _h_align;
      private VerticalAlignment      _v_align;
      private BooleanResult          _wrap_text;
      private StyleOrientation       _orient;
      private NumericResult          _shade;
      private NumericResult          _indent;
      private ColorCode              _fore;
      private ColorCode              _back;
      private ColorCode              _pattern_color;
      private String                 _format;   
      private static final String    _h_align_attribute       = "HAlign";
      private static final String    _v_align_attribute       = "VAlign";
      private static final String    _wrap_text_attribute     = "WrapText";
      private static final String    _orient_attribute        = "Orient";
      private static final String    _shade_attribute         = "Shade";
      private static final String    _indent_attribute        = "Indent";
      private static final String    _fore_attribute          = "Fore";
      private static final String    _back_attribute          = "Back";
      private static final String    _pattern_color_attribute = "PatternColor";
      private static final String    _format_attribute        = "Format";
      
      private boolean invalid;
      
      private static final Validator _shade_validator         = new Validator()
      {
          public IOException validate(final Number number)
          {
              return StyleShading.isValid(number.intValue()) ? null
                                                             : new IOException(
                                                                 "\"" + number
                                                                 + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPStyle()
      {
          super(null);
          _h_align       = null;
          _v_align       = null;
          _wrap_text     = null;
          _orient        = null;
          _shade         = null;
          _indent        = null;
          _fore          = null;
          _back          = null;
          _pattern_color = null;
          _format        = null;
      }
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          
          
          EPStyleRegion sregion = (EPStyleRegion) parent;
          
          if (sregion.isValid()) {
              Hashtable colorhash = sregion.getColorHash();
  
              HSSFCellStyle style = sregion.getStyle();
              style.setAlignment(getHorizontalAlignment().getCode());
              style.setAlignment(getVerticalAlignment().getCode());
              style.setFillPattern((short)getShade());
  
              if (getShade() == 1) { //normally this fill is set to true and the colors are "reversed" 
                                     //according to Gnumeric sources
                  getLogger().debug("shade = 1");
                  HSSFColor color = (HSSFColor) colorhash.get(getBackgroundColor().toString());
                  if (color == null) {
                      getLogger().debug("s1 BG couldn't find color for "+ getBackgroundColor().toString());
                      color = new HSSFColor.WHITE();           
                  }
                  style.setFillForegroundColor(color.getIndex());
                  color = (HSSFColor) colorhash.get(getPatternColor().toString());
                  if (color == null) {
                      getLogger().debug("s1 PC couldn't find color for "+ getPatternColor().toString());
                      color = new HSSFColor.BLACK();   
                  }
                  style.setFillBackgroundColor(color.getIndex());
              } else {
                  HSSFColor color = (HSSFColor) colorhash.get(getBackgroundColor().toString());
                  if (color == null) {                
                      getLogger().debug("BG couldn't find color for "+ getBackgroundColor().toString());
                      color = new HSSFColor.BLACK();   
                  }
                  style.setFillBackgroundColor(color.getIndex());            
                  color = (HSSFColor) colorhash.get(getPatternColor().toString());
                  if (color == null) {
                      getLogger().debug("PC couldn't find color for "+ getPatternColor().toString());
                      color = new HSSFColor.WHITE();     
                  }
                  style.setFillForegroundColor(color.getIndex());            
              }
              style.setWrapText(getWrapText());
              style.setLocked(true);
          } else {
              
              invalid = true;
          }
          
          
          
          
          //style.setFillForegroundColor(
      }    
      
  
      /**
       * @return true if horizontal alignment general bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalGeneral()
          throws IOException
      {
          return getHorizontalAlignment().isGeneral();
      }
  
      /**
       * @return true if horizontal alignment left bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalLeft()
          throws IOException
      {
          return getHorizontalAlignment().isLeft();
      }
  
      /**
       * @return true if horizontal alignment right bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalRight()
          throws IOException
      {
          return getHorizontalAlignment().isRight();
      }
  
      /**
       * @return true if horizontal alignment center bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalCenter()
          throws IOException
      {
          return getHorizontalAlignment().isCenter();
      }
  
      /**
       * @return true if horizontal alignment fill bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalFill()
          throws IOException
      {
          return getHorizontalAlignment().isFill();
      }
  
      /**
       * @return true if horizontal alignment justify bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalJustify()
          throws IOException
      {
          return getHorizontalAlignment().isJustify();
      }
  
      /**
       * @return true if horizontal alignment center across selection
       *         bit is set
       *
       * @exception IOException
       */
  
      public boolean isHorizontalCenterAcrossSelection()
          throws IOException
      {
          return getHorizontalAlignment().isCenterAcrossSelection();
      }
  
      /**
       * @return true if vertical alignment top bit is set
       *
       * @exception IOException
       */
  
      public boolean isVerticalTop()
          throws IOException
      {
          return getVerticalAlignment().isTop();
      }
  
      /**
       * @return true if vertical alignment bottom bit is set
       *
       * @exception IOException
       */
  
      public boolean isVerticalBottom()
          throws IOException
      {
          return getVerticalAlignment().isBottom();
      }
  
      /**
       * @return true if vertical alignment center bit is set
       *
       * @exception IOException
       */
  
      public boolean isVerticalCenter()
          throws IOException
      {
          return getVerticalAlignment().isCenter();
      }
  
      /**
       * @return true if vertical alignment justify bit is set
       *
       * @exception IOException
       */
  
      public boolean isVerticalJustify()
          throws IOException
      {
          return getVerticalAlignment().isJustify();
      }
  
      /**
       * @return true if wrap text is enabled
       *
       * @exception IOException
       */
  
      public boolean getWrapText()
          throws IOException
      {
          if (_wrap_text == null)
          {
              _wrap_text =
                  BooleanConverter
                      .extractBoolean(getValue(_wrap_text_attribute));
          }
          return _wrap_text.booleanValue();
      }
  
      /**
       * @return true if style orientation horiz bit is set
       *
       * @exception IOException
       */
  
      public boolean isStyleOrientationHoriz()
          throws IOException
      {
          return getStyleOrientation().isHoriz();
      }
  
      /**
       * @return true if style orientation vert horiz text bit is set
       *
       * @exception IOException
       */
  
      public boolean isStyleOrientationVertHorizText()
          throws IOException
      {
          return getStyleOrientation().isVertHorizText();
      }
  
      /**
       * @return true if style orientation vert vert text bit is set
       *
       * @exception IOException
       */
  
      public boolean isStyleOrientationVertVertText()
          throws IOException
      {
          return getStyleOrientation().isVertVertText();
      }
  
      /**
       * @return true if style orientation vert vert text2 bit is set
       *
       * @exception IOException
       */
  
      public boolean isStyleOrientationVertVertText2()
          throws IOException
      {
          return getStyleOrientation().isVertVertText2();
      }
  
      /**
       * @return shade as one of the public variables in StyleShading
       *
       * @exception IOException
       */
  
      public int getShade()
          throws IOException
      {
          if (_shade == null)
          {
              _shade =
                  NumericConverter.extractInteger(getValue(_shade_attribute),
                                                  _shade_validator);
          }
          return _shade.intValue();
      }
  
      /**
       * @return indent
       *
       * @exception IOException
       */
  
      public int getIndent()
          throws IOException
      {
          if (_indent == null)
          {
              _indent =
                  NumericConverter.extractInteger(getValue(_indent_attribute));
          }
          return _indent.intValue();
      }
  
      /**
       * @return foreground color
       *
       * @exception IOException
       */
  
      public ColorCode getForegroundColor()
          throws IOException
      {
          if (_fore == null)
          {
              _fore = new ColorCode(getValue(_fore_attribute));
          }
          return _fore;
      }
  
      /**
       * @return background color
       *
       * @exception IOException
       */
  
      public ColorCode getBackgroundColor()
          throws IOException
      {
          if (_back == null)
          {
              _back = new ColorCode(getValue(_back_attribute));
          }
          return _back;
      }
  
      /**
       * @return pattern color
       *
       * @exception IOException
       */
  
      public ColorCode getPatternColor()
          throws IOException
      {
          if (_pattern_color == null)
          {
              _pattern_color =
                  new ColorCode(getValue(_pattern_color_attribute));
          }
          return _pattern_color;
      }
  
      /**
       * @return format string
       *
       * @exception IOException
       */
  
      public String getFormat()
          throws IOException
      {
          if (_format == null)
          {
              _format = getValue(_format_attribute);
              if (_format == null)
              {
                  throw new IOException("missing " + _format_attribute
                                        + " attribute");
              }
          }
          return _format;
      }
  
      private HorizontalAlignment getHorizontalAlignment()
          throws IOException
      {
          if (_h_align == null)
          {
              _h_align = new HorizontalAlignment(getValue(_h_align_attribute));
          }
          return _h_align;
      }
  
      private VerticalAlignment getVerticalAlignment()
          throws IOException
      {
          if (_v_align == null)
          {
              _v_align = new VerticalAlignment(getValue(_v_align_attribute));
          }
          return _v_align;
      }
  
      private StyleOrientation getStyleOrientation()
          throws IOException
      {
          if (_orient == null)
          {
              _orient = new StyleOrientation(getValue(_orient_attribute));
          }
          return _orient;
      }
      
      /**
       * @return instance created in the EPStyles instance from HSSFColor.getTripletHash();
       * @see org.apache.poi.hssf.util.HSSFColor#getTripletHash()
       */
      Hashtable getColorHash() {
          return ((EPStyleRegion)getAncestor(EPStyleRegion.class)).getColorHash();
      }
      
      /**
       *  @return the HSSFCellStyle object associated with this style region.
       */
      HSSFCellStyle getStyle() {
          return ((EPStyleRegion)getAncestor(EPStyleRegion.class)).getStyle();
      }
      
      /**
       *
       * @return validity (used to determine whether this is a big wasteful region with
       *  no purpose (gnumeric does this)
       */
      public boolean isValid () {
          return (!invalid);
      }
      
      
  }   // end public class EPStyle
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPStyleBorder.java
  
  Index: EPStyleBorder.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "StyleBorder" tag
   *
   * This element is a container element with no attributes.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPStyleBorder
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPStyleBorder()
      {
          super(null);
      }
  }   // end public class EPStyleBorder
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPStyleRegion.java
  
  Index: EPStyleRegion.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import java.util.Hashtable;
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  import org.apache.poi.hssf.util.Region;
  
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "StyleRegion" tag
   *
   * This element is a container of other elements and has four
   * attributes that define the boundaries of the region.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPStyleRegion
      extends BaseElementProcessor
  {
      private static final String _start_col_attribute = "startCol";
      private static final String _start_row_attribute = "startRow";
      private static final String _end_col_attribute   = "endCol";
      private static final String _end_row_attribute   = "endRow";
      private NumericResult       _start_col;
      private NumericResult       _start_row;
      private NumericResult       _end_col;
      private NumericResult       _end_row;
      
      private HSSFCellStyle       _style;
      private Hashtable           colorhash;
      
      private boolean             invalid;
  
      
      //kludge constant to fix gnumeric's love of declaring large stlye regions
      //for the blank sections of the sheet w/no apparent purpose that we can
      //
      private int MAX_AREA = 2001;
      
      /**
       * constructor
       */
  
      public EPStyleRegion()
      {
          super(null);
          _start_col = null;
          _start_row = null;
          _end_col   = null;
          _end_row   = null;
      }
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          
          Region region = new Region(getStartRow(),
                                     (short)getStartCol(),
                                     getEndRow(),                                   
                                     (short)getEndCol());
          
  //        if (region.getRowFrom() == 0 &&
  //            region.getColumnFrom() ==0)
  //            getLogger().debug("got 0,0");
        
          getLogger().debug("region area is "+region.getArea());
          if(region.getArea() < MAX_AREA) {  //protect against stupid mega regions
                                         //of generally NOTHING and no real
                                         //puprose created by gnumeric
              getLogger().debug("region added");
              _style = getSheet().addStyleRegion(region
                                        ); //test
          } else {
              invalid = true;
          }
          
          colorhash = ((EPStyles)parent).getColorHash();
      }    
      
  
      /**
       * @return start row
       *
       * @exception IOException
       */
  
      public int getStartRow()
          throws IOException
      {
          if (_start_row == null)
          {
              _start_row = NumericConverter
                  .extractNonNegativeInteger(getValue(_start_row_attribute));
          }
          return _start_row.intValue();
      }
  
      /**
       * @return start column
       *
       * @exception IOException
       */
  
      public int getStartCol()
          throws IOException
      {
          if (_start_col == null)
          {
              _start_col = NumericConverter
                  .extractNonNegativeInteger(getValue(_start_col_attribute));
          }
          return _start_col.intValue();
      }
  
      /**
       * @return end row
       *
       * @exception IOException
       */
  
      public int getEndRow()
          throws IOException
      {
          if (_end_row == null)
          {
              _end_row =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_end_row_attribute));
          }
          return _end_row.intValue();
      }
  
      /**
       * @return end column
       *
       * @exception IOException
       */
  
      public int getEndCol()
          throws IOException
      {
          if (_end_col == null)
          {
              _end_col =
                  NumericConverter
                      .extractNonNegativeInteger(getValue(_end_col_attribute));
          }
          return _end_col.intValue();
      }
      
      /**
       *  @returns HSSFCellStyle associated with this style region.
       */
      public HSSFCellStyle getStyle() {
          return _style;
      }
      
      /**
       * @return instance created in the EPStyles instance from HSSFColor.getTripletHash();
       * @see org.apache.poi.hssf.util.HSSFColor#getTripletHash()
       */    
      public Hashtable getColorHash() {
          return colorhash;
      }
  
      /**
       *
       * @return validity (used to determine whether this is a big wasteful region with
       *  no purpose (gnumeric does this
       */
      public boolean isValid () {
          return (!invalid);
      }
      
  }   // end public class EPStyleRegion
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPStyles.java
  
  Index: EPStyles.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import java.util.Hashtable;
  import org.apache.poi.hssf.util.HSSFColor;
  /**
   * No-op implementation of ElementProcessor to handle the "Styles" tag
   *
   * This is a container element with no attributes
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPStyles
      extends BaseElementProcessor
  {
      private Hashtable colors;
      /**
       * constructor
       */
  
      public EPStyles()
      {
          super(null);
          colors = HSSFColor.getTripletHash();
      }
      
      /**
       *  @returns an instance of Hashtable created by HSSFColor.getTripletHash()
       *  @see org.apache.poi.hssf.util.HSSFColor#getTripletHash()
       */
      public Hashtable getColorHash() {
          return colors;
      }
  }   // end public class EPStyles
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPSummary.java
  
  Index: EPSummary.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "Summary"
   * tag
   *
   * This element has no attributes and contains other elements
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPSummary
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EPSummary()
      {
          super(null);
      }
  }   // end public class EPSummary
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPTop.java
  
  Index: EPTop.java
  ===================================================================
  
  /*
   * ========================================================================= 
   *                                                                           
   *                 The POI Project Software License,  Version 1.1            
   *                           (based on APL 1.1)                              
   *         Copyright (c) 2002 SuperLink Software, Inc. and Marcus Johnson    
   *                           All rights reserved.                            
   *                                                                           
   * ========================================================================= 
   *                                                                           
   * Redistribution and use in source and binary forms,  with or without modi- 
   * fication, are permitted provided that the following conditions are met:   
   *                                                                           
   * 1. Redistributions of source code  must retain the above copyright notice 
   *    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 acknowlegement:                             
   *                                                                           
   *       "This product includes  software developed  by SuperLink            
   *        Software, Inc. <www.superlinksoftware.com> and Marcus Johnson as   
   *        well as other POI project <poi.sourceforge.net> contributers"      
   *                                                                           
   *    Alternately, this acknowlegement may appear in the software itself, if 
   *    and wherever such third-party acknowlegements normally appear.         
   *                                                                           
   * 4. The names  "POI",  "HSSF", "SuperLink Software, Inc." and "Marcus      
   *    Johnson"  must not be used  to endorse or promote  products derived    
   *    from this  software without  prior  written  permission.  For  written 
   *    permission, please contact <andyoliver at yahoo dot com>.              
   *                                                                           
   * 5. Products derived from this software may not be called "POI" nor may    
   *    "POI" appear in their names without prior written permission of        
   *    SuperLink Software, Inc.                                               
   *                                                                           
   * 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 SUPERLINK SOFTWARE, INC., ANDREW C. OLIVER OR  THE   CONTRIBUTORS  TO 
   * THE POI PROJECT BE LIABLE  FOR ANY  DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR  CONSEQUENTIAL DAMAGES (INCLUDING,  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 indivi- 
   * duals on behalf of  SuperLink Software, Inc.  For more information        
   * on the SuperLink Software, Inc, please see                                
   * <http://www.superlinksoftware.com/>.  For more information on the POI     
   * project see <www.sf.net/projects/poi>.                                    
   *                                                                           
   * ========================================================================= 
   */
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.Attribute;
  import org.apache.cocoon.components.elementprocessor.ElementProcessor;
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import org.apache.poi.hssf.util.HSSFColor;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  
  import java.io.IOException;
  import java.util.Hashtable;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Top" tag
   *
   * This element has two attributes and no content.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  public class EPTop
      extends BaseElementProcessor
  {
      private NumericResult          _style;
      private ColorCode              _color;
      private boolean                _color_fetched;
      private static final String    _style_attribute = "Style";
      private static final String    _color_attribute = "Color";
      private static final Validator _style_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return BorderStyle.isValid(number.intValue()) ? null
                                                            : new IOException(
                                                                "\"" + number
                                                                + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EPTop()
      {
          super(null);
          _style         = null;
          _color         = null;
          _color_fetched = false;
      }
      
      
      /**
       * Override of Initialize() implementation
       *
       * @param attributes the array of Attribute instances; may be
       *                   empty, will never be null
       * @param parent the parent ElementProcessor; may be null
       * @param filesystem the POIFSFileSystem object
       *
       * @exception IOException if anything is wrong
       */
  
      public void initialize(final Attribute [] attributes,
                             final ElementProcessor parent)
          throws IOException
      {
          super.initialize(attributes, parent);
          EPStyle pstyle = (EPStyle)getAncestor(EPStyle.class);
          if ((pstyle != null) && pstyle.isValid()) {
              Hashtable colorhash = pstyle.getColorHash();        
              HSSFColor color = null;
  
              HSSFCellStyle style = pstyle.getStyle();  //oops a little confusing
                                                        //below is the style attribute
                                                        //this is an HSSFCellStyle
                                                        //associated with EPStyle
              style.setBorderTop((short)getStyle());
  
              ColorCode colorCode = getColor();
              if (colorCode != null) {
                  color = (HSSFColor)colorhash.get(colorCode.toString());
              }
              if (color == null) color = new HSSFColor.BLACK();
  
  
              style.setTopBorderColor(color.getIndex());
          }
          
      }        
      
  
      /**
       * @return style as an int from BorderStyle
       *
       * @exception IOException
       */
  
      public int getStyle()
          throws IOException
      {
          if (_style == null)
          {
              _style =
                  NumericConverter.extractInteger(getValue(_style_attribute),
                                                  _style_validator);
          }
          return _style.intValue();
      }
  
      /**
       * @return color (may be null)
       *
       * @exception IOException
       */
  
      public ColorCode getColor()
          throws IOException
      {
          if (!_color_fetched)
          {
              String colorString = getValue(_color_attribute);
  
              if (colorString != null)
              {
                  _color = new ColorCode(colorString);
              }
              _color_fetched = true;
          }
          return _color;
      }
  }   // end public class EPTop
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPUIData.java
  
  Index: EPUIData.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "UIData" tag
   *
   * This element contains no data and has an attribute, SelectedTab,
   * that indicates which sheet is currently selected
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPUIData
      extends BaseElementProcessor
  {
      private NumericResult       _selected_tab;
      private static final String _selected_tab_attribute = "SelectedTab";
  
      /**
       * constructor
       */
  
      public EPUIData()
      {
          super(null);
          _selected_tab = null;
      }
  
      /**
       * Get the selected tab
       *
       * @return the number of the currently selected sheet (tab)
       *
       * @exception IOException if the value is missing or incorrectly
       *            written
       */
  
      public int getSelectedTab()
          throws IOException
      {
          if (_selected_tab == null)
          {
              _selected_tab = NumericConverter
                  .extractNonNegativeInteger(getValue(_selected_tab_attribute));
          }
          return _selected_tab.intValue();
      }
  }   // end public class EPUIData
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPWorkbook.java
  
  Index: EPWorkbook.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import java.io.IOException;
  
  /**
   * ElementProcessor that handles the "Workbook" tag
   *
   * The Workbook element includes one attribute ("gmr"), which
   * basically gives us the Gnumeric major version. At some point we
   * might care about that, but not today.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPWorkbook
      extends BaseElementProcessor
  {
      private Workbook _workbook;
  
      /**
       * constructor
       */
  
      public EPWorkbook()
      {
  
          // the Workbook element has no implied attributes
          super(null);
          _workbook = new Workbook();
      }
  
      /**
       * override of getWorkbook()
       *
       * @return the workbook
       */
  
      protected Workbook getWorkbook()
      {
          return _workbook;
      }
  
      /**
       * override of endProcessing()
       *
       * @exception IOException
       */
  
      public void endProcessing()
          throws IOException
      {
          _workbook.write(getFilesystem());
      }
  }   // end public class EPWorkbook
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPZoom.java
  
  Index: EPZoom.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "Zoom" tag
   *
   * This element contains the most recently zoom factor
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EPZoom
      extends BaseElementProcessor
  {
      private NumericResult _zoom;
  
      /**
       * constructor
       */
  
      public EPZoom()
      {
          super(null);
          _zoom = null;
      }
  
      /**
       * get the most recently used zoom factor
       *
       * @return zoom factor
       *
       * @exception IOException if the data is malformed
       */
  
      public double getZoom()
          throws IOException
      {
          if (_zoom == null)
          {
              _zoom = NumericConverter.extractDouble(getData());
          }
          return _zoom.doubleValue();
      }
  }   // end public class EPZoom
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Bottom.java
  
  Index: EP_Bottom.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "bottom" tag
   *
   * This element has two attributes: Points and PrefUnit
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Bottom
      extends BaseElementProcessor
  {
      private static final String _points_attribute    = "Points";
      private static final String _pref_unit_attribute = "PrefUnit";
      private NumericResult       _points;
      private NumericResult       _pref_unit;
  
      /**
       * constructor
       */
  
      public EP_Bottom()
      {
          super(null);
          _points    = null;
          _pref_unit = null;
      }
  
      /**
       * @return points
       *
       * @exception IOException
       */
  
      double getPoints()
          throws IOException
      {
          if (_points == null)
          {
              _points =
                  NumericConverter.extractDouble(getValue(_points_attribute));
          }
          return _points.doubleValue();
      }
  
      /**
       * @return print unit (always one of the values in PrintUnits)
       *
       * @exception IOException
       */
  
      int getPrefUnit()
          throws IOException
      {
          if (_pref_unit == null)
          {
              _pref_unit =
                  PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute));
          }
          return _pref_unit.intValue();
      }
  }   // end public class EP_Bottom
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Default_.java
  
  Index: EP_Default_.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the any tags we
   * don't recognize
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Default_
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EP_Default_()
      {
          super(null);
      }
  }   // end public class EP_Default_
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Draft.java
  
  Index: EP_Draft.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "draft" tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Draft
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_Draft()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_Draft
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_EvenIfOnlyStyles.java
  
  Index: EP_EvenIfOnlyStyles.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "even_if_only_styles" tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_EvenIfOnlyStyles
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_EvenIfOnlyStyles()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_EvenIfOnlyStyles
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Footer.java
  
  Index: EP_Footer.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "footer" tag
   *
   * This element has two attributes: Points and PrefUnit
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Footer
      extends BaseElementProcessor
  {
      private static final String _points_attribute    = "Points";
      private static final String _pref_unit_attribute = "PrefUnit";
      private NumericResult       _points;
      private NumericResult       _pref_unit;
  
      /**
       * constructor
       */
  
      public EP_Footer()
      {
          super(null);
          _points    = null;
          _pref_unit = null;
      }
  
      /**
       * @return points
       *
       * @exception IOException
       */
  
      double getPoints()
          throws IOException
      {
          if (_points == null)
          {
              _points =
                  NumericConverter.extractDouble(getValue(_points_attribute));
          }
          return _points.doubleValue();
      }
  
      /**
       * @return print unit (always one of the values in PrintUnits)
       *
       * @exception IOException
       */
  
      int getPrefUnit()
          throws IOException
      {
          if (_pref_unit == null)
          {
              _pref_unit =
                  PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute));
          }
          return _pref_unit.intValue();
      }
  }   // end public class EP_Footer
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Grid.java
  
  Index: EP_Grid.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "grid" tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Grid
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_Grid()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_Grid
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_HCenter.java
  
  Index: EP_HCenter.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "hcenter"
   * tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_HCenter
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_HCenter()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_HCenter
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Header.java
  
  Index: EP_Header.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "header" tag
   *
   * This element has two attributes: Points and PrefUnit
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Header
      extends BaseElementProcessor
  {
      private static final String _points_attribute    = "Points";
      private static final String _pref_unit_attribute = "PrefUnit";
      private NumericResult       _points;
      private NumericResult       _pref_unit;
  
      /**
       * constructor
       */
  
      public EP_Header()
      {
          super(null);
          _points    = null;
          _pref_unit = null;
      }
  
      /**
       * @return points
       *
       * @exception IOException
       */
  
      double getPoints()
          throws IOException
      {
          if (_points == null)
          {
              _points =
                  NumericConverter.extractDouble(getValue(_points_attribute));
          }
          return _points.doubleValue();
      }
  
      /**
       * @return print unit (always one of the values in PrintUnits)
       *
       * @exception IOException
       */
  
      int getPrefUnit()
          throws IOException
      {
          if (_pref_unit == null)
          {
              _pref_unit =
                  PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute));
          }
          return _pref_unit.intValue();
      }
  }   // end public class EP_Header
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Left.java
  
  Index: EP_Left.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "left" tag
   *
   * This element has two attributes: Points and PrefUnit
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Left
      extends BaseElementProcessor
  {
      private static final String _points_attribute    = "Points";
      private static final String _pref_unit_attribute = "PrefUnit";
      private NumericResult       _points;
      private NumericResult       _pref_unit;
  
      /**
       * constructor
       */
  
      public EP_Left()
      {
          super(null);
          _points    = null;
          _pref_unit = null;
      }
  
      /**
       * @return points
       *
       * @exception IOException
       */
  
      double getPoints()
          throws IOException
      {
          if (_points == null)
          {
              _points =
                  NumericConverter.extractDouble(getValue(_points_attribute));
          }
          return _points.doubleValue();
      }
  
      /**
       * @return print unit (always one of the values in PrintUnits)
       *
       * @exception IOException
       */
  
      int getPrefUnit()
          throws IOException
      {
          if (_pref_unit == null)
          {
              _pref_unit =
                  PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute));
          }
          return _pref_unit.intValue();
      }
  }   // end public class EP_Left
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Monochrome.java
  
  Index: EP_Monochrome.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "monochrome"
   * tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Monochrome
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_Monochrome()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_Monochrome
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Name.java
  
  Index: EP_Name.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "name" tag
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * This element has no attributes, but it does have character content
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Name
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EP_Name()
      {
          super(null);
      }
  }   // end public class EP_Name
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Order.java
  
  Index: EP_Order.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "order" tag
   *
   * This element has no attributes and contains a string describing the
   * print ordering (right then down, or down then right)
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Order
      extends BaseElementProcessor
  {
      private NumericResult _print_order;
  
      /**
       * constructor
       */
  
      public EP_Order()
      {
          super(null);
          _print_order = null;
      }
  
      /**
       * @return print order (always one of the values in PrintOrder)
       *
       * @exception IOException
       */
  
      int getPrintOrder()
          throws IOException
      {
          if (_print_order == null)
          {
              _print_order = PrintOrder.extractPrintOrder(getData());
          }
          return _print_order.intValue();
      }
  }   // end public class EP_Order
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Orientation.java
  
  Index: EP_Orientation.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "orientation" tag
   *
   * This element has no attributes and contains a string describing the
   * print orientation (landscape or portrait)
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Orientation
      extends BaseElementProcessor
  {
      private NumericResult _print_orientation;
  
      /**
       * constructor
       */
  
      public EP_Orientation()
      {
          super(null);
          _print_orientation = null;
      }
  
      /**
       * @return print orientation (always one of the values in
       *         PrintOrientation)
       *
       * @exception IOException
       */
  
      int getPrintOrientation()
          throws IOException
      {
          if (_print_orientation == null)
          {
              _print_orientation =
                  PrintOrientation.extractPrintOrientation(getData());
          }
          return _print_orientation.intValue();
      }
  }   // end public class EP_Orientation
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Paper.java
  
  Index: EP_Paper.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "paper" tag
   *
   * This element contains no other elements and has no attributes. Its
   * content describes the paper to be used (e.g., A4)
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com) */
  
  public class EP_Paper
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EP_Paper()
      {
          super(null);
      }
  }   // end public class EP_Paper
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_RepeatLeft.java
  
  Index: EP_RepeatLeft.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "repeat_left" tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_RepeatLeft
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_RepeatLeft()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_RepeatLeft
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_RepeatTop.java
  
  Index: EP_RepeatTop.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the
   * "repeat_top" tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_RepeatTop
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_RepeatTop()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_RepeatTop
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Right.java
  
  Index: EP_Right.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "right" tag
   *
   * This element has two attributes: Points and PrefUnit
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Right
      extends BaseElementProcessor
  {
      private static final String _points_attribute    = "Points";
      private static final String _pref_unit_attribute = "PrefUnit";
      private NumericResult       _points;
      private NumericResult       _pref_unit;
  
      /**
       * constructor
       */
  
      public EP_Right()
      {
          super(null);
          _points    = null;
          _pref_unit = null;
      }
  
      /**
       * @return points
       *
       * @exception IOException
       */
  
      double getPoints()
          throws IOException
      {
          if (_points == null)
          {
              _points =
                  NumericConverter.extractDouble(getValue(_points_attribute));
          }
          return _points.doubleValue();
      }
  
      /**
       * @return print unit (always one of the values in PrintUnits)
       *
       * @exception IOException
       */
  
      int getPrefUnit()
          throws IOException
      {
          if (_pref_unit == null)
          {
              _pref_unit =
                  PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute));
          }
          return _pref_unit.intValue();
      }
  }   // end public class EP_Right
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Titles.java
  
  Index: EP_Titles.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "titles" tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Titles
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_Titles()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_Titles
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Top.java
  
  Index: EP_Top.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "top" tag
   *
   * This element has two attributes: Points and PrefUnit
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Top
      extends BaseElementProcessor
  {
      private static final String _points_attribute    = "Points";
      private static final String _pref_unit_attribute = "PrefUnit";
      private NumericResult       _points;
      private NumericResult       _pref_unit;
  
      /**
       * constructor
       */
  
      public EP_Top()
      {
          super(null);
          _points    = null;
          _pref_unit = null;
      }
  
      /**
       * @return points
       *
       * @exception IOException
       */
  
      double getPoints()
          throws IOException
      {
          if (_points == null)
          {
              _points =
                  NumericConverter.extractDouble(getValue(_points_attribute));
          }
          return _points.doubleValue();
      }
  
      /**
       * @return print unit (always one of the values in PrintUnits)
       *
       * @exception IOException
       */
  
      int getPrefUnit()
          throws IOException
      {
          if (_pref_unit == null)
          {
              _pref_unit =
                  PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute));
          }
          return _pref_unit.intValue();
      }
  }   // end public class EP_Top
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Type.java
  
  Index: EP_Type.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "type" tag
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * This element has no attributes, but has string content, which is
   * numeric.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Type
      extends BaseElementProcessor
  {
      private NumericResult          _type;
      private static final Validator _validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              return GTKTypes.isValid(number.intValue()) ? null
                                                         : new IOException(
                                                             "\"" + number
                                                             + "\" is not a legal value");
          }
      };
  
      /**
       * constructor
       */
  
      public EP_Type()
      {
          super(null);
          _type = null;
      }
  
      /**
       * @return the type
       *
       * @exception IOException if the type is not numeric
       */
  
      int getType()
          throws IOException
      {
          if (_type == null)
          {
              _type = NumericConverter.extractInteger(getData(), _validator);
          }
          return _type.intValue();
      }
  }   // end public class EP_Type
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_VCenter.java
  
  Index: EP_VCenter.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
  import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
  
  import java.io.IOException;
  
  /**
   * No-op implementation of ElementProcessor to handle the "vcenter"
   * tag
   *
   * This element has a single attribute, value, which is boolean.
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_VCenter
      extends BaseElementProcessor
  {
      private static final String _value_attribute = "value";
      private BooleanResult       _value;
  
      /**
       * constructor
       */
  
      public EP_VCenter()
      {
          super(null);
          _value = null;
      }
  
      /**
       * @return value
       *
       * @exception IOException if the value is malformed or missing
       */
  
      public boolean getValue()
          throws IOException
      {
          if (_value == null)
          {
              _value =
                  BooleanConverter.extractBoolean(getValue(_value_attribute));
          }
          return _value.booleanValue();
      }
  }   // end public class EP_VCenter
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_ValString.java
  
  Index: EP_ValString.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "val-string"
   * tag
   *
   * This element has no attributes and contains a string
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_ValString
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EP_ValString()
      {
          super(null);
      }
  }   // end public class EP_ValString
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Value.java
  
  Index: EP_Value.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * No-op implementation of ElementProcessor to handle the "value" tag
   *
   * This element is not used in HSSFSerializer 1.0
   *
   * This element has no attributes, but has string content
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class EP_Value
      extends BaseElementProcessor
  {
  
      /**
       * constructor
       */
  
      public EP_Value()
      {
          super(null);
      }
  }   // end public class EP_Value
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/GTKTypes.java
  
  Index: GTKTypes.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * GTK type codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class GTKTypes
  {
      public static final int GTK_TYPE_INVALID    = 0;
      public static final int GTK_TYPE_NONE       = 1;
      public static final int GTK_TYPE_CHAR       = 2;
      public static final int GTK_TYPE_UCHAR      = 3;
      public static final int GTK_TYPE_BOOL       = 4;
      public static final int GTK_TYPE_INT        = 5;
      public static final int GTK_TYPE_UINT       = 6;
      public static final int GTK_TYPE_LONG       = 7;
      public static final int GTK_TYPE_ULONG      = 8;
      public static final int GTK_TYPE_FLOAT      = 9;
      public static final int GTK_TYPE_DOUBLE     = 10;
      public static final int GTK_TYPE_STRING     = 11;
      public static final int GTK_TYPE_ENUM       = 12;
      public static final int GTK_TYPE_FLAGS      = 13;
      public static final int GTK_TYPE_BOXED      = 14;
      public static final int GTK_TYPE_POINTER    = 15;
      public static final int GTK_TYPE_SIGNAL     = 16;
      public static final int GTK_TYPE_ARGS       = 17;
      public static final int GTK_TYPE_CALLBACK   = 18;
      public static final int GTK_TYPE_C_CALLBACK = 19;
      public static final int GTK_TYPE_FOREIGN    = 20;
      public static final int GTK_TYPE_OBJECT     = 21;
  
      private GTKTypes()
      {
      }
  
      /**
       * Is this a valid GTK value?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(int val)
      {
          return ((val >= GTK_TYPE_INVALID) && (val <= GTK_TYPE_OBJECT));
      }
  }   // end public class GTKTypes
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/HorizontalAlignment.java
  
  Index: HorizontalAlignment.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * Horizontal alignment is written as an integer, and each bit in the
   * integer specifies a particular boolean attribute. This class deals
   * with all that information in an easily digested form.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class HorizontalAlignment
  {
      private int                    _alignment;
      private static final int       _general                 = 1;
      private static final int       _left                    = 2;
      private static final int       _right                   = 4;
      private static final int       _center                  = 8;
      private static final int       _fill                    = 16;
      private static final int       _justify                 = 32;
      private static final int       _center_across_selection = 64;
      private static final Validator _validator               = new Validator()
      {
          public IOException validate(final Number number)
          {
              int value = number.intValue();
  
              return ((value >= 0) && (value <= 127)) ? null
                                                      : new IOException(
                                                          "\"" + number
                                                          + "\" is out of range");
          }
      };
  
      /**
       * Create an HorizontalAlignment object
       *
       * @param value the string containing the horizontal alignment
       *              data
       *
       * @exception IOException if the data is malformed
       */
  
      public HorizontalAlignment(final String value)
          throws IOException
      {
          _alignment = NumericConverter.extractInteger(value,
                  _validator).intValue();
      }
  
      /**
       * @return true if general bit is set
       */
  
      public boolean isGeneral()
      {
          return (_alignment & _general) == _general;
      }
  
      /**
       * @return true if left bit is set
       */
  
      public boolean isLeft()
      {
          return (_alignment & _left) == _left;
      }
  
      /**
       * @return true if right bit is set
       */
  
      public boolean isRight()
      {
          return (_alignment & _right) == _right;
      }
  
      /**
       * @return true if center bit is set
       */
  
      public boolean isCenter()
      {
          return (_alignment & _center) == _center;
      }
  
      /**
       * @return true if fill bit is set
       */
  
      public boolean isFill()
      {
          return (_alignment & _fill) == _fill;
      }
  
      /**
       * @return true if justify bit is set
       */
  
      public boolean isJustify()
      {
          return (_alignment & _justify) == _justify;
      }
  
      /**
       * @return true if center across selection bit is set
       */
  
      public boolean isCenterAcrossSelection()
      {
          return (_alignment & _center_across_selection)
                 == _center_across_selection;
      }
      
      short getCode() {
          return (short)_alignment;
      }
  }   // end public class HorizontalAlignment
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ObjectFill.java
  
  Index: ObjectFill.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * ObjectFill codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class ObjectFill
  {
      public static final int OBJECT_FILL_LINE  = 1;
      public static final int OBJECT_FILL_ARROW = 2;
      public static final int OBJECT_FILL_BOX   = 101;
      public static final int OBJECT_FILL_OVAL  = 102;
  
      private ObjectFill()
      {
      }
  
      /**
       * Is this a valid direction?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(final int val)
      {
          switch (val)
          {
  
              case OBJECT_FILL_LINE :
              case OBJECT_FILL_ARROW :
              case OBJECT_FILL_BOX :
              case OBJECT_FILL_OVAL :
                  return true;
  
              default :
                  return false;
          }
      }
  }   // end public class ObjectFill
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Offsets.java
  
  Index: Offsets.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  
  import java.io.IOException;
  
  /**
   * Offsets. This particular object is represented in gnumeric's XML as
   * four doubles, space separated. Presumably, each represents an
   * offset in a particular direction -- top, bottom, left, right -- but
   * what the reference is for each offset is not known, nor is it known
   * which one is top, bottom, left, or right, or even whether that's
   * the correct interpretation of the numbers. This is an area of the
   * gnumeric XML that is not terribly well documented even in their
   * code, and I don't think the features that use offsets are terribly
   * mature yet.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class Offsets
  {
      private static final int _component_count = 4;
      private double[]         _components      =
          new double[ _component_count ];
  
      /**
       * construct the Offsets object
       *
       * @param value the string containing the offset values
       *
       * @exception IOException if the string is badly formed
       */
  
      public Offsets(final String value)
          throws IOException
      {
          if (value == null)
          {
              throw new IOException("cannot process a null offsets string");
          }
          char[]   input   = value.trim().toCharArray();
          String[] offsets = new String[ _component_count ];
          int      index   = 0;
  
          for (int j = 0; j < _component_count; j++)
          {
              while ((index < input.length)
                      && (Character.isWhitespace(input[ index ])))
              {
                  ++index;
              }
              if (index == input.length)
              {
                  throw new IOException("insufficient offsets in string");
              }
              int tailIndex = index;
  
              while ((tailIndex < input.length)
                      && (!Character.isWhitespace(input[ tailIndex ])))
              {
                  ++tailIndex;
              }
              _components[ j ] =
                  NumericConverter.extractDouble(new String(input, index,
                      tailIndex - index)).doubleValue();
              index            = tailIndex;
          }
          if (new String(input, index, input.length - index).trim().length()
                  != 0)
          {
              throw new IOException("Too much data in string for "
                                    + _component_count + " offsets");
          }
      }
  
      /**
       * @return components
       */
  
      public double [] getComponents()
      {
          return _components;
      }
  }   // end public class Offsets
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/PrintOrder.java
  
  Index: PrintOrder.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * Print order -- encapsulation of the strings representing the print
   * ordering, and a simpler way to deal with them.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class PrintOrder
  {
      private static final String        _right_then_down            =
          "r_then_d";
      private static final String        _down_then_right            =
          "d_then_r";
      public static final int            PRINT_ORDER_RIGHT_THEN_DOWN = 0;
      public static final int            PRINT_ORDER_DOWN_THEN_RIGHT = 1;
      private static final NumericResult _null_result                =
          new NumericResult(new IOException("print order cannot be null"));
      private static final NumericResult _right_then_down_result     =
          new NumericResult(new Integer(PRINT_ORDER_RIGHT_THEN_DOWN));
      private static final NumericResult _down_then_right_result     =
          new NumericResult(new Integer(PRINT_ORDER_DOWN_THEN_RIGHT));
  
      private PrintOrder()
      {
      }
  
      /**
       * convert a string into a NumericResult
       *
       * @param value the string describing the print order
       *
       * @return a NumericResult containing either one of the public
       *         enumeration values, or an appropriate IOException
       */
  
      public static NumericResult extractPrintOrder(final String value)
      {
          NumericResult rval  = null;
          String        input = (value == null) ? null
                                                : value.trim();
  
          if (input == null)
          {
              rval = _null_result;
          }
          else if (input.equalsIgnoreCase(_right_then_down))
          {
              rval = _right_then_down_result;
          }
          else if (input.equalsIgnoreCase(_down_then_right))
          {
              rval = _down_then_right_result;
          }
          else
          {
              rval = new NumericResult(
                  new IOException(
                      "\"" + input + "\" is not a valid print order"));
          }
          return rval;
      }
  }   // end public class PrintOrder
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/PrintOrientation.java
  
  Index: PrintOrientation.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * Print orientation -- encapsulation of the strings representing the
   * print orientation, and a simpler way to deal with them.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class PrintOrientation
  {
      private static final String        _landscape                  =
          "landscape";
      private static final String        _portrait                   =
          "portrait";
      public static final int            PRINT_ORIENTATION_LANDSCAPE = 0;
      public static final int            PRINT_ORIENTATION_PORTRAIT  = 1;
      private static final NumericResult _null_result                =
          new NumericResult(
              new IOException("print orientation cannot be null"));
      private static final NumericResult _landscape_result           =
          new NumericResult(new Integer(PRINT_ORIENTATION_LANDSCAPE));
      private static final NumericResult _portrait_result            =
          new NumericResult(new Integer(PRINT_ORIENTATION_PORTRAIT));
  
      private PrintOrientation()
      {
      }
  
      /**
       * convert a string into a NumericResult
       *
       * @param value the string describing the print orientation
       *
       * @return a NumericResult containing either one of the public
       *         enumeration values, or an appropriate IOException
       */
  
      public static NumericResult extractPrintOrientation(final String value)
      {
          NumericResult rval  = null;
          String        input = (value == null) ? null
                                                : value.trim();
  
          if (input == null)
          {
              rval = _null_result;
          }
          else if (input.equalsIgnoreCase(_landscape))
          {
              rval = _landscape_result;
          }
          else if (input.equalsIgnoreCase(_portrait))
          {
              rval = _portrait_result;
          }
          else
          {
              rval = new NumericResult(
                  new IOException(
                      "\"" + input + "\" is not a valid print orientation"));
          }
          return rval;
      }
  }   // end public class PrintOrientation
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/PrintUnits.java
  
  Index: PrintUnits.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericResult;
  
  import java.io.IOException;
  
  /**
   * Print units -- encapsulation of the strings representing them, and
   * a simpler way to deal with them.GTK type codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class PrintUnits
  {
      private static final String        _cm                = "cm";
      private static final String        _in                = "in";
      private static final String        _mm                = "mm";
      private static final String        _points            = "points";
      public static final int            PRINT_UNITS_CM     = 0;
      public static final int            PRINT_UNITS_IN     = 1;
      public static final int            PRINT_UNITS_MM     = 2;
      public static final int            PRINT_UNITS_POINTS = 3;
      private static final NumericResult _null_result       =
          new NumericResult(new IOException("print units cannot be null"));
      private static final NumericResult _cm_result         =
          new NumericResult(new Integer(PRINT_UNITS_CM));
      private static final NumericResult _in_result         =
          new NumericResult(new Integer(PRINT_UNITS_IN));
      private static final NumericResult _mm_result         =
          new NumericResult(new Integer(PRINT_UNITS_MM));
      private static final NumericResult _points_result     =
          new NumericResult(new Integer(PRINT_UNITS_POINTS));
  
      private PrintUnits()
      {
      }
  
      /**
       * convert a string into a NumericResult
       *
       * @param value the string describing the print units
       *
       * @return a NumericResult containing either one of the public
       *         enumeration values, or an appropriate IOException
       */
  
      public static NumericResult extractPrintUnits(final String value)
      {
          NumericResult rval  = null;
          String        input = (value == null) ? null
                                                : value.trim();
  
          if (input == null)
          {
              rval = _null_result;
          }
          else if (input.equalsIgnoreCase(_cm))
          {
              rval = _cm_result;
          }
          else if (input.equalsIgnoreCase(_in))
          {
              rval = _in_result;
          }
          else if (input.equalsIgnoreCase(_mm))
          {
              rval = _mm_result;
          }
          else if (input.equalsIgnoreCase(_points))
          {
              rval = _points_result;
          }
          else
          {
              rval = new NumericResult(
                  new IOException(
                      "\"" + input + "\" is not a valid print unit"));
          }
          return rval;
      }
  }   // end public class PrintUnits
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Row.java
  
  Index: Row.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.poi.hssf.usermodel.HSSFRow;
  
  import java.io.IOException;
  
  /**
   * internal representation of a Row
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  // package scope
  class Row
  {
      private HSSFRow _row;
      private Sheet _sheet;
  
      /**
       * Constructor Row
       *
       * @param row
       */
  
      Row(final HSSFRow row, final Sheet sheet)
      {
          _row = row;
          _sheet = sheet;
      }
  
      /**
       * set a row's height
       *
       * @param points the height, in points
       *
       * @exception IOException if any arguments are illegal
       */
  
      void setHeight(final double points)
          throws IOException
      {
          if (!isValid(points))
          {
              throw new IOException("points " + points + " is out of range");
          }
          _row.setHeight(( short ) (points * 20));
      }
  
      /**
       * get the row height of a specified row
       *
       * @return row height in 1/20 of a point
       */
  
      short getHeight()
      {
          return _row.getHeight();
      }
  
      /**
       * create a cell in a specific column, with a specific type
       *
       * @param column the column number for the cell
       * @param cellType the cell type, being an enum from the CellType
       *                 class
       *
       * @return a new Cell object
       *
       * @exception IOException
       */
  
      Cell createCell(final int column, final int cellType)
          throws IOException
      {
          if ((column < 0) || (column > Short.MAX_VALUE))
          {
              throw new IOException("Illegal column value: " + column);
          }
          Cell retval =  new Cell(_row
              .createCell(( short ) column, CellType
                  .convertCellType(cellType)), cellType);
          
          retval.setStyle(_sheet.getCellStyleForRegion(_row.getRowNum(), (short)column));
          
          return retval;
      }
  
      private boolean isValid(double points)
      {
          return ((points >= 0)
                  && (points <= ((( double ) Short.MAX_VALUE) / 20)));
      }
  }   // end package scope class Row
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
  
  Index: Sheet.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.poi.hssf.util.Region;
  
  import org.apache.poi.hssf.usermodel.HSSFSheet;
  import org.apache.poi.hssf.usermodel.HSSFRow;
  import org.apache.poi.hssf.usermodel.HSSFCell;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  import org.apache.poi.hssf.usermodel.HSSFFont;
  import org.apache.poi.hssf.util.HSSFColor;
  
  import java.io.IOException;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  
  import org.apache.avalon.framework.logger.AbstractLoggable;
  
  /**
   * internal representation of a Sheet
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  // package scope
  class Sheet extends AbstractLoggable 
  {
      private HSSFSheet _sheet;
      private String    _name;
      private int       _physical_index;
      private Workbook  _workbook;
  
      // keys are Shorts (row numbers), values are Row instances
      private Map       _rows;
      
      private Map      regions;
  
      
      //optimization constant
      private final static int ROWS_CAPACITY = 200;
      
      //optimization constant
      private final static int REGION_CAPACITY = 20;
      
      private final static int DEBUG=0;
  
      /**
       * Constructor Sheet
       *
       * @param workbook
       */
  
      Sheet(final Workbook workbook)
      {
          _workbook       = workbook;
          _name           = _workbook.getNextName();
          _sheet          = _workbook.createSheet(_name);
          _physical_index = _workbook.getPhysicalIndex(_name);
          _rows           = new HashMap(ROWS_CAPACITY);
          regions         = new HashMap(REGION_CAPACITY);
      }
  
      /**
       * renameSheet
       *
       * @param new_name
       */
  
      void renameSheet(final String new_name)
      {
          if (!_name.equals(new_name))
          {
              _workbook.renameSheet(_physical_index, new_name);
              _name = new_name;
          }
      }
  
      /**
       * set a column's width
       *
       * @param number the column number
       * @param set the width in characters
       * @param points
       *
       * @exception IOException if any arguments are illegal
       */
  
      void setColumnWidth(final int number, final double points)
          throws IOException
      {
          if ((number < 0) || (number > Short.MAX_VALUE))
          {
              throw new IOException("column number " + number
                                    + " is too large");
          }
          if (!isValidColumnPoints(points))
          {
              throw new IOException("points " + points
                                    + " is out of range");
          }
          _sheet.setColumnWidth(( short ) number,
                                ( short ) ((points * 48) + .5));
      }
  
      /**
       * get the column width of a specified column
       *
       * @param number the column number
       *
       * @return column width in characters
       */
  
      short getColumnWidth(short number)
      {
          return _sheet.getColumnWidth(number);
      }
  
      /**
       * set default column width
       *
       * @param width width, in points
       *
       * @exception IOException
       */
  
      void setDefaultColumnWidth(double width)
          throws IOException
      {
          if ((width < 0) || (width >= (4.8 * (0.5 + Short.MAX_VALUE))))
          {
              throw new IOException("Invalid width (" + width + ")");
          }   // 12 is being used as a "guessed" points for the font
          _sheet.setDefaultColumnWidth(( short ) ((width/4.8) + 0.5));
      }
  
      /**
       * @return default column width (in 1/256ths of a character width)
       */
  
      short getDefaultColumnWidth()
      {
          return _sheet.getDefaultColumnWidth();
      }
  
      /**
       * set default row height
       *
       * @param height height, in points
       *
       * @exception IOException
       */
  
      void setDefaultRowHeight(double height)
          throws IOException
      {
          if (!isValidPoints(height))
          {
              throw new IOException("Invalid height (" + height + ")");
          }
          _sheet.setDefaultRowHeight(( short ) ((height * 20) + .5));
      }
  
      /**
       * @return default row height
       */
  
      short getDefaultRowHeight()
      {
          return _sheet.getDefaultRowHeight();
      }
  
      /**
       * @return name
       */
  
      String getName()
      {
          return _name;
      }
  
      /**
       * @return index
       */
  
      int getIndex()
      {
          return _physical_index;
      }
  
      /**
       * get a specified row
       *
       * @param rowNo the row number
       *
       * @return a Row object
       *
       * @exception IOException if rowNo is out of range
       */
  
      Row getRow(short rowNo)
          throws IOException
      {
          if (rowNo < 0)
          {
              throw new IOException("Illegal row number: " + rowNo);
          }
          Short  key  = new Short(rowNo);
          Object o    = _rows.get(key);
          Row    rval = null;
  
          if (o == null)
          {
              rval = createRow(rowNo);
              _rows.put(key, rval);
          }
          else
          {
              rval = ( Row ) o;
          }
          return rval;
      }
  
  /*    void addStyleRegion(Region region, 
                       short halign, 
                       short valign,
                       boolean wrap,
                       boolean locked,
                       boolean hidden,
                       short fontcolor,
                       short fontheight,
                       String fontname) {
                           
          HSSFCellStyle style = _workbook.createStyle(halign, 
                                                      valign, 
                                                      wrap, 
                                                      locked, 
                                                      hidden, 
                                                      fontcolor, 
                                                      fontheight, 
                                                      fontname);
          regions.put(region, style);
                                                  
          
      }*/
      
      HSSFCellStyle addStyleRegion(Region region) {
                           
          HSSFCellStyle style = _workbook.createStyle();
          /*
          getLogger().debug("region = "+ region.getRowFrom() + ","+region.getColumnFrom()+
              ","+region.getRowTo()+","+region.getColumnTo());
              */
          regions.put(region, style);
                                                  
          return style;
      }    
      
      /**
       *  returns the HSSFCellStyle for a cell if defined by region
       *  if there is not a definition it returns null.  If you don't
       *  expect that then your code dies a horrible death.
       *  @returns HSSFCellStyle 
       */
       HSSFCellStyle getCellStyleForRegion(short row, short col) {
          Iterator iregions = regions.keySet().iterator();        
          
          while (iregions.hasNext()) {
              Region region = ((Region) iregions.next());
  //            if (col == 1)
  //                getLogger().debug("breakpoint support");
              if ( region.contains(row, col) ) {
                  //getLogger().debug("Returning style for " + row +"," + col);
                  return (HSSFCellStyle) regions.get( region );
              }
          }
          //getLogger().debug("returning null for "+row+","+col);
          return null;
      }
      
      
      private Row createRow(final short rowNo)
      {
          return new Row(_sheet.createRow(rowNo), this);
      }
  
      private boolean isValidPoints(double points)
      {
          return ((points >= 0) && (points <= ((Short.MAX_VALUE + 0.5) / 20)));
      }
  
      private boolean isValidColumnPoints(double points)
      {
          return ((points >= 0) && (points <= ((Short.MAX_VALUE + 0.5) / 48)));
      }
  
      private boolean isValidCharacters(double characters)
      {
          return ((characters >= 0)
                  && (characters <= ((Short.MAX_VALUE + 0.5) / 256)));
  
      }
      
      /**
       * assigns blank cells to regions where no cell is currently allocated.
       * Meaning if there is a sheet with a cell defined at 1,1 and a style region 
       * from 0,0-1,1 then cells 0,0;0,1;1,0 will be defined as blank cells pointing
       * to the style defined by the style region.  If there is not a defined cell
       * and no styleregion encompases the area, then no cell is defined.
       */
      public void assignBlanksToRegions () {
          Iterator iregions = regions.keySet().iterator();
          
          
          
          while (iregions.hasNext()) {
              Region region = ((Region) iregions.next());
              //getLogger().debug("fixing region "+region.getRowFrom()+","+region.getColumnFrom()+"-"+
              //          region.getRowTo()+","+region.getColumnTo());
                                     
              for (int rownum = region.getRowFrom(); rownum < region.getRowTo() +1; rownum++) {
                  
                  HSSFRow row  = _sheet.getRow(rownum);
                  
                  for (short colnum = region.getColumnFrom(); colnum < region.getColumnTo()+1; colnum ++) {
                  
                      HSSFCellStyle style = (HSSFCellStyle)regions.get(region);
                      
  
                      if (!isBlank(style)) { //don't waste time with huge blocks of blankly
                                             //styled cells
                          
                          if (row == null) {
                              if (rownum > Short.MAX_VALUE) 
                              {  rownum = Short.MAX_VALUE; }
  
                              row = _sheet.createRow((short)rownum);
                          }
  
                          HSSFCell cell = row.getCell(colnum);
                          
                          if (cell == null) {
                              //getLogger().debug("creating blank cell at "+rownum + "," +colnum);
                              cell = row.createCell(colnum,HSSFCell.CELL_TYPE_BLANK);
                              cell.setCellStyle((HSSFCellStyle)regions.get(region));                        
                          }
                      }
                          
                  }
              }
          }
      }   
      
      
      private boolean isBlank(HSSFCellStyle style) {
          
          HSSFFont font = null;
          if (style.getFontIndex() >0)
              font = ((HSSFFont)_workbook.getWorkbook().getFontAt(style.getFontIndex()));
          
          if (style.getBorderBottom() == 0 &&
              style.getBorderTop() == 0 &&
              style.getBorderRight() == 0 &&
              style.getBorderLeft() == 0 &&            
              style.getFillBackgroundColor() == HSSFColor.WHITE.index &&
              style.getFillPattern() == 0 &&
              (style.getFontIndex() == 0 || 
                 ((font.getFontName().equals("Arial") || 
                  font.getFontName().equals("Helvetica")) &&
                  font.getFontHeightInPoints() > 8 && font.getFontHeightInPoints() < 12)
               )) return true;
          
          return false;
      }
      
  }   // end package scope class Sheet
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/StyleOrientation.java
  
  Index: StyleOrientation.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * Style orientation is written as an integer, and each bit in the
   * integer specifies a particular boolean attribute. This class deals
   * with all that information in an easily digested form.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class StyleOrientation
  {
      private int                    _alignment;
      private static final int       _horiz           = 1;
      private static final int       _vert_horiz_text = 2;
      private static final int       _vert_vert_text  = 4;
      private static final int       _vert_vert_text2 = 8;
      private static final Validator _validator       = new Validator()
      {
          public IOException validate(final Number number)
          {
              int value = number.intValue();
  
              return ((value >= 0) && (value <= 15)) ? null
                                                     : new IOException(
                                                         "\"" + number
                                                         + "\" is out of range");
          }
      };
  
      /**
       * Create a StyleOrientation object
       *
       * @param value the string containing the style orientation data
       *
       * @exception IOException if the data is malformed
       */
  
      public StyleOrientation(final String value)
          throws IOException
      {
          _alignment = NumericConverter.extractInteger(value,
                  _validator).intValue();
      }
  
      /**
       * @return true if horiz bit is set
       */
  
      public boolean isHoriz()
      {
          return (_alignment & _horiz) == _horiz;
      }
  
      /**
       * @return true if vert horiz text bit is set
       */
  
      public boolean isVertHorizText()
      {
          return (_alignment & _vert_horiz_text) == _vert_horiz_text;
      }
  
      /**
       * @return true if vert vert text bit is set
       */
  
      public boolean isVertVertText()
      {
          return (_alignment & _vert_vert_text) == _vert_vert_text;
      }
  
      /**
       * @return true if vert vert text2 bit is set
       */
  
      public boolean isVertVertText2()
      {
          return (_alignment & _vert_vert_text2) == _vert_vert_text2;
      }
  }   // end public class StyleOrientation
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/StyleShading.java
  
  Index: StyleShading.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * Style shading codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class StyleShading
  {
      public static final int STYLE_SHADING_NONE                         = 0;
      public static final int STYLE_SHADING_SOLID                        = 1;
      public static final int STYLE_SHADING_PERCENT75                    = 2;
      public static final int STYLE_SHADING_PERCENT50                    = 3;
      public static final int STYLE_SHADING_PERCENT25                    = 4;
      public static final int STYLE_SHADING_PERCENT12PT5                 = 5;
      public static final int STYLE_SHADING_PERCENT6PT25                 = 6;
      public static final int STYLE_SHADING_HORIZONTAL_STRIPE            = 7;
      public static final int STYLE_SHADING_VERTICAL_STRIPE              = 8;
      public static final int STYLE_SHADING_REVERSE_DIAGONAL_STRIPE      = 9;
      public static final int STYLE_SHADING_DIAGONAL_STRIPE              = 10;
      public static final int STYLE_SHADING_DIAGONAL_CROSSHATCH          = 11;
      public static final int STYLE_SHADING_THICK_DIAGONAL_CROSSHATCH    = 12;
      public static final int STYLE_SHADING_THIN_HORIZONTAL_STRIPE       = 13;
      public static final int STYLE_SHADING_THIN_VERTICAL_STRIPE         = 14;
      public static final int STYLE_SHADING_THIN_REVERSE_DIAGONAL_STRIPE = 15;
      public static final int STYLE_SHADING_THIN_DIAGONAL_STRIPE         = 16;
      public static final int STYLE_SHADING_THIN_CROSSHATCH              = 17;
      public static final int STYLE_SHADING_THIN_DIAGONAL_CROSSHATCH     = 18;
      public static final int STYLE_SHADING_APPLIX_SMALL_CIRCLE          = 19;
      public static final int STYLE_SHADING_APPLIX_SEMICIRCLE            = 20;
      public static final int STYLE_SHADING_APPLIX_SMALL_THATCH          = 21;
      public static final int STYLE_SHADING_APPLIX_ROUND_THATCH          = 22;
      public static final int STYLE_SHADING_APPLIX_BRICK                 = 23;
      public static final int STYLE_SHADING_PERCENT100                   = 24;
      public static final int STYLE_SHADING_PERCENT87PT5                 = 25;
  
      private StyleShading()
      {
      }
  
      /**
       * Is this a valid style shading?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(int val)
      {
          return ((val >= STYLE_SHADING_NONE)
                  && (val <= STYLE_SHADING_PERCENT87PT5));
      }
  }   // end public class StyleShading
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/UnderlineType.java
  
  Index: UnderlineType.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  /**
   * Underline codes
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class UnderlineType
  {
      public static final int UNDERLINE_NONE   = 0;
      public static final int UNDERLINE_SINGLE = 1;
      public static final int UNDERLINE_DOUBLE = 2;
  
      private UnderlineType()
      {
      }
  
      /**
       * Is this a valid underline shading?
       *
       * @param val value to be checked
       *
       * @return true if valid, false otherwise
       */
  
      public static boolean isValid(int val)
      {
          return ((val >= UNDERLINE_NONE) && (val <= UNDERLINE_DOUBLE));
      }
  }   // end public class UnderlineType
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/VerticalAlignment.java
  
  Index: VerticalAlignment.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
  import org.apache.cocoon.components.elementprocessor.types.Validator;
  
  import java.io.IOException;
  
  /**
   * Vertical alignment is written as an integer, and each bit in the
   * integer specifies a particular boolean attribute. This class deals
   * with all that information in an easily digested form.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class VerticalAlignment
  {
      private int                    _alignment;
      private static final int       _top       = 1;
      private static final int       _bottom    = 2;
      private static final int       _center    = 4;
      private static final int       _justify   = 8;
      private static final Validator _validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              int value = number.intValue();
  
              return ((value >= 0) && (value <= 15)) ? null
                                                     : new IOException(
                                                         "\"" + number
                                                         + "\" is out of range");
          }
      };
  
      /**
       * Create a VerticalAlignment object
       *
       * @param value the string containing the vertical alignment data
       *
       * @exception IOException if the data is malformed
       */
  
      public VerticalAlignment(final String value)
          throws IOException
      {
          _alignment = NumericConverter.extractInteger(value,
                  _validator).intValue();
      }
  
      /**
       * @return true if top bit is set
       */
  
      public boolean isTop()
      {
          return (_alignment & _top) == _top;
      }
  
      /**
       * @return true if bottom bit is set
       */
  
      public boolean isBottom()
      {
          return (_alignment & _bottom) == _bottom;
      }
  
      /**
       * @return true if center bit is set
       */
  
      public boolean isCenter()
      {
          return (_alignment & _center) == _center;
      }
  
      /**
       * @return true if justify bit is set
       */
  
      public boolean isJustify()
      {
          return (_alignment & _justify) == _justify;
      }
      
      public short getCode() {
          return (short)_alignment;
      }
  }   // end public class VerticalAlignment
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Workbook.java
  
  Index: Workbook.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
  
  
  
  import org.apache.poi.hssf.usermodel.HSSFSheet;
  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  import org.apache.poi.hssf.usermodel.HSSFCell;
  import org.apache.poi.hssf.usermodel.HSSFCellStyle;
  import org.apache.poi.hssf.usermodel.HSSFFont;
  
  import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  
  import java.io.ByteArrayInputStream;
  import java.io.IOException;
  
  /**
   * internal representation of a Workbook
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   * @author Andrew C. Oliver (acoliver2@users.sourceforge.net)
   */
  
  // package scope
  class Workbook
  {
      private HSSFWorkbook _workbook;
      private int          _sheet_index;
  
      /**
       * Constructor Workbook
       */
  
      Workbook()
      {
          _workbook    = new HSSFWorkbook();
          _sheet_index = 0;
      }
  
      /**
       * Method getNextName
       *
       * @return next name for a new sheet
       */
  
      String getNextName()
      {
          return "Sheet" + _sheet_index++;
      }
  
      /**
       * Method createSheet
       *
       * @param name name of the sheet
       *
       * @return newly created sheet
       */
  
      HSSFSheet createSheet(final String name)
      {
          return _workbook.createSheet(name);
      }
  
      /**
       * Method getPhysicalIndex
       *
       * @param name name of the sheet
       *
       * @return the sheet's physical index
       */
  
      int getPhysicalIndex(final String name)
      {
          return _workbook.getSheetIndex(name);
      }
  
      /**
       * Method renameSheet
       *
       * @param index the sheet's physical index
       * @param name the new name for the sheet
       */
  
      void renameSheet(final int index, final String name)
      {
          _workbook.setSheetName(index, name);
      }
  
      
      /**
       * create a cell style in the underlying HSSF model and return the reference
       * this should match reasonably close to what is in the StyleRegion element
       * in the gnumeric ss.
       */
      HSSFCellStyle createStyle() {
          
          HSSFCellStyle style = _workbook.createCellStyle();
         
          return style;
      }
      
      /**
       * create a font in the underlying HSSF model and return the reference
       */
      HSSFFont createFont() {
          
          HSSFFont font = _workbook.createFont();
         
          return font;
      }
      
  
      HSSFWorkbook getWorkbook() {
          return _workbook;
      }
      
      /**
       * write self to a filesystem
       *
       * @param filesystem the filesystem to be written to
       *
       * @exception IOException
       */
  
      void write(final POIFSFileSystem filesystem)
          throws IOException
      {
          filesystem
              .createDocument(new ByteArrayInputStream(_workbook
                  .getBytes()), "Workbook");
      }
  }   // end package scope class Workbook
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/Attribute.java
  
  Index: Attribute.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor.types;
  
  /**
   * Encapsulation of a single XML element attribute in a way that
   * shields the consumer from the data's XML origins.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class Attribute
  {
      private String _name;
      private String _value;
  
      /**
       * Constructor
       *
       * @param name the name of the Attribute, the left hand side of
       *             the '=' of an XML element's attribute.
       * @param value the value of the Attribute, the right hand side of
       *              the '=' of an XML element's attribute.
       *
       * @exception IllegalArgumentException is thrown if name is null
       *            or empty, or if value is null.
       */
  
      public Attribute(final String name, final String value)
      {
          if ((name == null) || (name.length() == 0))
          {
              throw new IllegalArgumentException(
                  "Attribute name is null or empty");
          }
          if (value == null)
          {
              throw new IllegalArgumentException("Attribute value is null");
          }
          _name  = name;
          _value = value;
      }
  
      /**
       * Get the name of the Attribute.
       *
       * @return the name of the Attribute
       */
  
      public String getName()
      {
          return _name;
      }
  
      /**
       *  Get the value of the Attribute as a String.
       *
       * @return the value of the Attribute as a String
       */
  
      public String getValue()
      {
          return _value;
      }
  
      /**
       * A convenience method to get the value of the Attribute as an
       * int.
       *
       * @return the value of the Attribute as an int
       *
       * @exception NumberFormatException if the value is not an int
       */
  
      public int getValueAsInt()
      {
          return Integer.parseInt(_value);
      }
  
      /**
       * A convenience method to get the value of the Attribute as a
       * short.
       *
       * @return the value of the Attribute as a short
       *
       * @exception NumberFormatException if the value is not a short
       */
  
      public short getValueAsShort()
      {
          return Short.parseShort(_value);
      }
  
      /**
       * A convenience method to get the value of the Attribute as a long.
       *
       * @return the value of the Attribute as a long
       *
       * @exception NumberFormatException if the value is not a long
       */
  
      public long getValueAsLong()
      {
          return Long.parseLong(_value);
      }
  
      /**
       * A convenience method to get the value of the attribute as a
       * boolean. Understands these value strings in a case-insensitive
       * fashion:
       * <ul>
       *     <li>t/f
       *     <li>true/false
       *     <li>y/n
       *     <li>yes/no
       * </ul>
       *
       * @return the value of the Attribute as a boolean
       *
       * @exception IllegalArgumentException if the value does not
       *            represent a boolean
       */
  
      public boolean getValueAsBoolean()
      {
          boolean rvalue = false;
  
          if (_value.equalsIgnoreCase("t") || _value.equalsIgnoreCase("y")
                  || _value.equalsIgnoreCase("yes")
                  || _value.equalsIgnoreCase("true"))
          {
              rvalue = true;
          }
          else if (_value.equalsIgnoreCase("f") || _value.equalsIgnoreCase("n")
                   || _value.equalsIgnoreCase("no")
                   || _value.equalsIgnoreCase("false"))
          {
              rvalue = false;
          }
          else
          {
              throw new IllegalArgumentException(
                  "Value [" + _value + "] does not represent a boolean value");
          }
          return rvalue;
      }
  }   // end public class Attribute
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/BooleanConverter.java
  
  Index: BooleanConverter.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor.types;
  
  import java.io.IOException;
  
  /**
   * This class knows how to convert strings into numbers, and also
   * knows how to check the results against certain criteria
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class BooleanConverter
  {
      private static final String        _true_values[]  =
      {
          "1", "true"
      };
      private static final String        _false_values[] =
      {
          "0", "false"
      };
      private static final BooleanResult _true_result    =
          new BooleanResult(true);
      private static final BooleanResult _false_result   =
          new BooleanResult(false);
  
      private BooleanConverter()
      {
      }
  
      /**
       * Given a string that is expected to hold a boolean, get the
       * boolean value.
       *
       * @param value the string holding the boolean
       *
       * @return a BooleanResult object containing either the boolean
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static BooleanResult extractBoolean(final String value)
      {
          String        input  = (value == null) ? ""
                                                 : value.trim();
          BooleanResult result = null;
  
          for (int k = 0; k < _true_values.length; k++)
          {
              if (_true_values[ k ].equalsIgnoreCase(input))
              {
                  result = _true_result;
                  break;
              }
          }
          if (result == null)
          {
              for (int k = 0; k < _false_values.length; k++)
              {
                  if (_false_values[ k ].equalsIgnoreCase(input))
                  {
                      result = _false_result;
                      break;
                  }
              }
          }
          if (result == null)
          {
              result = new BooleanResult(
                  new IOException("\"" + input + "\" is not a boolean value"));
          }
          return result;
      }
  }   // end public class BooleanConverter
  
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/BooleanResult.java
  
  Index: BooleanResult.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.elementprocessor.types;
  
  import java.io.IOException;
  
  /**
   * This class holds the result of a boolean conversion. The result is
   * either a valid value, or an IOException that was created by the
   * boolean converter
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class BooleanResult
  {
      private boolean     _value;
      private IOException _exception;
  
      /**
       * Constructor; package scope, as only a boolean converter should
       * generate one of these
       *
       * @param value the boolean value
       */
  
      BooleanResult(final boolean value)
      {
          this();
          _value = value;
      }
  
      /**
       * Constructor; package scope, as only a boolean converter should
       * generate one of these
       *
       * @param exception the exception to be thrown
       */
  
      BooleanResult(final IOException exception)
      {
          this();
          _exception = exception;
      }
  
      private BooleanResult()
      {
          _value     = false;
          _exception = null;
      }
  
      /**
       * Get the value as a boolean
       *
       * @return the value as a boolean
       *
       * @exception IOException if there was a problem converting the
       *            value
       */
  
      public boolean booleanValue()
          throws IOException
      {
          if (_exception != null)
          {
              throw _exception;
          }
          return _value;
      }
  }   // end public class BooleanResult
  
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/NumericConverter.java
  
  Index: NumericConverter.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.types;
  
  import java.io.IOException;
  
  /**
   * This class knows how to convert strings into numbers, and also
   * knows how to check the results against certain criteria
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class NumericConverter
  {
      private static final Validator _non_negative_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              IOException e = null;
  
              if (number.intValue() < 0)
              {
                  e = new IOException("\"" + number.intValue()
                                      + "\" is not a non-negative integer");
              }
              return e;
          }
      };
      private static final Validator _positive_validator = new Validator()
      {
          public IOException validate(final Number number)
          {
              IOException e = null;
  
              if (number.intValue() < 1)
              {
                  e = new IOException("\"" + number.intValue()
                                      + "\" is not a positive integer");
              }
              return e;
          }
      };
  
      private NumericConverter()
      {
      }
  
      /**
       * Shortcut for extractDouble without a Validator
       *
       * @param value the string holding the double
       * @param validator a Validator object; if null, no additional
       *                  validation will be performed
       *
       * @return a NumericResult object containing either the double
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static NumericResult extractDouble(final String value)
      {
          return extractDouble(value, null);
      }
  
      /**
       * Given a string that is expected to hold a double, get the double value.
       *
       * @param value the string holding the double
       * @param validator a Validator object; if null, no additional
       *                  validation will be performed
       *
       * @return a NumericResult object containing either the double
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static NumericResult extractDouble(final String value,
                                                final Validator validator)
      {
          String        input  = (value == null) ? ""
                                                 : value.trim();
          NumericResult result = null;
  
          try
          {
              Number      number    = new Double(input);
              IOException exception = null;
  
              if (validator != null)
              {
                  exception = validator.validate(number);
              }
              if (exception == null)
              {
                  result = new NumericResult(number);
              }
              else
              {
                  result = new NumericResult(exception);
              }
          }
          catch (NumberFormatException ignored)
          {
              result = new NumericResult(
                  new IOException(
                      "\"" + input + "\" does not represent a double value"));
          }
          return result;
      }
  
      /**
       * Shortcut for extractInteger without a Validator
       *
       * @param value the string holding the integer
       * @param validator a Validator object; if null, no additional
       *                  validation will be performed
       *
       * @return a NumericResult object containing either the integer
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static NumericResult extractInteger(final String value)
      {
          return extractInteger(value, null);
      }
  
      /**
       * Given a string that is expected to hold a integer, get the integer value.
       *
       * @param value the string holding the integer
       * @param validator a Validator object; if null, no additional
       *                  validation will be performed
       *
       * @return a NumericResult object containing either the integer
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static NumericResult extractInteger(final String value,
                                                 final Validator validator)
      {
          String        input  = (value == null) ? ""
                                                 : value.trim();
          NumericResult result = null;
  
          try
          {
              Number      number    = new Integer(input);
              IOException exception = null;
  
              if (validator != null)
              {
                  exception = validator.validate(number);
              }
              if (exception == null)
              {
                  result = new NumericResult(number);
              }
              else
              {
                  result = new NumericResult(exception);
              }
          }
          catch (NumberFormatException ignored)
          {
              result = new NumericResult(
                  new IOException(
                      "\"" + input + "\" does not represent an integer value"));
          }
          return result;
      }
  
      /**
       * extract a positive integer (i.e., an integer with a range of 1
       * ... MAX_VALUE)
       *
       * @param value the string holding the value
       *
       * @return a NumericResult object containing either the integer
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static NumericResult extractPositiveInteger(final String value)
      {
          return extractInteger(value, _positive_validator);
      }
  
      /**
       * extract a non-negative integer (i.e., an integer with a range
       * of 1 ... MAX_VALUE)
       *
       * @param value the string holding the value
       *
       * @return a NumericResult object containing either the integer
       *         value or an exception generated if there was a problem
       *         with the value;
       */
  
      public static NumericResult extractNonNegativeInteger(final String value)
      {
          return extractInteger(value, _non_negative_validator);
      }
  }   // end public class NumericConverter
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/NumericResult.java
  
  Index: NumericResult.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.types;
  
  import java.io.IOException;
  
  /**
   * This class holds the result of a numeric conversion. The result is
   * either a valid value, or an IOException that was created by the
   * numeric converter
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public class NumericResult
  {
      private Number      _value;
      private IOException _exception;
  
      /**
       * Constructor
       *
       * @param value the numeric value
       */
  
      public NumericResult(final Number value)
      {
          this();
          _value = value;
      }
  
      /**
       * Constructor
       *
       * @param exception the exception to be thrown
       */
  
      public NumericResult(final IOException exception)
      {
          this();
          _exception = exception;
      }
  
      private NumericResult()
      {
          _value     = null;
          _exception = null;
      }
  
      /**
       * Get the value, if possible, as an int
       *
       * @return the value, as an int
       *
       * @exception IOException if there was a problem converting the
       *            number
       */
  
      public int intValue()
          throws IOException
      {
          return value().intValue();
      }
  
      /**
       * Get the value, if possible, as a double
       *
       * @return the value, as a double
       *
       * @exception IOException if there was a problem converting the
       *            number
       */
  
      public double doubleValue()
          throws IOException
      {
          return value().doubleValue();
      }
  
      private Number value()
          throws IOException
      {
          if (_exception != null)
          {
              throw _exception;
          }
          return _value;
      }
  }   // end public class NumericResult
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/elementprocessor/types/Validator.java
  
  Index: Validator.java
  ===================================================================
  
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 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 "Apache Cocoon" 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
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.components.elementprocessor.types;
  
  import java.io.IOException;
  
  /**
   * This interface allows a client of NumericConverter to apply more
   * restrictive rules to the number that the NumericConverter obtained.
   *
   * @author Marc Johnson (marc_johnson27591@hotmail.com)
   */
  
  public interface Validator
  {
  
      /**
       * Is this number valid? If so, return a null
       * IOException. Otherwise, return an IOException whose message
       * explains why the number is not valid.
       *
       * @param number the Number holding the value. Guaranteed non-null
       *
       * @return a null IOException if the value is ok, else a real
       *         IOException
       */
  
      public IOException validate(final Number number);
  }   // end public interface Validator
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message