Justin Deoliveira wrote:
> I fail to see why you are upgrading. I already stated that i was going 
> to remove the dependency... so it seems like you are just making work 
> for yourself :).
Two reasons:
- it is faster to waste my time them Graham's
- so we solve this for gt-core? all that does is make this a pain for 
the next person who wants to use jaxb

This time let me ask for a code review... this following implementation 
still passes tests; and will throw a useful IllegalArgumentException 
(for arguments are illegal for reasons other than the "prefix" being 
unknown).
>    public Object parse(InstanceComponent instance, Object value)
>         throws Exception {
>         
>         String s = (String) value;
>         int i = s == null ? -1 : s.indexOf(':');
>         
>         QName qName;        
>         if (i != -1) {
>             String prefix = s.substring(0, i);
>             String namespace = namespaceContext.getNamespaceURI( prefix );
>             if( namespace != null ){
>                 qName = DatatypeConverter.parseQName((String) value, 
> namespaceContext);
>             }
>             else {
>                 // prefix was not known
>                 String local = s.substring(i + 1);                
>                 return new QName(null, local, prefix);
>             }
>         }
>         else {
>             qName = DatatypeConverter.parseQName((String) value, 
> namespaceContext);
>         }
>         
>         if (qName != null) {
>             return qName;
>         }
>         else if (value == null) {
>             return new QName(null);
>         }
>         else if (i != -1) {
>             String prefix = s.substring(0, i);
>             String local = s.substring(i + 1);
>
>             return new QName(null, local, prefix);
>         }
>         else {
>             return new QName(null, s);
>         }
>     }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to