You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/03/21 16:41:51 UTC
svn commit: r387551 - in
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema:
SchemaCompiler.java i18n/resource.properties
Author: ajith
Date: Tue Mar 21 07:41:49 2006
New Revision: 387551
URL: http://svn.apache.org/viewcvs?rev=387551&view=rev
Log:
Putting proper error messages for the unsupported schema content.The messages are properly i18ned.
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/resource.properties
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=387551&r1=387550&r2=387551&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java Tue Mar 21 07:41:49 2006
@@ -727,6 +727,8 @@
}else if (content instanceof XmlSchemaComplexContentRestriction){
//todo handle complex restriction here
+ throw new SchemaCompilationException(
+ SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Complex Content"));
}
}
@@ -778,7 +780,8 @@
}
}else if (content instanceof XmlSchemaSimpleContent){
- //todo
+ throw new SchemaCompilationException(
+ SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content"));
}else{
throw new SchemaCompilationException(
SchemaCompilerMessages.getMessage("schema.unknowncontenterror"));
@@ -791,13 +794,19 @@
}
}
- private void processSimpleContent(XmlSchemaSimpleContent simpleContent,BeanWriterMetaInfoHolder metaInfHolder){
+ private void processSimpleContent(XmlSchemaSimpleContent simpleContent,BeanWriterMetaInfoHolder metaInfHolder)
+ throws SchemaCompilationException{
XmlSchemaContent content;
content = simpleContent.getContent();
if (content instanceof XmlSchemaSimpleContentExtension){
//todo - handle simple type extension here
+ throw new SchemaCompilationException(
+ SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content Extension"));
}else if (content instanceof XmlSchemaSimpleContentRestriction){
//todo - Handle simple type restriction here
+ throw new SchemaCompilationException(
+ SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content Restriction"));
+
}
}
@@ -927,7 +936,7 @@
if (elt.getQName()!=null){
clazzName = (String) processedElementTypeMap.get(elt.getQName());
- referencedQName = elt.getQName();
+ referencedQName = elt.getQName();
metainfHolder.registerMapping(referencedQName,
elt.getSchemaType()!=null?elt.getSchemaType().getQName():elt.getSchemaTypeName(), //always get the schema type name from the schema it-self
clazzName,
@@ -1005,7 +1014,7 @@
*
* @param simpleType
*/
- private void processSimpleSchemaType(XmlSchemaSimpleType simpleType) {
+ private void processSimpleSchemaType(XmlSchemaSimpleType simpleType) throws SchemaCompilationException{
// handle the restriction
XmlSchemaSimpleTypeContent content = simpleType.getContent();
if (content != null) {
@@ -1028,9 +1037,13 @@
}
}else if (content instanceof XmlSchemaSimpleTypeUnion) {
//Todo - Handle unions here
+ throw new SchemaCompilationException(
+ SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Type Uniont"));
}else if (content instanceof XmlSchemaSimpleTypeList){
//todo - Handle lists here
+ throw new SchemaCompilationException(
+ SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Type List"));
}
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/resource.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/resource.properties?rev=387551&r1=387550&r2=387551&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/resource.properties Tue Mar 21 07:41:49 2006
@@ -19,7 +19,7 @@
schema.compilerexception=Compiler caused an exception
###################Schema compiler ###########################################
-schema.unsupportedcontenterror=Unsupported content!
+schema.unsupportedcontenterror=Unsupported content {0} !
schema.unknowncontenterror=Unknown content!
################## Options ###################################################
schema.unsupportedvalue=Unsupported value!