You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2002/06/23 17:02:18 UTC

cvs commit: xml-fop/src/org/apache/fop/fo/expr PropertyParser.java PropertyTokenizer.java

pbwest      2002/06/23 08:02:18

  Modified:    src/org/apache/fop/fo/expr Tag: FOP_0-20-0_Alt-Design
                        PropertyParser.java PropertyTokenizer.java
  Log:
  Added SLASH processing
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.2   +53 -3     xml-fop/src/org/apache/fop/fo/expr/PropertyParser.java
  
  Index: PropertyParser.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/PropertyParser.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- PropertyParser.java	7 May 2002 05:37:16 -0000	1.5.2.1
  +++ PropertyParser.java	23 Jun 2002 15:02:18 -0000	1.5.2.2
  @@ -27,6 +27,7 @@
   import org.apache.fop.datatypes.Inherit;
   import org.apache.fop.datatypes.Auto;
   import org.apache.fop.datatypes.None;
  +import org.apache.fop.datatypes.Slash;
   import org.apache.fop.datatypes.ColorType;
   import org.apache.fop.datatypes.StringType;
   import org.apache.fop.datatypes.MimeType;
  @@ -69,8 +70,53 @@
   
       /**
        * Parse the property expression described in the instance variables.
  -     * <p>
  -     * Note: If the property expression String is empty, a StringProperty
  +     * 
  +     * <p>The <tt>PropertyValue</tt> returned by this function has the
  +     * following characteristics:
  +     * If the expression resolves to a single element that object is returned
  +     * directly in an object which implements <PropertyValue</tt>.
  +     *
  +     * <p>If the expression cannot be resolved into a single object, the set
  +     * to which it resolves is returned in a <tt>PropertyValueList</tt> object
  +     * (which itself implements <tt>PropertyValue</tt>).
  +     *
  +     * <p>The <tt>PropertyValueList</tt> contains objects whose corresponding
  +     * elements in the original expression were separated by <em>commas</em>.
  +     *
  +     * <p>Objects whose corresponding elements in the original expression
  +     * were separated by spaces are composed into a sublist contained in
  +     * another <tt>PropertyValueList</tt>.  If all of the elements in the
  +     * expression were separated by spaces, the returned
  +     * <tt>PropertyValueList</tt> will contain one element, a
  +     * <tt>PropertyValueList</tt> containing objects representing each of
  +     * the space-separated elements in the original expression.
  +     *
  +     * <p>E.g., if a <b>font-family</b> property is assigned the string
  +     * <em>Palatino, New Century Schoolbook, serif</em>, the returned value
  +     * will look like this:
  +     * <pre>
  +     * PropertyValueList(NCName('Palatino')
  +     *                   PropertyValueList(NCName('New')
  +     *                                     NCName('Century')
  +     *                                     NCName('Schoolbook') )
  +     *                   NCName('serif') )
  +     * </pre>
  +     * <p>If the property had been assigned the string
  +     * <em>Palatino, "New Century Schoolbook", serif</em>, the returned value
  +     * would look like this:
  +     * <pre>
  +     * PropertyValueList(NCName('Palatino')
  +     *                   NCName('New Century Schoolbook')
  +     *                   NCName('serif') )
  +     * </pre>
  +     * <p>If a <b>background-position</b> property is assigned the string
  +     * <em>top center</em>, the returned value will look like this:
  +     * <pre>
  +     * PropertyValueList(PropertyValueList(NCName('top')
  +     *                                     NCName('center') ) )
  +     * </pre>
  +     *
  +     * <p>Note: If the property expression String is empty, a StringProperty
        * object holding an empty String is returned.
        * @param property an <tt>int</tt> containing the property index.
        * which the property expression is to be evaluated.
  @@ -360,6 +406,10 @@
   
           case MIMETYPE:
               prop = new MimeType(property, currentTokenValue);
  +            break;
  +
  +        case SLASH:
  +            prop = new Slash(property);
               break;
   
           case FUNCTION_LPAR: {
  
  
  
  1.4.4.2   +9 -4      xml-fop/src/org/apache/fop/fo/expr/PropertyTokenizer.java
  
  Index: PropertyTokenizer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/expr/PropertyTokenizer.java,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- PropertyTokenizer.java	7 May 2002 05:37:16 -0000	1.4.4.1
  +++ PropertyTokenizer.java	23 Jun 2002 15:02:18 -0000	1.4.4.2
  @@ -56,11 +56,12 @@
                  ,BOOL = 24
                   ,URI = 25
              ,MIMETYPE = 26
  +              ,SLASH = 27
               // NO_UNIT is a transient token for internal use only.  It is
               // never set as the end result of parsing a token.
  -            ,NO_UNIT = 27
  -            //,NSPREFIX = 28
  -            //,WHITESPACE = 29
  +            ,NO_UNIT = 28
  +            //,NSPREFIX = 29
  +            //,WHITESPACE = 30
                        ;
   
       /*
  @@ -243,6 +244,10 @@
                   } else {
                       throw new PropertyException("illegal character '#'");
                   }
  +
  +            case '/':
  +                currentToken = SLASH;
  +                return;
   
               default:
                   --exprIndex;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org