View Javadoc

    1   package org.codehaus.xfire.jaxb;
    2
    3   import org.codehaus.xfire.service.Service;
    4   import org.codehaus.xfire.transport.TransportManager;
    5   import org.codehaus.xfire.wsdl11.WSDL11ParameterBinding;
    6   import org.codehaus.xfire.wsdl11.builder.WSDLBuilder;
    7   import org.codehaus.yom.Document;
    8   import org.codehaus.yom.Element;
    9
    10  import javax.wsdl.WSDLException;
    11
    12  /***
    13   * User: chris
    14   * Date: Aug 12, 2005
    15   * Time: 4:04:24 PM
    16   */
    17  public class JaxbWsdlBuilder extends WSDLBuilder
    18  {
    19      JaxbSchemaProvider jaxbSchemaProvider;
    20
    21      public JaxbWsdlBuilder(Service service, TransportManager transportManager, WSDL11ParameterBinding paramBinding, JaxbSchemaProvider jaxbSchemaProvider) throws WSDLException
    22      {
    23          super(service, transportManager, paramBinding);
    24
    25          this.jaxbSchemaProvider = jaxbSchemaProvider;
    26      }
    27
    28      public void addDependency(org.codehaus.xfire.wsdl.SchemaType type)
    29      {
    30          if (!hasDependency(type))
    31          {
    32              if (type instanceof JaxbType)
    33              {
    34                  JaxbType jaxbType = (JaxbType) type;
    35
    36                  Element schema = jaxbSchemaProvider.getSchema(jaxbType, this);
    37                  schema.detach();
    38                  setSchema(jaxbType.getSchemaType().getNamespaceURI(), schema);
    39              }
    40
    41          }
    42          super.addDependency(type);
    43      }
    44
    45
    46  }