Class DefaultSchemaGenerator
java.lang.Object
org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator
- All Implemented Interfaces:
Java2WSDLConstants,SchemaGenerator
- Direct Known Subclasses:
DocLitBareSchemaGenerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected ClassLoaderprotected Stringprotected Stringprotected Stringprotected booleanprotected booleanprotected Stringprotected Method[]protected MethodTablestatic final Stringprotected NamespaceGeneratorprotected Stringprotected Stringprotected AxisServiceprotected Class<?>protected booleanprotected Stringprotected TypeTableprotected booleanprotected org.apache.ws.commons.schema.XmlSchemaCollectionFields inherited from interface org.apache.axis2.description.java2wsdl.Java2WSDLConstants
ATTR_FORM_DEFAULT_OPTION, ATTR_FORM_DEFAULT_OPTION_LONG, ATTRIBUTE_NAME, AXIS2_NAMESPACE_PREFIX, AXIS2_XSD, BINDING_LOCAL_NAME, BINDING_NAME_SUFFIX, CLASSNAME_OPTION, CLASSNAME_OPTION_LONG, CLASSPATH_OPTION, CLASSPATH_OPTION_LONG, COLON_SEPARATOR, CUSTOM_SCHEMA_LOCATION, CUSTOM_SCHEMA_LOCATION_LONG, DEFAULT_LOCATION_URL, DEFAULT_SCHEMA_NAMESPACE_PREFIX, DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE_PREFIX, DEFAULT_WSDL_NAMESPACE_PREFIX, DISABLE_BINDING_REST, DISABLE_BINDING_SOAP11, DISABLE_BINDING_SOAP12, DISALLOW_ANON_TYPES_OPTION, DISALLOW_ANON_TYPES_OPTION_LONG, DISALLOW_NILLABLE_ELEMENTS_OPTION, DISALLOW_NILLABLE_ELEMENTS_OPTION_LONG, DISALLOW_OPTIONAL_ELEMENTS_OPTION, DISALLOW_OPTIONAL_ELEMENTS_OPTION_LONG, DOC_LIT_BARE, DOC_LIT_BARE_LONG, DOC_LIT_BARE_PARAMETER, DOCUMENT, ELEMENT_ATTRIBUTE_NAME, ELEMENT_FORM_DEFAULT_OPTION, ELEMENT_FORM_DEFAULT_OPTION_LONG, EXTRA_CLASSES_DEFAULT_OPTION, EXTRA_CLASSES_DEFAULT_OPTION_LONG, FAULT_LOCAL_NAME, FAULT_MESSAGE, FORM_DEFAULT_QUALIFIED, FORM_DEFAULT_UNQUALIFIED, HTTP_BINDING, HTTP_NAMESPACE, HTTP_PORT, HTTP_PREFIX, IN_PUT_LOCAL_NAME, JAVA_PKG_2_NSMAP_OPTION, JAVA_PKG_2_NSMAP_OPTION_LONG, JAX_WS_SERVICE_OPTION, JAX_WS_SERVICE_OPTION_LONG, LITERAL, LOCATION, LOCATION_OPTION, LOCATION_OPTION_LONG, MESSAGE_LOCAL_NAME, MESSAGE_PART_NAME_OPTION, MESSAGE_PART_NAME_OPTION_LONG, MESSAGE_SUFFIX, MIME_NAMESPACE, MIME_PREFIX, NAMESPACE_GENERATOR_OPTION, NAMESPACE_GENERATOR_OPTION_LONG, OPERATION_LOCAL_NAME, OUT_PUT_LOCAL_NAME, OUTPUT_FILENAME_OPTION, OUTPUT_FILENAME_OPTION_LONG, OUTPUT_LOCATION_OPTION, OUTPUT_LOCATION_OPTION_LONG, PARAMETERS, PART_ATTRIBUTE_NAME, PORT, PORT_NAME_SUFFIX, PORT_TYPE_LOCAL_NAME, PORT_TYPE_NAME_OPTION, PORT_TYPE_NAME_OPTION_LONG, PORT_TYPE_SUFFIX, REQUEST, REQUEST_ELEMENT_SUFFIX_OPTION, REQUEST_ELEMENT_SUFFIX_OPTION_LONG, REQUEST_MESSAGE, RESPONSE, RESPONSE_MESSAGE, REST_BINDING_NAME_OPTION_LONG, RESULT, SCHEMA_GENERATOR_OPTION, SCHEMA_GENERATOR_OPTION_LONG, SCHEMA_MAPPING_FILE_LOCATION, SCHEMA_MAPPING_FILE_LOCATION_LONG, SCHEMA_NAMESPACE_PRFIX, SCHEMA_TARGET_NAMESPACE_OPTION, SCHEMA_TARGET_NAMESPACE_OPTION_LONG, SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION, SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG, SERVICE_LOCAL_NAME, SERVICE_NAME_OPTION, SERVICE_NAME_OPTION_LONG, SOAP_ACTION, SOAP_ADDRESS, SOAP_BODY, SOAP_USE, SOAP11_BINDING_NAME_OPTION_LONG, SOAP11_PREFIX, SOAP11PORT, SOAP12_BINDING_NAME_OPTION_LONG, SOAP12_PREFIX, SOAP12BINDING_NAME_SUFFIX, SOAP12PORT, SOLE_INPUT, STYLE, STYLE_OPTION, STYLE_OPTION_LONG, TARGET_NAMESPACE_OPTION, TARGET_NAMESPACE_OPTION_LONG, TARGET_NAMESPACE_PREFIX_OPTION, TARGET_NAMESPACE_PREFIX_OPTION_LONG, TARGETNAMESPACE_PREFIX, TRANSPORT, TRANSPORT_URI, URI_2001_SCHEMA_XSD, URI_WSDL11_SOAP, URI_WSDL12_SOAP, URN_PREFIX, USE_OPTION, USE_OPTION_LONG, WSAD_NS, WSDL_NAMESPACE, WSDL_VERSION_1, WSDL_VERSION_2, WSDL_VERSION_2_OPTIONAL, WSDL_VERSION_OPTION, WSDL_VERSION_OPTION_LONG -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSchemaGenerator(ClassLoader loader, String className, String schematargetNamespace, String schematargetNamespacePrefix, AxisService service) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddContentToMethodSchemaType(org.apache.ws.commons.schema.XmlSchemaSequence sequence, QName schemaTypeName, String paraName, boolean isArray) protected voidprotected StringCollection<org.apache.ws.commons.schema.XmlSchema>Generates schema for all the parameters in method.protected QNamegenerateSchema(Class<?> javaType) Generate schema construct for given typeprotected QNamegenerateSchemaForCollection(org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericType, String partName) Generate schema for collection.protected voidgenerateSchemaforFieldsandProperties(org.apache.ws.commons.schema.XmlSchema xmlSchema, org.apache.ws.commons.schema.XmlSchemaSequence sequence, Class<?> type, String name, boolean isArrayType) protected voidgenerateSchemaforGenericFields(org.apache.ws.commons.schema.XmlSchema xmlSchema, org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericType, String name) protected QNamegenerateSchemaTypeForDocument(org.apache.ws.commons.schema.XmlSchemaSequence sequence, String parameterName) Generate schema type for document.protected QNamegenerateSchemaTypeForMap(org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericParameterType, String parameterName, boolean isArrayType) Generate schema type for map.protected voidgenerateSchemaTypeForMapParameter(org.apache.ws.commons.schema.XmlSchemaSequence entrySequence, Type parameterType, String elementName) Generate schema type for map parameter.protected org.apache.ws.commons.schema.XmlSchemaFormprotected StringgetClassName(Class<?> type) protected org.apache.ws.commons.schema.XmlSchemaComplexTypegetComplexTypeForElement(org.apache.ws.commons.schema.XmlSchema xmlSchema, QName name) protected org.apache.ws.commons.schema.XmlSchemaFormMethod[]getNsGen()protected StringgetParameterName(Annotation[][] parameterAnnotation, int j, String[] parameterNames) protected StringgetQualifiedName(Package packagez) protected StringgetSimpleClassName(Class type) protected org.apache.ws.commons.schema.XmlSchemagetXmlSchema(String targetNamespace) protected booleanisDataHandler(Class<?> clazz) booleanprotected voidprocessException(Method jMethod, AxisOperation axisOperation) This method will generate Schema element for all the excetion types in a given JMethod - No matter what it will generate Schema element for java.lang.Exception so that for other exception which extend java.lang.Excetion can use as the base class typeprotected Method[]processMethods(Method[] declaredMethods) protected StringresolveSchemaNamespace(String packageName) voidsetAttrFormDefault(String attrFormDefault) voidsetAxisService(AxisService service) voidsetCustomSchemaLocation(String customSchemaLocation) voidsetElementFormDefault(String elementFormDefault) voidsetExcludeMethods(List<String> excludeMethods) voidsetExtraClasses(List<String> extraClasses) voidsetMappingFileLocation(String mappingFileLocation) voidsetNonRpcMethods(List<String> nonRpcMethods) voidsetNsGen(NamespaceGenerator nsGen) voidsetPkg2nsmap(Map<String, String> pkg2nsmap) voidsetUseWSDLTypesNamespace(boolean useWSDLTypesNamespace)
-
Field Details
-
NAME_SPACE_PREFIX
- See Also:
-
targetNamespacePrefixMap
-
schemaMap
-
xmlSchemaCollection
protected org.apache.ws.commons.schema.XmlSchemaCollection xmlSchemaCollection -
classLoader
-
className
-
typeTable
-
methods
-
methodTable
-
schemaTargetNameSpace
-
schema_namespace_prefix
-
attrFormDefault
-
elementFormDefault
-
excludeMethods
-
extraClasses
-
useWSDLTypesNamespace
protected boolean useWSDLTypesNamespace -
pkg2nsmap
-
nsGen
-
targetNamespace
-
nonRpcMethods
-
serviceClass
-
service
-
customSchemaLocation
-
mappingFileLocation
-
generateBaseException
protected boolean generateBaseException -
sortAttributes
protected boolean sortAttributes -
isGenerateWrappedArrayTypes
protected boolean isGenerateWrappedArrayTypes
-
-
Constructor Details
-
DefaultSchemaGenerator
public DefaultSchemaGenerator(ClassLoader loader, String className, String schematargetNamespace, String schematargetNamespacePrefix, AxisService service) throws Exception - Throws:
Exception
-
-
Method Details
-
getNsGen
- Throws:
Exception
-
setNsGen
- Specified by:
setNsGenin interfaceSchemaGenerator
-
generateSchema
Generates schema for all the parameters in method. First generates schema for all different parameter type and later refers to them.- Specified by:
generateSchemain interfaceSchemaGenerator- Returns:
- Returns XmlSchema.
- Throws:
Exception
-
processMethods
- Throws:
Exception
-
processException
This method will generate Schema element for all the excetion types in a given JMethod - No matter what it will generate Schema element for java.lang.Exception so that for other exception which extend java.lang.Excetion can use as the base class type- Throws:
Exception
-
generateSchema
Generate schema construct for given type- Parameters:
javaType- : Class to whcih need to generate Schema- Returns:
- : Generated QName
- Throws:
Exception
-
generateSchemaforFieldsandProperties
protected void generateSchemaforFieldsandProperties(org.apache.ws.commons.schema.XmlSchema xmlSchema, org.apache.ws.commons.schema.XmlSchemaSequence sequence, Class<?> type, String name, boolean isArrayType) throws Exception - Throws:
Exception
-
generateSchemaforGenericFields
protected void generateSchemaforGenericFields(org.apache.ws.commons.schema.XmlSchema xmlSchema, org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericType, String name) throws Exception - Throws:
Exception
-
isDataHandler
-
addContentToMethodSchemaType
-
getComplexTypeForElement
protected org.apache.ws.commons.schema.XmlSchemaComplexType getComplexTypeForElement(org.apache.ws.commons.schema.XmlSchema xmlSchema, QName name) -
getXmlSchema
-
getTypeTable
- Specified by:
getTypeTablein interfaceSchemaGenerator
-
getMethods
- Specified by:
getMethodsin interfaceSchemaGenerator
-
generatePrefix
-
setExcludeMethods
- Specified by:
setExcludeMethodsin interfaceSchemaGenerator
-
getSchemaTargetNameSpace
- Specified by:
getSchemaTargetNameSpacein interfaceSchemaGenerator
-
addImport
-
getAttrFormDefault
-
setAttrFormDefault
- Specified by:
setAttrFormDefaultin interfaceSchemaGenerator
-
getElementFormDefault
-
setElementFormDefault
- Specified by:
setElementFormDefaultin interfaceSchemaGenerator
-
getAttrFormDefaultSetting
protected org.apache.ws.commons.schema.XmlSchemaForm getAttrFormDefaultSetting() -
getElementFormDefaultSetting
protected org.apache.ws.commons.schema.XmlSchemaForm getElementFormDefaultSetting() -
getExtraClasses
-
setExtraClasses
- Specified by:
setExtraClassesin interfaceSchemaGenerator
-
resolveSchemaNamespace
- Throws:
Exception
-
isUseWSDLTypesNamespace
public boolean isUseWSDLTypesNamespace() -
setUseWSDLTypesNamespace
public void setUseWSDLTypesNamespace(boolean useWSDLTypesNamespace) - Specified by:
setUseWSDLTypesNamespacein interfaceSchemaGenerator
-
getPkg2nsmap
-
setPkg2nsmap
- Specified by:
setPkg2nsmapin interfaceSchemaGenerator
-
getTargetNamespace
- Specified by:
getTargetNamespacein interfaceSchemaGenerator
-
getClassName
-
getSimpleClassName
-
getQualifiedName
-
setNonRpcMethods
- Specified by:
setNonRpcMethodsin interfaceSchemaGenerator
-
setAxisService
- Specified by:
setAxisServicein interfaceSchemaGenerator
-
getCustomSchemaLocation
- Specified by:
getCustomSchemaLocationin interfaceSchemaGenerator
-
setCustomSchemaLocation
- Specified by:
setCustomSchemaLocationin interfaceSchemaGenerator
-
getMappingFileLocation
- Specified by:
getMappingFileLocationin interfaceSchemaGenerator
-
setMappingFileLocation
- Specified by:
setMappingFileLocationin interfaceSchemaGenerator
-
getParameterName
protected String getParameterName(Annotation[][] parameterAnnotation, int j, String[] parameterNames) -
generateSchemaTypeForMap
protected QName generateSchemaTypeForMap(org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericParameterType, String parameterName, boolean isArrayType) throws Exception Generate schema type for map.- Parameters:
sequence- the sequencegenericParameterType- the generic parameter typeparameterName- the parameter name- Returns:
- the q name
- Throws:
Exception- the exception
-
generateSchemaTypeForMapParameter
protected void generateSchemaTypeForMapParameter(org.apache.ws.commons.schema.XmlSchemaSequence entrySequence, Type parameterType, String elementName) throws Exception Generate schema type for map parameter.- Parameters:
entrySequence- the entry sequenceparameterType- the parameter typeelementName- the element name- Throws:
Exception- the exception
-
generateSchemaForCollection
protected QName generateSchemaForCollection(org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericType, String partName) throws Exception Generate schema for collection.- Parameters:
sequence- the sequencegenericType- the generic typepartName- the part name- Returns:
- the q name
- Throws:
Exception- the exception
-
generateSchemaTypeForDocument
protected QName generateSchemaTypeForDocument(org.apache.ws.commons.schema.XmlSchemaSequence sequence, String parameterName) Generate schema type for document.- Parameters:
sequence- the sequenceparameterName- the parameter name
-