Package org.codehaus.enunciate.contract.validation

Examples of org.codehaus.enunciate.contract.validation.ValidationResult.addError()


        }
      }
    }

    if (((DecoratedTypeMirror) complexType.getSuperclass()).isInstanceOf(Map.class.getName())) {
      result.addError(complexType, "Enunciate can't generate GWT code that handles types that implement java.util.Map. I'm afraid you'll have to disable the GWT module or use @XmlJavaTypeAdapter to adapt the type.");
    }

    return result;
  }
View Full Code Here


    ValidationResult result = super.validateSimpleType(simpleType);
    if (!isGWTTransient(simpleType)) {
      if ((this.enforceNamespaceConformance)
        && (!simpleType.getPackage().getQualifiedName().startsWith(this.gwtModuleNamespace))
        && (!isKnownGwtType(simpleType))) {
        result.addError(simpleType, String.format("The package of the simple type, %s, must start with the GWT module namespace, %s.", simpleType.getPackage().getQualifiedName(), gwtModuleNamespace));
      }

      if (!hasDefaultConstructor(simpleType)) {
        result.addError(simpleType, "The mapping from GWT to JAXB requires a public no-arg constructor.");
      }
View Full Code Here

        && (!isKnownGwtType(simpleType))) {
        result.addError(simpleType, String.format("The package of the simple type, %s, must start with the GWT module namespace, %s.", simpleType.getPackage().getQualifiedName(), gwtModuleNamespace));
      }

      if (!hasDefaultConstructor(simpleType)) {
        result.addError(simpleType, "The mapping from GWT to JAXB requires a public no-arg constructor.");
      }
    }
    return result;
  }
View Full Code Here

    ValidationResult result = super.validateEnumType(enumType);
    if (!isGWTTransient(enumType)) {
      if ((this.enforceNamespaceConformance)
        && (!enumType.getPackage().getQualifiedName().startsWith(this.gwtModuleNamespace))
        && (!isKnownGwtType(enumType))) {
        result.addError(enumType, String.format("The package of the enum type, %s, must start with the GWT module namespace, %s.", enumType.getPackage().getQualifiedName(), gwtModuleNamespace));
      }
    }
    return result;
  }
View Full Code Here

    ValidationResult result = super.validateEndpointInterface(ei);

    EndpointInterface visited = visitedEndpoints.put(ei.getServiceName(), ei);
    if (visited != null) {
      if (visited.getTargetNamespace().equals(ei.getTargetNamespace())) {
        result.addError(ei, "Ummm... you already have a service named " + ei.getServiceName() + " at " +
          visited.getPosition() + ".  You need to disambiguate.");
      }
    }

    for (WebMethod webMethod : ei.getWebMethods()) {
View Full Code Here

    for (WebMethod webMethod : ei.getWebMethods()) {
      for (WebParam webParam : webMethod.getWebParameters()) {
        if ((webParam.isHeader()) && ("".equals(webParam.getAnnotation(javax.jws.WebParam.class).name()))) {
          //todo: lift this constraint by serializing the parameter names to some file you can load for metadata...
          result.addError(webParam, "For now, Enunciate requires you to specify a 'name' on the @WebParam annotation if it's a header.");
        }
      }
    }

    if (ei.getEndpointImplementations().size() > 1) {
View Full Code Here

    if (ei.getEndpointImplementations().size() > 1) {
      ArrayList<String> impls = new ArrayList<String>();
      for (EndpointImplementation impl : ei.getEndpointImplementations()) {
        impls.add(impl.getQualifiedName());
      }
      result.addError(ei, "Sorry, JAXWS-RI module doesn't support two endpoint implementations for interface '" + ei.getQualifiedName() +
        "'.  Found " + ei.getEndpointImplementations().size() + " implementations (" + impls.toString() + ").");
    }
    else if (ei.getEndpointImplementations().isEmpty()) {
      result.addError(ei, "JAXWS-RI module requires an implementation for each service interface.");
    }
View Full Code Here

      }
      result.addError(ei, "Sorry, JAXWS-RI module doesn't support two endpoint implementations for interface '" + ei.getQualifiedName() +
        "'.  Found " + ei.getEndpointImplementations().size() + " implementations (" + impls.toString() + ").");
    }
    else if (ei.getEndpointImplementations().isEmpty()) {
      result.addError(ei, "JAXWS-RI module requires an implementation for each service interface.");
    }

    return result;
  }
View Full Code Here

    if (enableJaxws) {
      EndpointInterface visited = visitedEndpoints.put(ei.getServiceName(), ei);
      if (visited != null) {
        if (visited.getTargetNamespace().equals(ei.getTargetNamespace())) {
          result.addError(ei, "Ummm... you already have a service named " + ei.getServiceName() + " at " +
            visited.getPosition() + ".  You need to disambiguate.");
        }
      }

      if (ei.isInterface()) {
View Full Code Here

      }

      if (ei.isInterface()) {
        WebService eiAnnotation = ei.getAnnotation(WebService.class);
        if (!"".equals(eiAnnotation.serviceName())) {
          result.addError(ei, "CXF fails if you specify 'serviceName' on an endpoint interface.");
        }
        if (!"".equals(eiAnnotation.portName())) {
          result.addError(ei, "CXF fails if you specify 'portName' on an endpoint interface.");
        }
        for (MethodDeclaration m : ei.getMethods()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.