that's hot. nope -- Util.getPackageNameFromNamespaceURI was all i was
looking for. i'm not as concerned with customization at the moment as i
am with predictability:)
jon
Kohsuke Kawaguchi wrote:
> jonathan gold wrote:
>
>> i've written a custom little string parser that takes a namespace and
>> outputs the java package name. it works for us, because we have pretty
>> simple package names that follow a known convention. i was hoping i'd
>> be able to pick some stuff out of the xjc code to use it directly, and
>> i looked around in xjc, and saw that ClassSelector seems to be able to
>> do this, but it's also not particularly lightweight, which makes
>> sense, since xjc needs to be aware of all of the jaxb customizations,
>> bindings, and other compile time context. i'm curious to see if
>> there's anyone else who would benefit from having a context free,
>> lightweight, simple utility class that would just do the lexical
>> conversion from a namespace to a package name?
>
>
> The actual automatic URI->package conversion is defined in the
> com.sun.tools.xjc.reader.Util.etPackageNameFromNamespaceURI method,
> which is context-free code.
>
> The one in ClassSelector.getPackage needs to take other things into
> account, and this one isn't particularly reusable nor simple.
>
> If your question is how you can plug-in your own nsURI->package
> converter code, you can't do that today, but that seems like a
> reasonable thing to expose for plugins.
>
> Or did I miss your point?
>