public class DefaultSchemaGenerator extends Object implements Java2WSDLConstants, SchemaGenerator
| Modifier and Type | Class and Description |
|---|---|
class |
DefaultSchemaGenerator.MathodComparator |
class |
DefaultSchemaGenerator.PropertyComparator |
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 and Description |
|---|
DefaultSchemaGenerator(ClassLoader loader,
String className,
String schematargetNamespace,
String schematargetNamespacePrefix,
AxisService service) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addContentToMethodSchemaType(org.apache.ws.commons.schema.XmlSchemaSequence sequence,
QName schemaTypeName,
String paraName,
boolean isArray) |
protected void |
addImport(org.apache.ws.commons.schema.XmlSchema xmlSchema,
QName schemaTypeName) |
protected String |
generatePrefix() |
Collection<org.apache.ws.commons.schema.XmlSchema> |
generateSchema()
Generates schema for all the parameters in method.
|
protected QName |
generateSchema(Class<?> javaType)
Generate schema construct for given type
|
protected QName |
generateSchemaForCollection(org.apache.ws.commons.schema.XmlSchemaSequence sequence,
Type genericType,
String partName)
Generate schema for collection.
|
protected void |
generateSchemaforFieldsandProperties(org.apache.ws.commons.schema.XmlSchema xmlSchema,
org.apache.ws.commons.schema.XmlSchemaSequence sequence,
Class<?> type,
String name,
boolean isArrayType) |
protected void |
generateSchemaforGenericFields(org.apache.ws.commons.schema.XmlSchema xmlSchema,
org.apache.ws.commons.schema.XmlSchemaSequence sequence,
Type genericType,
String name) |
protected QName |
generateSchemaTypeForDocument(org.apache.ws.commons.schema.XmlSchemaSequence sequence,
String parameterName)
Generate schema type for document.
|
protected QName |
generateSchemaTypeForMap(org.apache.ws.commons.schema.XmlSchemaSequence sequence,
Type genericParameterType,
String parameterName,
boolean isArrayType)
Generate schema type for map.
|
protected void |
generateSchemaTypeForMapParameter(org.apache.ws.commons.schema.XmlSchemaSequence entrySequence,
Type parameterType,
String elementName)
Generate schema type for map parameter.
|
String |
getAttrFormDefault() |
protected org.apache.ws.commons.schema.XmlSchemaForm |
getAttrFormDefaultSetting() |
protected String |
getClassName(Class<?> type) |
protected org.apache.ws.commons.schema.XmlSchemaComplexType |
getComplexTypeForElement(org.apache.ws.commons.schema.XmlSchema xmlSchema,
QName name) |
String |
getCustomSchemaLocation() |
String |
getElementFormDefault() |
protected org.apache.ws.commons.schema.XmlSchemaForm |
getElementFormDefaultSetting() |
List<String> |
getExtraClasses() |
String |
getMappingFileLocation() |
Method[] |
getMethods() |
NamespaceGenerator |
getNsGen() |
protected String |
getParameterName(Annotation[][] parameterAnnotation,
int j,
String[] parameterNames) |
Map<String,String> |
getPkg2nsmap() |
protected String |
getQualifiedName(Package packagez) |
String |
getSchemaTargetNameSpace() |
protected String |
getSimpleClassName(Class type) |
String |
getTargetNamespace() |
TypeTable |
getTypeTable() |
protected org.apache.ws.commons.schema.XmlSchema |
getXmlSchema(String targetNamespace) |
protected boolean |
isDataHandler(Class<?> clazz) |
boolean |
isUseWSDLTypesNamespace() |
protected void |
processException(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 type
|
protected Method[] |
processMethods(Method[] declaredMethods) |
protected String |
resolveSchemaNamespace(String packageName) |
void |
setAttrFormDefault(String attrFormDefault) |
void |
setAxisService(AxisService service) |
void |
setCustomSchemaLocation(String customSchemaLocation) |
void |
setElementFormDefault(String elementFormDefault) |
void |
setExcludeMethods(List<String> excludeMethods) |
void |
setExtraClasses(List<String> extraClasses) |
void |
setMappingFileLocation(String mappingFileLocation) |
void |
setNonRpcMethods(List<String> nonRpcMethods) |
void |
setNsGen(NamespaceGenerator nsGen) |
void |
setPkg2nsmap(Map<String,String> pkg2nsmap) |
void |
setUseWSDLTypesNamespace(boolean useWSDLTypesNamespace) |
public static final String NAME_SPACE_PREFIX
protected org.apache.ws.commons.schema.XmlSchemaCollection xmlSchemaCollection
protected ClassLoader classLoader
protected String className
protected TypeTable typeTable
protected Method[] methods
protected MethodTable methodTable
protected String schemaTargetNameSpace
protected String schema_namespace_prefix
protected String attrFormDefault
protected String elementFormDefault
protected boolean useWSDLTypesNamespace
protected NamespaceGenerator nsGen
protected String targetNamespace
protected Class<?> serviceClass
protected AxisService service
protected String customSchemaLocation
protected String mappingFileLocation
protected boolean generateBaseException
protected boolean sortAttributes
protected boolean isGenerateWrappedArrayTypes
public DefaultSchemaGenerator(ClassLoader loader, String className, String schematargetNamespace, String schematargetNamespacePrefix, AxisService service) throws Exception
Exceptionpublic NamespaceGenerator getNsGen() throws Exception
Exceptionpublic void setNsGen(NamespaceGenerator nsGen)
setNsGen in interface SchemaGeneratorpublic Collection<org.apache.ws.commons.schema.XmlSchema> generateSchema() throws Exception
generateSchema in interface SchemaGeneratorExceptionprotected Method[] processMethods(Method[] declaredMethods) throws Exception
Exceptionprotected void processException(Method jMethod, AxisOperation axisOperation) throws Exception
Exceptionprotected QName generateSchema(Class<?> javaType) throws Exception
javaType - : Class to whcih need to generate SchemaExceptionprotected void generateSchemaforFieldsandProperties(org.apache.ws.commons.schema.XmlSchema xmlSchema,
org.apache.ws.commons.schema.XmlSchemaSequence sequence,
Class<?> type,
String name,
boolean isArrayType)
throws Exception
Exceptionprotected void generateSchemaforGenericFields(org.apache.ws.commons.schema.XmlSchema xmlSchema,
org.apache.ws.commons.schema.XmlSchemaSequence sequence,
Type genericType,
String name)
throws Exception
Exceptionprotected boolean isDataHandler(Class<?> clazz)
protected void addContentToMethodSchemaType(org.apache.ws.commons.schema.XmlSchemaSequence sequence,
QName schemaTypeName,
String paraName,
boolean isArray)
protected org.apache.ws.commons.schema.XmlSchemaComplexType getComplexTypeForElement(org.apache.ws.commons.schema.XmlSchema xmlSchema,
QName name)
protected org.apache.ws.commons.schema.XmlSchema getXmlSchema(String targetNamespace)
public TypeTable getTypeTable()
getTypeTable in interface SchemaGeneratorpublic Method[] getMethods()
getMethods in interface SchemaGeneratorprotected String generatePrefix()
public void setExcludeMethods(List<String> excludeMethods)
setExcludeMethods in interface SchemaGeneratorpublic String getSchemaTargetNameSpace()
getSchemaTargetNameSpace in interface SchemaGeneratorprotected void addImport(org.apache.ws.commons.schema.XmlSchema xmlSchema,
QName schemaTypeName)
public String getAttrFormDefault()
public void setAttrFormDefault(String attrFormDefault)
setAttrFormDefault in interface SchemaGeneratorpublic String getElementFormDefault()
public void setElementFormDefault(String elementFormDefault)
setElementFormDefault in interface SchemaGeneratorprotected org.apache.ws.commons.schema.XmlSchemaForm getAttrFormDefaultSetting()
protected org.apache.ws.commons.schema.XmlSchemaForm getElementFormDefaultSetting()
public void setExtraClasses(List<String> extraClasses)
setExtraClasses in interface SchemaGeneratorprotected String resolveSchemaNamespace(String packageName) throws Exception
Exceptionpublic boolean isUseWSDLTypesNamespace()
public void setUseWSDLTypesNamespace(boolean useWSDLTypesNamespace)
setUseWSDLTypesNamespace in interface SchemaGeneratorpublic void setPkg2nsmap(Map<String,String> pkg2nsmap)
setPkg2nsmap in interface SchemaGeneratorpublic String getTargetNamespace()
getTargetNamespace in interface SchemaGeneratorpublic void setNonRpcMethods(List<String> nonRpcMethods)
setNonRpcMethods in interface SchemaGeneratorpublic void setAxisService(AxisService service)
setAxisService in interface SchemaGeneratorpublic String getCustomSchemaLocation()
getCustomSchemaLocation in interface SchemaGeneratorpublic void setCustomSchemaLocation(String customSchemaLocation)
setCustomSchemaLocation in interface SchemaGeneratorpublic String getMappingFileLocation()
getMappingFileLocation in interface SchemaGeneratorpublic void setMappingFileLocation(String mappingFileLocation)
setMappingFileLocation in interface SchemaGeneratorprotected String getParameterName(Annotation[][] parameterAnnotation, int j, String[] parameterNames)
protected QName generateSchemaTypeForMap(org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericParameterType, String parameterName, boolean isArrayType) throws Exception
sequence - the sequencegenericParameterType - the generic parameter typeparameterName - the parameter nameException - the exceptionprotected void generateSchemaTypeForMapParameter(org.apache.ws.commons.schema.XmlSchemaSequence entrySequence,
Type parameterType,
String elementName)
throws Exception
entrySequence - the entry sequenceparameterType - the parameter typeelementName - the element nameException - the exceptionprotected QName generateSchemaForCollection(org.apache.ws.commons.schema.XmlSchemaSequence sequence, Type genericType, String partName) throws Exception
sequence - the sequencegenericType - the generic typepartName - the part nameException - the exceptionCopyright © 2004–2020 The Apache Software Foundation. All rights reserved.