Class DefaultSchemaGenerator

java.lang.Object
org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator
All Implemented Interfaces:
Java2WSDLConstants, SchemaGenerator
Direct Known Subclasses:
DocLitBareSchemaGenerator

public class DefaultSchemaGenerator extends Object implements Java2WSDLConstants, SchemaGenerator
  • Field Details

    • NAME_SPACE_PREFIX

      public static final String NAME_SPACE_PREFIX
      See Also:
    • targetNamespacePrefixMap

      protected Map<String,String> targetNamespacePrefixMap
    • schemaMap

      protected Map<String,org.apache.ws.commons.schema.XmlSchema> schemaMap
    • xmlSchemaCollection

      protected org.apache.ws.commons.schema.XmlSchemaCollection xmlSchemaCollection
    • classLoader

      protected ClassLoader classLoader
    • className

      protected String className
    • typeTable

      protected TypeTable typeTable
    • methods

      protected Method[] methods
    • methodTable

      protected MethodTable methodTable
    • schemaTargetNameSpace

      protected String schemaTargetNameSpace
    • schema_namespace_prefix

      protected String schema_namespace_prefix
    • attrFormDefault

      protected String attrFormDefault
    • elementFormDefault

      protected String elementFormDefault
    • excludeMethods

      protected List<String> excludeMethods
    • extraClasses

      protected List<String> extraClasses
    • useWSDLTypesNamespace

      protected boolean useWSDLTypesNamespace
    • pkg2nsmap

      protected Map<String,String> pkg2nsmap
    • nsGen

      protected NamespaceGenerator nsGen
    • targetNamespace

      protected String targetNamespace
    • nonRpcMethods

      protected List<String> nonRpcMethods
    • serviceClass

      protected Class<?> serviceClass
    • service

      protected AxisService service
    • customSchemaLocation

      protected String customSchemaLocation
    • mappingFileLocation

      protected String mappingFileLocation
    • generateBaseException

      protected boolean generateBaseException
    • sortAttributes

      protected boolean sortAttributes
    • isGenerateWrappedArrayTypes

      protected boolean isGenerateWrappedArrayTypes
  • Constructor Details

  • Method Details

    • getNsGen

      public NamespaceGenerator getNsGen() throws Exception
      Throws:
      Exception
    • setNsGen

      public void setNsGen(NamespaceGenerator nsGen)
      Specified by:
      setNsGen in interface SchemaGenerator
    • generateSchema

      public Collection<org.apache.ws.commons.schema.XmlSchema> generateSchema() throws Exception
      Generates schema for all the parameters in method. First generates schema for all different parameter type and later refers to them.
      Specified by:
      generateSchema in interface SchemaGenerator
      Returns:
      Returns XmlSchema.
      Throws:
      Exception
    • processMethods

      protected Method[] processMethods(Method[] declaredMethods) throws Exception
      Throws:
      Exception
    • processException

      protected void processException(Method jMethod, AxisOperation axisOperation) throws Exception
      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

      protected QName generateSchema(Class<?> javaType) throws Exception
      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

      protected boolean isDataHandler(Class<?> clazz)
    • addContentToMethodSchemaType

      protected void addContentToMethodSchemaType(org.apache.ws.commons.schema.XmlSchemaSequence sequence, QName schemaTypeName, String paraName, boolean isArray)
    • getComplexTypeForElement

      protected org.apache.ws.commons.schema.XmlSchemaComplexType getComplexTypeForElement(org.apache.ws.commons.schema.XmlSchema xmlSchema, QName name)
    • getXmlSchema

      protected org.apache.ws.commons.schema.XmlSchema getXmlSchema(String targetNamespace)
    • getTypeTable

      public TypeTable getTypeTable()
      Specified by:
      getTypeTable in interface SchemaGenerator
    • getMethods

      public Method[] getMethods()
      Specified by:
      getMethods in interface SchemaGenerator
    • generatePrefix

      protected String generatePrefix()
    • setExcludeMethods

      public void setExcludeMethods(List<String> excludeMethods)
      Specified by:
      setExcludeMethods in interface SchemaGenerator
    • getSchemaTargetNameSpace

      public String getSchemaTargetNameSpace()
      Specified by:
      getSchemaTargetNameSpace in interface SchemaGenerator
    • addImport

      protected void addImport(org.apache.ws.commons.schema.XmlSchema xmlSchema, QName schemaTypeName)
    • getAttrFormDefault

      public String getAttrFormDefault()
    • setAttrFormDefault

      public void setAttrFormDefault(String attrFormDefault)
      Specified by:
      setAttrFormDefault in interface SchemaGenerator
    • getElementFormDefault

      public String getElementFormDefault()
    • setElementFormDefault

      public void setElementFormDefault(String elementFormDefault)
      Specified by:
      setElementFormDefault in interface SchemaGenerator
    • getAttrFormDefaultSetting

      protected org.apache.ws.commons.schema.XmlSchemaForm getAttrFormDefaultSetting()
    • getElementFormDefaultSetting

      protected org.apache.ws.commons.schema.XmlSchemaForm getElementFormDefaultSetting()
    • getExtraClasses

      public List<String> getExtraClasses()
    • setExtraClasses

      public void setExtraClasses(List<String> extraClasses)
      Specified by:
      setExtraClasses in interface SchemaGenerator
    • resolveSchemaNamespace

      protected String resolveSchemaNamespace(String packageName) throws Exception
      Throws:
      Exception
    • isUseWSDLTypesNamespace

      public boolean isUseWSDLTypesNamespace()
    • setUseWSDLTypesNamespace

      public void setUseWSDLTypesNamespace(boolean useWSDLTypesNamespace)
      Specified by:
      setUseWSDLTypesNamespace in interface SchemaGenerator
    • getPkg2nsmap

      public Map<String,String> getPkg2nsmap()
    • setPkg2nsmap

      public void setPkg2nsmap(Map<String,String> pkg2nsmap)
      Specified by:
      setPkg2nsmap in interface SchemaGenerator
    • getTargetNamespace

      public String getTargetNamespace()
      Specified by:
      getTargetNamespace in interface SchemaGenerator
    • getClassName

      protected String getClassName(Class<?> type)
    • getSimpleClassName

      protected String getSimpleClassName(Class type)
    • getQualifiedName

      protected String getQualifiedName(Package packagez)
    • setNonRpcMethods

      public void setNonRpcMethods(List<String> nonRpcMethods)
      Specified by:
      setNonRpcMethods in interface SchemaGenerator
    • setAxisService

      public void setAxisService(AxisService service)
      Specified by:
      setAxisService in interface SchemaGenerator
    • getCustomSchemaLocation

      public String getCustomSchemaLocation()
      Specified by:
      getCustomSchemaLocation in interface SchemaGenerator
    • setCustomSchemaLocation

      public void setCustomSchemaLocation(String customSchemaLocation)
      Specified by:
      setCustomSchemaLocation in interface SchemaGenerator
    • getMappingFileLocation

      public String getMappingFileLocation()
      Specified by:
      getMappingFileLocation in interface SchemaGenerator
    • setMappingFileLocation

      public void setMappingFileLocation(String mappingFileLocation)
      Specified by:
      setMappingFileLocation in interface SchemaGenerator
    • 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 sequence
      genericParameterType - the generic parameter type
      parameterName - 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 sequence
      parameterType - the parameter type
      elementName - 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 sequence
      genericType - the generic type
      partName - 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 sequence
      parameterName - the parameter name