adelmelle
Fri, 02 May 2008 09:58:48 -0700
Author: adelmelle Date: Fri May 2 09:58:26 2008 New Revision: 652821 URL: http://svn.apache.org/viewvc?rev=652821&view=rev Log: Cleanup/Correction after r657673 -> added missing file FObj.java -> pushed retrieve-class-name upwards to AbstractRetrieveMarker as a common property -> corrected use of property-name "retrieve-class-name" in source and testcase -> improved consistency in code-style Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java xmlgraphics/fop/trunk/test/fotree/testcases/table_retrieve-table-marker.fo Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java?rev=652821&r1=652820&r2=652821&view=diff ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java Fri May 2 09:58:26 2008 @@ -427,12 +427,12 @@ */ protected boolean isBlockItem(String nsURI, String lName) { return (FO_URI.equals(nsURI) - && (lName.equals("block") - || lName.equals("table") - || lName.equals("table-and-caption") - || lName.equals("block-container") - || lName.equals("list-block") - || lName.equals("float") + && ("block".equals(lName) + || "table".equals(lName) + || "table-and-caption".equals(lName) + || "block-container".equals(lName) + || "list-block".equals(lName) + || "float".equals(lName) || isNeutralItem(nsURI, lName))); } @@ -446,21 +446,21 @@ */ protected boolean isInlineItem(String nsURI, String lName) { return (FO_URI.equals(nsURI) - && (lName.equals("bidi-override") - || lName.equals("character") - || lName.equals("external-graphic") - || lName.equals("instream-foreign-object") - || lName.equals("inline") - || lName.equals("inline-container") - || lName.equals("leader") - || lName.equals("page-number") - || lName.equals("page-number-citation") - || lName.equals("page-number-citation-last") - || lName.equals("basic-link") - || (lName.equals("multi-toggle") + && ("bidi-override".equals(lName) + || "character".equals(lName) + || "external-graphic".equals(lName) + || "instream-foreign-object".equals(lName) + || "inline".equals(lName) + || "inline-container".equals(lName) + || "leader".equals(lName) + || "page-number".equals(lName) + || "page-number-citation".equals(lName) + || "page-number-citation-last".equals(lName) + || "basic-link".equals(lName) + || ("multi-toggle".equals(lName) && (getNameId() == FO_MULTI_CASE || findAncestor(FO_MULTI_CASE) > 0)) - || (lName.equals("footnote") + || ("footnote".equals(lName) && !isOutOfLineFODescendant) || isNeutralItem(nsURI, lName))); } @@ -487,11 +487,12 @@ */ boolean isNeutralItem(String nsURI, String lName) { return (FO_URI.equals(nsURI) - && (lName.equals("multi-switch") - || lName.equals("multi-properties") - || lName.equals("wrapper") - || (!isOutOfLineFODescendant && lName.equals("float")) - || lName.equals("retrieve-marker"))); + && ("multi-switch".equals(lName) + || "multi-properties".equals(lName) + || "wrapper".equals(lName) + || (!isOutOfLineFODescendant && "float".equals(lName)) + || "retrieve-marker".equals(lName) + || "retrieve-table-marker".equals(lName))); } /** Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java?rev=652821&r1=652820&r2=652821&view=diff ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java Fri May 2 09:58:26 2008 @@ -18,14 +18,11 @@ /* $Id$ */ package org.apache.fop.fo.flow; -import org.apache.fop.fo.FONode; -import org.apache.fop.fo.FOText; -import org.apache.fop.fo.FObj; -import org.apache.fop.fo.FObjMixed; -import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.*; import org.apache.fop.fo.flow.table.TableFObj; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.apps.FOPException; +import org.xml.sax.Locator; import java.util.Iterator; @@ -40,6 +37,8 @@ private PropertyList propertyList; + private String retrieveClassName; + /** * Create a new AbstractRetrieveMarker instance that * is a child of the given [EMAIL PROTECTED] FONode} @@ -52,11 +51,26 @@ /** * [EMAIL PROTECTED] + * <p>XSL Content Model: empty + */ + protected void validateChildNode(Locator loc, String nsURI, String localName) + throws ValidationException { + if (FO_URI.equals(nsURI)) { + invalidChildError(loc, nsURI, localName); + } + } + + /** + * [EMAIL PROTECTED] * Store a reference to the parent [EMAIL PROTECTED] PropertyList} * to be used when the retrieve-marker is resolved. */ public void bind(PropertyList pList) throws FOPException { super.bind(pList); + this.retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString(); + if (retrieveClassName == null || retrieveClassName.equals("")) { + missingPropertyError("retrieve-class-name"); + } this.propertyList = pList.getParentPropertyList(); } @@ -169,4 +183,14 @@ } } + /** + * Return the value for the <code>retrieve-class-name</code> + * property + * + * @return the value for retrieve-class-name + */ + public String getRetrieveClassName() { + return this.retrieveClassName; + } + } Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java?rev=652821&r1=652820&r2=652821&view=diff ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Fri May 2 09:58:26 2008 @@ -19,12 +19,9 @@ package org.apache.fop.fo.flow; -import java.util.Iterator; - import org.apache.fop.apps.FOPException; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; -import org.apache.fop.fo.ValidationException; import org.xml.sax.Locator; import org.xml.sax.Attributes; @@ -37,7 +34,6 @@ public class RetrieveMarker extends AbstractRetrieveMarker { // The value of properties relevant for fo:retrieve-marker. - private String retrieveClassName; private int retrievePosition; private int retrieveBoundary; // End of property values @@ -46,7 +42,7 @@ * Create a new RetrieveMarker instance that is a * child of the given [EMAIL PROTECTED] FONode}. * - * @param parent [EMAIL PROTECTED] FONode} that is the parent of this object + * @param parent the parent [EMAIL PROTECTED] FONode} */ public RetrieveMarker(FONode parent) { super(parent); @@ -72,47 +68,34 @@ /** [EMAIL PROTECTED] */ public void bind(PropertyList pList) throws FOPException { - - retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString(); - retrievePosition = pList.get(PR_RETRIEVE_POSITION).getEnum(); - retrieveBoundary = pList.get(PR_RETRIEVE_BOUNDARY).getEnum(); - - if (retrieveClassName == null || retrieveClassName.equals("")) { - missingPropertyError("retrieve-class-name"); - } super.bind(pList); + this.retrievePosition = pList.get(PR_RETRIEVE_POSITION).getEnum(); + this.retrieveBoundary = pList.get(PR_RETRIEVE_BOUNDARY).getEnum(); } /** - * [EMAIL PROTECTED] - * XSL Content Model: empty - */ - protected void validateChildNode(Locator loc, String nsURI, String localName) - throws ValidationException { - if (FO_URI.equals(nsURI)) { - invalidChildError(loc, nsURI, localName); - } - } - - /** - * @return the "retrieve-class-name" property. - */ - public String getRetrieveClassName() { - return retrieveClassName; - } - - /** - * @return the "retrieve-position" property (enum value). + * Return the value for the <code>retrieve-position</code> + * property + * @return the value for retrieve-position-within-table; one of + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_FSWP}, + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_FIC}, + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_LSWP}, + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_LEWP}. */ public int getRetrievePosition() { - return retrievePosition; + return this.retrievePosition; } /** - * @return the "retrieve-boundary" property (enum value). + * Return the value for the <code>retrieve-boundary</code> + * property + * @return the value for retrieve-boundary-within-table; one of + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_PAGE}, + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_PAGE_SEQUENCE}, + * [EMAIL PROTECTED] org.apache.fop.fo.Constants#EN_DOCUMENT}. */ public int getRetrieveBoundary() { - return retrieveBoundary; + return this.retrieveBoundary; } /** [EMAIL PROTECTED] */ Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java?rev=652821&r1=652820&r2=652821&view=diff ============================================================================== --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java (original) +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java Fri May 2 09:58:26 2008 @@ -15,7 +15,7 @@ * limitations under the License. */ -/* $Id:$ */ +/* $Id$ */ package org.apache.fop.fo.flow; import org.apache.fop.fo.FONode; @@ -30,8 +30,7 @@ */ public class RetrieveTableMarker extends AbstractRetrieveMarker { - // The value of properties relevant for fo:retrieve-marker. - private String retrieveClassName; + // The value of properties relevant for fo:retrieve-table-marker. private int retrievePositionWithinTable; private int retrieveBoundaryWithinTable; // end property values @@ -46,7 +45,11 @@ super(parent); } - /** [EMAIL PROTECTED] */ + /** + * [EMAIL PROTECTED] + * <i>NOTE: An <code>fo:retrieve-table-marker</code> is only permitted as a descendant + * of an <code>fo:table-header</code> or an <code>fo:table-footer</code>.</i> + */ public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException { if (findAncestor(FO_TABLE_HEADER) < 0 && findAncestor(FO_TABLE_FOOTER) < 0) { @@ -59,18 +62,13 @@ /** [EMAIL PROTECTED] */ public void bind(PropertyList pList) throws FOPException { - this.retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString(); + super.bind(pList); this.retrievePositionWithinTable = pList.get(PR_RETRIEVE_POSITION_WITHIN_TABLE).getEnum(); this.retrieveBoundaryWithinTable = pList.get(PR_RETRIEVE_BOUNDARY_WITHIN_TABLE).getEnum(); } - /** [EMAIL PROTECTED] */ - public String getRetrieveClassName() { - return this.retrieveClassName; - } - /** * Return the value for the <code>retrieve-position-within-table</code> * property Modified: xmlgraphics/fop/trunk/test/fotree/testcases/table_retrieve-table-marker.fo URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/testcases/table_retrieve-table-marker.fo?rev=652821&r1=652820&r2=652821&view=diff ============================================================================== --- xmlgraphics/fop/trunk/test/fotree/testcases/table_retrieve-table-marker.fo (original) +++ xmlgraphics/fop/trunk/test/fotree/testcases/table_retrieve-table-marker.fo Fri May 2 09:58:26 2008 @@ -35,8 +35,8 @@ <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block> - <fo:retrieve-table-marker marker-class-name="mc1"> - <test:assert property="marker-class-name" expected="mc1" /> + <fo:retrieve-table-marker retrieve-class-name="mc1"> + <test:assert property="retrieve-class-name" expected="mc1" /> <test:assert property="retrieve-position-within-table" expected="FIRST_STARTING" /> <test:assert property="retrieve-boundary-within-table" expected="TABLE" /> </fo:retrieve-table-marker> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]