multi-mapping has been added since the 0.6 build was taken. the next betwixt release will be 0.6.1 (which is why the current CVS version is numbered 0.6.1-dev) and will include new features such as multi-mapping.
so, you'll need to roll your own version from CVS HEAD (you can use something like cvsgrab if you cannot use CVS) or use a recent nightly. if you really need to use a released version, then it's probably worth petitioning for a new release including the new features...
- robert
On 27 Oct 2004, at 18:45, JonTom Kittredge wrote:
Robert, Thank you for the reply. I appreciate the help. Unfortunately, I'm still very confused.
I tried reducing my code to the simplest possible test case (code at bottom of the message) and I compiled with the -classpath set to smallest possible set of jars (commons-betwixt-0.6.jar, commons-digester-1.6.jar, and xalan-2_6_0.jar), but I still got the same compile error. (Just to be extra sure, I used jar to examine the contents of these three jars, but found BeanReader only in the betwixt jar.)
I tried it both with the jar included in the binary commons-betwixt-0.6 down load and in the source commons-betwixt-0.6-src that I downloaded and compiled myself. When I look at the BeanReader.java file included in that download, I see only two versions of the registerBeanClass() method, without the one that takes a InputSource.
I get even more confused when I look at the Javadoc on the Betwixt web site.
If I look at the Javadoc found at http://jakarta.apache.org/commons/betwixt/apidocs/index.html (I got there follow the "Javadoc" link on the left-hand navbar at the top-level of the site), the package list displayed is titled "Betwixt 0.6.1-dev API"
There I find these three versions of the BeanReader.registerBeanClass() method: void registerBeanClass(java.lang.Class beanClass) Register a bean class and add mapping rules for this bean class.
void registerBeanClass(org.xml.sax.InputSource mapping, java.lang.Class beanClass)
Registers a class with a custom mapping.
void registerBeanClass(java.lang.String path, java.lang.Class beanClass)
Registers a bean class and add mapping rules for this bean class
at the given path expression.
*However*, in the Javadoc found at
http://jakarta.apache.org/commons/betwixt/betwixt-0.6/apidocs/ index.html
(I got there following the "Release Documentation"->"0.6" link on the
top-lvel Betwixt web site, and *then* clicking on "Javadoc")
the package list that is displayed is titled "Betwixt 0.6 API".
In that Javadoc, there only two versions of the BeanReader.registerBeanClass() method:
void registerBeanClass(java.lang.Class beanClass) Register a bean class and add mapping rules for this bean class.
void registerBeanClass(java.lang.String path, java.lang.Class beanClass)
Registers a bean class and add mapping rules for this bean
class at the given path expression.
It's starting to look to me like the Betwixt 0.6 available for download is earlier version of 0.6 that doesn't support custom dot-betwixt documents and multi-mapping.
Or am I completely missing it? Thanks for any help you can give.
Yours, JonTom
JT Kittredge ITA Software, Inc. Cambridge, Massachusetts
On 2004-10-25 at 22:35, robert burrell donkin wrote:looks like a dependency issue.
i suspect that there's an old betwixt jar in your runtime classpath
(that isn't in you compile classpath). it's just possible that (since
you look like you're using bytecode enhancement) that some of your code
is old and needs to be cleanly recompiled.
- robert
On 22 Oct 2004, at 21:52, JonTom Kittredge wrote:
I am using Betwixt-0.6, which I downloaded last week. I was trying to use the "Custom Dot Betwixt Documents" feature, as described in the "Binding Beans" feature of the User Guide.
I'm trying to imitate the following example:
String contractSetBetwixt = ("<?xml version='1.0' encoding='UTF-8' ?>" + "<info primitiveTypes=\"attribute\">" + " <element name=\"dbq:ContractSet\">" + " <element name=\"dbq:Contract\" property=\"contracts\"/>" + " <addDefaults/>" + " </element>" + "</info>"); beanReader.registerBeanClass(new InputSource(new StringReader(contractSetBetwixt)), DBQContractSet.class);
When I tried to compile the code, however, I got this error: com/itasoftware/rfd/hibernate/DBQContractStoreHIB.java:153: cannot resolve symbol nsymbol : method registerBeanClass (org.xml.sax.InputSource,java.lang.Class) location: class org.apache.commons.betwixt.io.BeanReader beanReader.registerBeanClass(new InputSource(new StringReader(contractSetBetwixt)),
When I look at the Java Doc, the method is definitely there:
void registerBeanClass(org.xml.sax.InputSource mapping, java.lang.Class beanClass) Registers a class with a custom mapping.
But when I look at the source for BeanReader.java, the method isn't there!
What gives?
Yours, JonTom
JT Kittredge ITA Software, Inc. Cambridge, Massachusetts
import java.beans.*; import java.io.*; import java.text.*; import java.util.*;
import org.apache.commons.betwixt.*; import org.apache.commons.betwixt.io.*; import org.xml.sax.*;
public abstract class BetwixtTest {
public static BeanReader newBeanReader() throws IOException, IntrospectionException { BeanReader bReader = new BeanReader();
String testSetBetwixt =
("<?xml version='1.0'?>\n" +
"<info>\n" +
" <element name=\"TestSet\">\n" +
" <addDefaults/>\n" +
" </element>\n" +
"</info>\n");
bReader.registerBeanClass(new InputSource(new StringReader(testSetBetwixt)), TestSet.class);
//bReader.registerBeanClass("TestSet", TestSet.class);
return bReader; }
public class TestSet { public TestSet() { mSetObject = new TreeSet(); }
public Iterator getObjects() { return mSetObject.iterator(); } public void addObject(Object object) { mSetObject.add(object); }
public String toString() { return ("<TestSet: " + mSetObject.size() + "/>"); }
private Set mSetObject; }
}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
