diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2008-05-02 16:58:26 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2008-05-02 16:58:26 +0000 |
commit | 8f3f8d05fc2ba1404a63d0bcf94959e34221e981 (patch) | |
tree | 9fe3166147e44f7550b18449ec17fc8c59283a90 /src/java/org/apache | |
parent | 2c8c8c837c99a941abc36c396a0d1c64f9b3d71a (diff) | |
download | xmlgraphics-fop-8f3f8d05fc2ba1404a63d0bcf94959e34221e981.tar.gz xmlgraphics-fop-8f3f8d05fc2ba1404a63d0bcf94959e34221e981.zip |
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
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@652821 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/fo/FObj.java | 49 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java | 34 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/RetrieveMarker.java | 53 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java | 18 |
4 files changed, 80 insertions, 74 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index a2b09640b..79b04c4d7 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -427,12 +427,12 @@ public abstract class FObj extends FONode implements Constants { */ 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 @@ public abstract class FObj extends FONode implements Constants { */ 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 @@ public abstract class FObj extends FONode implements Constants { */ 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))); } /** diff --git a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java index 334f98e2f..9e4585d32 100644 --- a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java +++ b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java @@ -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 @@ public abstract class AbstractRetrieveMarker extends FObjMixed { private PropertyList propertyList; + private String retrieveClassName; + /** * Create a new AbstractRetrieveMarker instance that * is a child of the given {@link FONode} @@ -52,11 +51,26 @@ public abstract class AbstractRetrieveMarker extends FObjMixed { /** * {@inheritDoc} + * <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); + } + } + + /** + * {@inheritDoc} * Store a reference to the parent {@link 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 @@ public abstract class AbstractRetrieveMarker extends FObjMixed { } } + /** + * Return the value for the <code>retrieve-class-name</code> + * property + * + * @return the value for retrieve-class-name + */ + public String getRetrieveClassName() { + return this.retrieveClassName; + } + } diff --git a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java index b75e14664..c696d3d14 100644 --- a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java +++ b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java @@ -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 @@ import org.xml.sax.Attributes; 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 @@ public class RetrieveMarker extends AbstractRetrieveMarker { * Create a new RetrieveMarker instance that is a * child of the given {@link FONode}. * - * @param parent {@link FONode} that is the parent of this object + * @param parent the parent {@link FONode} */ public RetrieveMarker(FONode parent) { super(parent); @@ -72,47 +68,34 @@ public class RetrieveMarker extends AbstractRetrieveMarker { /** {@inheritDoc} */ 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(); } /** - * {@inheritDoc} - * 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 + * {@link org.apache.fop.fo.Constants#EN_FSWP}, + * {@link org.apache.fop.fo.Constants#EN_FIC}, + * {@link org.apache.fop.fo.Constants#EN_LSWP}, + * {@link 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 + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_PAGE_SEQUENCE}, + * {@link org.apache.fop.fo.Constants#EN_DOCUMENT}. */ public int getRetrieveBoundary() { - return retrieveBoundary; + return this.retrieveBoundary; } /** {@inheritDoc} */ diff --git a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java index 4a7b8af0d..9d04e308d 100644 --- a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java +++ b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java @@ -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 @@ import org.xml.sax.Attributes; */ 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 @@ public class RetrieveTableMarker extends AbstractRetrieveMarker { super(parent); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * <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 @@ public class RetrieveTableMarker extends AbstractRetrieveMarker { /** {@inheritDoc} */ 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(); } - /** {@inheritDoc} */ - public String getRetrieveClassName() { - return this.retrieveClassName; - } - /** * Return the value for the <code>retrieve-position-within-table</code> * property |