From 05354b5d09f3284a15af8e7c5a22f265d1ea6c2c Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Mon, 11 Nov 2002 17:14:30 +0000 Subject: [PATCH] FOPropertySets redistributed across FOPropertySets and FObjects. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195491 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/FOPropertySets.java | 131 ---------------------- 1 file changed, 131 deletions(-) diff --git a/src/org/apache/fop/fo/FOPropertySets.java b/src/org/apache/fop/fo/FOPropertySets.java index 9571c30ca..54b550bee 100644 --- a/src/org/apache/fop/fo/FOPropertySets.java +++ b/src/org/apache/fop/fo/FOPropertySets.java @@ -37,9 +37,6 @@ public class FOPropertySets { private static final String tag = "$Name$"; private static final String revision = "$Revision$"; - public static final String XSLNamespace = - "http://www.w3.org/1999/XSL/Format"; - public static final String packageNamePrefix = "org.apache.fop"; /** @@ -110,76 +107,6 @@ public class FOPropertySets { throw new FOPException("Invalid attribute set: " + attrSet); } - public static int getFoIndex(String name) { - return ((Integer)(foToIndex.get(name))).intValue(); - } - - public static String getClassName(int foIndex) { - return foClassNames[foIndex]; - } - - public static Class getClass(int foIndex) { - return foClasses[foIndex]; - } - - /** - * A String[] array of the fo class names. This array is - * effectively 1-based, with the first element being unused. - * The array is initialized in a static initializer by converting the - * fo names from the array FObjectNames.foLocalNames into class names by - * converting the first character of every component word to upper case, - * removing all punctuation characters and prepending the prefix 'Fo'. - * It can be indexed by the fo name constants defined in the - * FObjectNames class. - */ - private static final String[] foClassNames; - - /** - * A String[] array of the fo class package names. This array is - * effectively 1-based, with the first element being unused. - * The array is initialized in a static initializer by constructing - * the package name from the common package prefix set in the field - * packageNamePrefix, the package name suffix associated with - * the fo local names in the FObjectNames.foLocalNames array, - * the the class name which has been constructed in the - * foClassNames array here. - * It can be indexed by the fo name constants defined in the - * FObjectNames class. - */ - private static final String[] foClassPackages; - - /** - * An Class[] array containing Class objects corresponding to each of the - * class names in the foClassNames array. It is initialized in a static - * initializer in parallel with the creation of the class names in the - * foClassNames array. It can be indexed by the class name constants - * defined in this file. - * - * It is not guaranteed that there exists a class corresponding to each of - * the FlowObjects defined in this file. - */ - private static final Class[] foClasses; - - /** - * A HashMap whose elements are an integer index value keyed by an - * fo local name. The index value is the index of the fo local name in - * the FObjectNames.foLocalNames[] array. - * It is initialized in a static initializer. - */ - private static final HashMap foToIndex; - - /** - * A HashMap whose elements are an integer index value keyed by the name - * of a fo class. The index value is the index of the fo - * class name in the foClassNames[] array. It is initialized in a - * static initializer. - */ - private static final HashMap foClassToIndex; - // Following are the sets of properties which apply to particular - // subtrees of the FO Tree. This whole section is probably redundant. - // If it is restored to full functioning, the public BitSet objects - // must be replaced with unmodifiableSets. - /** * Set of all properties available at fo:root. */ @@ -380,63 +307,5 @@ public class FOPropertySets { isReferenceArea = new ROBitSet(refareas); } - static { - String prefix = packageNamePrefix + "."; - String foPrefix = "Fo"; - int namei = 0; // Index of localName in FObjectNames.foLocalNames - int pkgi = 1; // Index of package suffix in foLocalNames - - foClassNames = new String[FObjectNames.foLocalNames.length]; - foClassPackages = new String[FObjectNames.foLocalNames.length]; - foClasses = new Class[FObjectNames.foLocalNames.length]; - foToIndex = new HashMap(FObjectNames.foLocalNames.length); - foClassToIndex = new HashMap(FObjectNames.foLocalNames.length); - - for (int i = 1;i < FObjectNames.foLocalNames.length; i++) { - String cname = foPrefix; - StringTokenizer stoke = - new StringTokenizer(FObjectNames.foLocalNames[i][namei], - "-"); - while (stoke.hasMoreTokens()) { - String token = stoke.nextToken(); - String pname = new Character( - Character.toUpperCase(token.charAt(0)) - ).toString() + token.substring(1); - cname = cname + pname; - } - foClassNames[i] = cname; - - // Set up the array of class package names - String pkgname = prefix + FObjectNames.foLocalNames[i][pkgi]; - - // Set up the array of Class objects, indexed by the fo - // constants. - String name = prefix + cname; - try { - foClasses[i] = Class.forName(name); - } catch (ClassNotFoundException e) {} - - // Set up the foToIndex Hashmap with the name of the - // flow object as a key, and the integer index as a value - if (foToIndex.put((Object) FObjectNames.foLocalNames[i][namei], - Ints.consts.get(i)) != null) { - throw new RuntimeException( - "Duplicate values in propertyToIndex for key " + - FObjectNames.foLocalNames[i][namei]); - } - - // Set up the foClassToIndex Hashmap with the name of the - // fo class as a key, and the integer index as a value - - if (foClassToIndex.put((Object) foClassNames[i], - Ints.consts.get(i)) != null) { - throw new RuntimeException( - "Duplicate values in foClassToIndex for key " + - foClassNames[i]); - } - - } - } - } -- 2.39.5