pbwest 2004/01/01 04:55:46
Modified:src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design
FObjectNames.java
Log:
foLocalNames made private.
foLocalNamesLength().
getFOPkg() added.
Revision ChangesPath
No revision
No revision
1.1.2.2 +26 -6 xml-fop/src/java/org/apache/fop/fo/Attic/FObjectNames.java
Index: FObjectNames.java
===
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Attic/FObjectNames.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- FObjectNames.java 5 Jul 2003 19:26:05 - 1.1.2.1
+++ FObjectNames.java 1 Jan 2004 12:55:46 - 1.1.2.2
@@ -149,7 +149,7 @@
* int constants must be kept in sync with this array, as the
* constants are used to index into the array.
*/
-public static final String[][] foLocalNames = {
+private static final String[][] foLocalNames = {
{ "no-fo", ""} //0
,{ "basic-link", "fo.flow" } //1
,{ "bidi-override", "fo.flow" } //2
@@ -209,6 +209,11 @@
,{ "wrapper", "fo.flow" } //56
,{ "pcdata", "fo.flow" } //57
};
+
+/**
+ * Publicly visible length of the private foLocaNames array.
+ */
+public static final int foLocalNamesLength = foLocalNames.length;
/**
* A HashMap whose elements are an integer index value keyed by an
@@ -249,12 +254,27 @@
* @exception FOPException if the FO index is invalid.
*/
public static String getFOName(int foType)
-throws FOPException
+throws FOPException
{
if (foType < 0 || foType > LAST_FO)
-throw new FOPException
-("getFOName: type is invalid: " + foType);
+throw new FOPException
+("getFOName: type is invalid: " + foType);
return foLocalNames[foType][NAMEX];
+}
+
+/**
+ * Get the FObject package name corresponding to the FO index.
+ * @param foType int index of the FO type.
+ * @return String package name of the FO.
+ * @exception FOPException if the FO index is invalid.
+ */
+public static String getFOPkg(int foType)
+throws FOPException
+{
+if (foType < 0 || foType > LAST_FO)
+throw new FOPException
+("getFOPkg: type is invalid: " + foType);
+return foLocalNames[foType][PACKAGEX];
}
}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]