[FOray-commit] SF.net SVN: foray: [7816] trunk/foray/foray-fotree/src/java/org/foray/fotree/fo
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-07-23 17:25:50
|
Revision: 7816 Author: victormote Date: 2006-07-23 10:25:44 -0700 (Sun, 23 Jul 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7816&view=rev Log Message: ----------- Implement standard use of final modifier on local variable and method parameters. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2006-07-23 17:19:43 UTC (rev 7815) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/NamespaceFO.java 2006-07-23 17:25:44 UTC (rev 7816) @@ -55,26 +55,28 @@ return "fo"; } - public FObj parseElementForNS(String localName, FObj currentFObj, - PropertyList list, Locator locator) throws FOTreeException { + public FObj parseElementForNS(final String localName, + final FObj currentFObj, final PropertyList list, + final Locator locator) throws FOTreeException { return ObjectMakerFO.makeObject(localName, currentFObj, list, locator); } - public void parseAttributes(PropertyList propertyList, Attributes attlist, - FObj currentFObj, Locator locator, FOTreeBuilder builder) + public void parseAttributes(final PropertyList propertyList, + final Attributes attlist, final FObj currentFObj, + final Locator locator, final FOTreeBuilder builder) throws FOTreeException { - int[] attributeSort = sortAttributes(attlist); + final int[] attributeSort = sortAttributes(attlist); try { makeList(propertyList, attlist, currentFObj, attributeSort, locator, builder); - } catch (PropertyException e) { + } catch (final PropertyException e) { currentFObj.throwException(e.getMessage()); } } - public Property parseAttributeForNS(Attributes attributes, - String attributeName, String attributeValue, - PropertyList propertyList, Locator locator) + public Property parseAttributeForNS(final Attributes attributes, + final String attributeName, final String attributeValue, + final PropertyList propertyList, final Locator locator) throws PropertyException { Property property = null; // Try the FO namespace. @@ -88,11 +90,11 @@ return property; } - public byte enumerateElement(String localName) { + public byte enumerateElement(final String localName) { return ObjectMakerFO.enumerateObjectName(localName); } - public short enumerateAttribute(String attributeName) { + public short enumerateAttribute(final String attributeName) { short enumerated = PropertyMakerFO.enumeratePropertyName(attributeName); // If not found, try the XML namespace. if (enumerated < 0) { @@ -101,12 +103,12 @@ return enumerated; } - protected PropertyList createNewPropertyList(String localName, - Attributes attlist) { + protected PropertyList createNewPropertyList(final String localName, + final Attributes attlist) { return new PropertyList(); } - public String getPropertyName(short propertyType) { + public String getPropertyName(final short propertyType) { return Constants.expandPropertyNameEnumeration(propertyType); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2006-07-23 17:19:43 UTC (rev 7815) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2006-07-23 17:25:44 UTC (rev 7816) @@ -100,14 +100,14 @@ * @param objectName The object name to be enumerated. * @return The enumerated value of the object name. */ - public static byte enumerateObjectName(String objectName) { + public static byte enumerateObjectName(final String objectName) { return (byte) Arrays.binarySearch(Constants.objectNameList, objectName); } - public static FObj makeObject(String objectName, FObj parent, - PropertyList propertyList, Locator locator) + public static FObj makeObject(final String objectName, final FObj parent, + final PropertyList propertyList, final Locator locator) throws FOTreeException { - byte enumeration = enumerateObjectName(objectName); + final byte enumeration = enumerateObjectName(objectName); String systemId = null; int line = 0; int column = 0; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2006-07-23 17:19:43 UTC (rev 7815) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2006-07-23 17:25:44 UTC (rev 7816) @@ -150,18 +150,18 @@ */ public static short enumeratePropertyName(String propertyName) { propertyName = Property.getBasePropertyName(propertyName); - short enumerated = (short) Arrays.binarySearch( + final short enumerated = (short) Arrays.binarySearch( Constants.propertyNameList, propertyName); return enumerated; } - public static Property makeProperty(String propertyFullName, - String attributeValue, PropertyList propertyList) + public static Property makeProperty(final String propertyFullName, + final String attributeValue, final PropertyList propertyList) throws PropertyException { - String basePropertyName = Property.getBasePropertyName + final String basePropertyName = Property.getBasePropertyName (propertyFullName); - short enumeration = enumeratePropertyName(basePropertyName); - Property property = checkCompoundProperty(propertyList, + final short enumeration = enumeratePropertyName(basePropertyName); + final Property property = checkCompoundProperty(propertyList, enumeration, propertyFullName, attributeValue); if (property != null) { return property; @@ -1114,12 +1114,13 @@ * @return True if the property was successfully processed here (i.e. no * further processing is necessary), false otherwise. */ - private static Property checkCompoundProperty(PropertyList propertyList, - short enumeration, String propertyFullName, String attributeValue) + private static Property checkCompoundProperty( + final PropertyList propertyList, final short enumeration, + final String propertyFullName, final String attributeValue) throws PropertyException { switch (enumeration) { case Constants.FOPROP_BLOCK_PROGRESSION_DIMENSION: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_BLOCK_PROGRESSION_DIMENSION); if (property == null) { return null; @@ -1131,7 +1132,7 @@ return property; } case Constants.FOPROP_INLINE_PROGRESSION_DIMENSION: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_INLINE_PROGRESSION_DIMENSION); if (property == null) { return null; @@ -1143,7 +1144,7 @@ return property; } case Constants.FOPROP_SPACE_AFTER: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_SPACE_AFTER); if (property == null) { return null; @@ -1155,7 +1156,7 @@ return property; } case Constants.FOPROP_SPACE_BEFORE: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_SPACE_BEFORE); if (property == null) { return null; @@ -1167,7 +1168,7 @@ return property; } case Constants.FOPROP_SPACE_END: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_SPACE_END); if (property == null) { return null; @@ -1179,7 +1180,7 @@ return property; } case Constants.FOPROP_SPACE_START: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_SPACE_START); if (property == null) { return null; @@ -1191,7 +1192,7 @@ return property; } case Constants.FOPROP_BORDER_SEPARATION: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_BORDER_SEPARATION); if (property == null) { return null; @@ -1203,7 +1204,7 @@ return property; } case Constants.FOPROP_LETTER_SPACING: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_LETTER_SPACING); if (property == null) { return null; @@ -1215,7 +1216,7 @@ return property; } case Constants.FOPROP_WORD_SPACING: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_WORD_SPACING); if (property == null) { return null; @@ -1227,7 +1228,7 @@ return property; } case Constants.FOPROP_KEEP_TOGETHER: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_KEEP_TOGETHER); if (property == null) { return null; @@ -1239,7 +1240,7 @@ return property; } case Constants.FOPROP_KEEP_WITH_NEXT: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_KEEP_WITH_NEXT); if (property == null) { return null; @@ -1251,7 +1252,7 @@ return property; } case Constants.FOPROP_KEEP_WITH_PREVIOUS: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_KEEP_WITH_PREVIOUS); if (property == null) { return null; @@ -1263,7 +1264,7 @@ return property; } case Constants.FOPROP_LINE_HEIGHT: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_LINE_HEIGHT); if (property == null) { return null; @@ -1275,7 +1276,7 @@ return property; } case Constants.FOPROP_LEADER_LENGTH: { - Property property = getProperty(propertyList, + final Property property = getProperty(propertyList, Constants.FOPROP_LEADER_LENGTH); if (property == null) { return null; @@ -1297,8 +1298,8 @@ * @param propertyType The integral identifier for the desired property. * @return The Property instance, or null if it does not exist. */ - private static Property getProperty(PropertyList propertyList, - short propertyType) { + private static Property getProperty(final PropertyList propertyList, + final short propertyType) { return propertyList.getProperty(propertyType); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |