Problem Fixed
---------------
Prior to the proposed change the following attribute declaration with
type="langauge":
<attribute name = "lang" default = "en-us" form = "qualified" type =
"language"/>
would cause a warning to be generated and the resulting code to not be
compilable.
Attached is a proposed enhancement that does two things:
1. Treats the type="language" in an attribute same as if it were
type="string". The resulting code compiles and is usable. It does not do
the validation on the string
2. Fixes the warning that was out put so that teh unsupported type is in
quotes. This will make the message more meaningful and obvious IMO.
Please ask any questions and forgive me if I did not follow normal
procedures. I am a new contributor to castor. Thanks for a great tool.
Index: TypeConversion.java
===================================================================
RCS file:
/cvs/castor/castor/src/main/org/exolab/castor/builder/TypeConversion.java,v
retrieving revision 1.44
diff -c -r1.44 TypeConversion.java
*** TypeConversion.java 11 Jul 2001 11:08:33 -0000 1.44
--- TypeConversion.java 30 Nov 2001 01:37:08 -0000
***************
*** 284,289 ****
--- 284,290 ----
return xsQName;
}
//-- string
+ case SimpleTypesFactory.LANGUAGE_TYPE:
case SimpleTypesFactory.STRING_TYPE:
{
XSString xsString = new XSString();
***************
*** 308,315 ****
}
default:
//-- error
! String warning = "Warning: The W3C datatype
"+simpleType.getName();
! warning += " is not currently supported by Castor
Source Generator.";
System.out.println(warning);
String className
=
JavaNaming.toJavaClassName(simpleType.getName());
--- 309,316 ----
}
default:
//-- error
! String warning = "Warning: The W3C datatype
'"+simpleType.getName();
! warning += "' is not currently supported by Castor
Source Generator.";
System.out.println(warning);
String className
=
JavaNaming.toJavaClassName(simpleType.getName());
--
Regards,
Farrukh
begin:vcard
n:Najmi;Farrukh
tel;work:781-442-0703
x-mozilla-html:FALSE
url:www.sun.com
org:Sun Microsystems;Java Software
adr:;;1 Network Dr. MS BUR02-302;Burlington;MA;01803-0902;USA
version:2.1
email;internet:[EMAIL PROTECTED]
fn:Farrukh Najmi
end:vcard