[FOray-commit] SF.net SVN: foray: [7889] trunk/foray/foray-fotree/src/java/org/foray/ fotree
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-04 22:01:51
|
Revision: 7889
http://svn.sourceforge.net/foray/?rev=7889&view=rev
Author: victormote
Date: 2006-09-04 15:01:46 -0700 (Mon, 04 Sep 2006)
Log Message:
-----------
Conform to axsl change: Have traitSourceDocument() return a String[] instead of a String.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SourceDocument.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-09-04 20:26:51 UTC (rev 7888)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-09-04 22:01:46 UTC (rev 7889)
@@ -1570,7 +1570,7 @@
/**
* {@inheritDoc}
*/
- public String traitSourceDocument(final FOContext context) {
+ public String[] traitSourceDocument(final FOContext context) {
return propertyList.getSourceDocument(context);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-09-04 20:26:51 UTC (rev 7888)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-09-04 22:01:46 UTC (rev 7889)
@@ -2062,7 +2062,7 @@
(context, Constants.FOPROP_BACKGROUND_REPEAT, fobj);
}
- public String getSourceDocument(final FOContext context) {
+ public String[] getSourceDocument(final FOContext context) {
final SourceDocument property = (SourceDocument) getProperty
(Constants.FOPROP_SOURCE_DOCUMENT);
if (property == null) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SourceDocument.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SourceDocument.java 2006-09-04 20:26:51 UTC (rev 7888)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SourceDocument.java 2006-09-04 22:01:46 UTC (rev 7889)
@@ -31,6 +31,7 @@
import org.foray.fotree.value.DtURI;
import org.foray.fotree.value.PropertyKeyword;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.ValueCollection;
import org.axsl.common.Constants;
import org.axsl.foR.FOContext;
@@ -62,20 +63,20 @@
}
final ArrayList tokenizedList = DtURI.tokenizeURIList(value);
if (tokenizedList.size() > 0) {
- /*
- * For now, just store the first one. TODO: We probably need to
- * store these in a PropertyCollection & return a String[].
- */
- final String token = (String) tokenizedList.get(0);
- final DtURI uri = DtURI.makeUriDT(token);
- if (uri != null) {
- return uri;
+ final ValueCollection collection = new ValueCollection();
+ for (int i = 0; i < tokenizedList.size(); i++) {
+ final String token = (String) tokenizedList.get(i);
+ final DtURI uri = DtURI.makeUriDT(token);
+ if (uri != null) {
+ collection.addItem(uri);
+ }
}
+ return collection;
}
throw unexpectedValue(value, propertyList);
}
- public String getValue(final FOContext context, final FObj fobj) {
+ public String[] getValue(final FOContext context, final FObj fobj) {
if (this.value instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value).getValue();
switch (keyword) {
@@ -86,18 +87,24 @@
}
}
case Constants.FOVAL_NONE: {
- return "";
+ return null;
}
}
}
- if (this.value instanceof DtURI) {
- return ((DtURI) this.value).getValue();
+ if (this.value instanceof ValueCollection) {
+ final ValueCollection theCollection = (ValueCollection) this.value;
+ final String[] returnArray = new String[theCollection.getCount()];
+ for (int i = 0; i < theCollection.getCount(); i++) {
+ final DtURI value = (DtURI) theCollection.getItem(i);
+ returnArray[i] = value.getValue();
+ }
+ return returnArray;
}
return getValueNoInstance();
}
- public static String getValueNoInstance() {
- return "";
+ public static String[] getValueNoInstance() {
+ return null;
}
protected short[] getValidKeywords() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|