-
1. Re: Dependency on XB DefaultSchemaResolver
adrian.brock Mar 5, 2009 7:53 AM (in response to aloubyansky)"alex.loubyansky@jboss.com" wrote:
Maybe, we can agree on an interface like SchemaResolverWithURIToClassMapping? Or other suggestions?
What about MutableSchemaResolver as a name?
Anyway, the JBossXBDeployerHelper looks like it should be maintained in JBossXB anyway?
I guess the main reason why it is not, is because its providing some "VFS integration".
Maybe this could be more simply done by having a VFSInputSource? -
2. Re: Dependency on XB DefaultSchemaResolver
aloubyansky Mar 5, 2009 8:14 AM (in response to aloubyansky)"adrian@jboss.org" wrote:
What about MutableSchemaResolver as a name?
No problem.Anyway, the JBossXBDeployerHelper looks like it should be maintained in JBossXB anyway?
I don't mind maintaining a helper class. Of course, deployer-specific bits should still be in the deployers project. If you or Ales want to refactor JBossXBDeployerHelper and extract a helper for the XB, I'll maintain it.I guess the main reason why it is not, is because its providing some "VFS integration".
Maybe this could be more simply done by having a VFSInputSource?
That's an idea. Which project would it be in? Common? XB does not depend on VFS. -
3. Re: Dependency on XB DefaultSchemaResolver
adrian.brock Mar 5, 2009 8:25 AM (in response to aloubyansky)"alex.loubyansky@jboss.com" wrote:
That's an idea. Which project would it be in? Common? XB does not depend on VFS.
It would go in the VFS project. JAXP is part of the JDK so there's no problem
with VFS maintaining its own Input/OutputSource.
They'd probably just delegate to the Stream versions like the helper does.
I'm just wondering whether all the signatures are available in the Unmarshaller interface? -
4. Re: Dependency on XB DefaultSchemaResolver
aloubyansky Mar 5, 2009 8:33 AM (in response to aloubyansky)Yes, Unmarshaller can take String, InputStream, Reader and InputSource.
http://anonsvn.jboss.org/repos/common/jbossxb/trunk/src/main/java/org/jboss/xb/binding/Unmarshaller.java -
5. Re: Dependency on XB DefaultSchemaResolver
alesj Mar 6, 2009 4:19 AM (in response to aloubyansky)I'll move/refactor the JBossXBDeployerHelper to XB today.
And create a proper VFSInputSource in VFS. -
6. Re: Dependency on XB DefaultSchemaResolver
aloubyansky Mar 6, 2009 5:13 AM (in response to aloubyansky)Ok, thanks.
There also are some helper classes/methods regarding resolvers: SchemaResolverConfig and SingletonSchemaResolverFactory.
Maybe there will be something useful for you.
I've committed MutableSchemaResolver to XB trunk. Issue https://jira.jboss.org/jira/browse/JBXB-190
In the interface for mapping methods instead of "add" prefix I used "map", since in case of one-to-many mapping (e.g. uri-to-classes) "add" seems to be more ambiguous for methods that override previous mapping instead of actually adding. -
7. Re: Dependency on XB DefaultSchemaResolver
aloubyansky Mar 6, 2009 5:22 AM (in response to aloubyansky)PS: if you want to run testsuites (of your projects, not xb) with latest XB then probably you should set system property xb.builder.useUnorderedSequence to true or invoke JBossXBBuilder.setUseUnorderedSequence(true) to not enforce element ordering in sequences.
But actually, if there are xml/binding validation issues they should be resolved, there have to be a good reason to use unordered sequences. Please, post on xb forum any issues you find. -
8. Re: Dependency on XB DefaultSchemaResolver
alesj Mar 6, 2009 6:02 PM (in response to aloubyansky)This is now done under JBXB-191.
Is there anything else to VFSInputSource than this:public class VFSInputSource extends InputSource { private VirtualFile file; public VFSInputSource(VirtualFile file) { if (file == null) throw new IllegalArgumentException("Null file"); this.file = file; } @Override public String getSystemId() { try { return file.toURI().toString(); } catch (Exception e) { throw new RuntimeException(e); } } @Override public InputStream getByteStream() { try { return file.openStream(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public Reader getCharacterStream() { return new InputStreamReader(getByteStream()); } }
-
9. Re: Dependency on XB DefaultSchemaResolver
alesj Mar 7, 2009 7:33 AM (in response to aloubyansky)I've also updated the Deployers,
to use this JBXB-191 and JBVFS-99. -
10. Re: Dependency on XB DefaultSchemaResolver
aloubyansky Mar 9, 2009 9:19 AM (in response to aloubyansky)Thanks. I've added my 2 cents though in the form of renaming JBossXBDeployerHelper to JBossXBHelper and moving it to org.jboss.xb.util. I've rebuilt XB snapshot, uploaded it to the snapshot repositories and also updated deployers under JBDEPLOY-173.